Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jaxb
diff options
context:
space:
mode:
Diffstat (limited to 'jaxb')
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml69
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore2
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties5
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml30
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml63
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.cvsignore1
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/build.properties7
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.properties51
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.xml32
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore2
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties5
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml30
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml55
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties12
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties12
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore1
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties7
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties51
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml32
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore2
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project17
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties5
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties43
-rw-r--r--jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml30
-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/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF13
-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.properties16
-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/.classpath15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore1
-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.prefs12
-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.properties18
-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.java143
-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/.classpath11
-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/.settings/org.eclipse.jdt.core.prefs12
-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.properties17
-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/.classpath14
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml356
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java1107
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java153
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java92
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java403
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java296
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java82
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java133
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java114
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java121
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java208
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java505
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java169
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java1660
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java143
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java157
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java86
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java580
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java149
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java191
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java185
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java124
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java297
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java347
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java482
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java206
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java319
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java268
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java65
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java676
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java1127
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java485
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java309
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java141
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java444
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java455
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java131
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java523
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java332
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java488
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java316
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java412
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java292
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java249
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java343
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java316
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java502
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java89
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java118
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java248
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java220
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java359
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java248
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java95
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java67
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java95
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java67
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java278
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java26
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java346
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java121
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java304
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java212
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java38
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java37
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java93
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java170
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java109
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java69
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java137
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java253
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java276
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java136
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java139
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java161
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java63
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java136
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java221
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java236
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java167
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java72
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java162
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java81
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java112
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java101
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java228
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java173
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java196
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java381
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java345
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java314
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java122
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java234
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java117
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java104
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java255
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java161
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java147
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java304
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java274
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java169
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java342
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java91
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java158
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java159
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java114
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java120
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java97
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java190
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java85
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java56
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java99
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java74
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java83
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java150
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java71
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java21
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java223
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java107
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java233
-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/.classpath7
-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/.settings/org.eclipse.jdt.core.prefs12
-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.properties17
-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.eclipselink.core/.classpath19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELClassMapping.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyAttributeMapping.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyElementMapping.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAttributeMapping.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATA.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATAMapping.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorNode.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorValue.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementMapping.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementsMapping.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlInverseReferenceMapping.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNode.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNodesMapping.java53
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlKey.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlNamedNodeMapping.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPath.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPathMapping.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlValueMapping.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/JaxbPackageTester.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java264
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java161
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMappingDefinition.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java204
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMappingDefinition.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java272
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMappingDefinition.java81
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java164
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java46
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java378
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMappingDefinition.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefMapping.java29
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefsMapping.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java277
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMappingDefinition.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java226
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java314
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java299
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMappingDefinition.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java43
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java182
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java61
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMapping.java105
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMappingDefinition.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java625
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPathFactory.java48
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java89
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlCDATAAnnotationDefinition.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorNodeAnnotationDefinition.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorValueAnnotationDefinition.java51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodeAnnotationDefinition.java52
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodesAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlKeyAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathAnnotationDefinition.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathsAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java60
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlCDATAAnnotation.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java110
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlKeyAnnotation.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java77
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlCDATAAnnotation.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java118
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java118
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java211
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlKeyAnnotation.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java167
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java103
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java121
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java119
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java89
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinition.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinitionFactory.java22
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java114
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlCDATAAnnotation.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorValueAnnotation.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java59
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java88
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlKeyAnnotation.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java54
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gifbin908 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gifbin283 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gifbin908 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties25
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml102
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java105
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java40
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java36
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java222
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_4/ELJaxb_2_4_PlatformUi.java23
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.classpath13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.project28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF51
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/about.html34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties21
-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_class.gifbin1005 -> 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/jaxb_enum.gifbin981 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gifbin1010 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gifbin1007 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.icobin1150 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gifbin983 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.icobin1150 -> 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.gifbin950 -> 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/text.gifbin349 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gifbin951 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-element.gifbin973 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-attribute.gifbin937 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gifbin995 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gifbin978 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element.gifbin960 -> 0 bytes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gifbin940 -> 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.properties49
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml406
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties174
-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.java225
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java187
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java79
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java187
-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/actions/OpenJaxbResourceAction.java91
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java80
-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.java106
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.java72
-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/JaxbClassItemContentProvider.java75
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java44
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java108
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java42
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java75
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java50
-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/JaxbNavigatorActionProvider.java66
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java176
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java69
-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.java80
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java320
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java962
-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.java233
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java770
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java426
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java779
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java215
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java192
-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.java145
-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.java198
-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.java213
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java343
-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
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath13
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project28
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF31
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties16
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties23
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java58
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java66
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java82
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java122
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java517
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java98
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java40
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java185
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java2142
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java413
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java137
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java381
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java793
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java160
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java197
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java173
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java151
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java531
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java727
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java1050
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java590
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java411
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java363
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java169
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java669
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java206
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java152
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java304
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java52
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java125
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java41
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java94
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java76
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java41
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java63
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java60
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java94
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java66
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java106
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java136
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java174
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java305
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java280
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java237
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java290
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java203
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java380
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java89
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java109
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java49
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java267
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java111
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java108
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java49
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java131
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java263
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java156
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java240
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java144
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java49
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java340
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java51
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml35
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath14
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project28
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF27
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties16
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties23
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java59
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java85
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbContextModelTestCase.java29
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java38
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaClassMappingTests.java155
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyAttributeMappingTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyElementMappingTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAttributeMappingTests.java240
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorNodeTests.java134
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorValueTests.java125
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementMappingTests.java296
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementsMappingTests.java173
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlInverseReferenceMappingTests.java116
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodeTests.java209
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodesMappingTests.java197
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlPathTests.java126
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlValueMappingTests.java109
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJaxbCoreJavaContextModelTests.java43
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java40
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java48
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java39
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlCDATAAnnotationTests.java74
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorNodeAnnotationTests.java89
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorValueAnnotationTests.java89
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java112
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlJoinNodeAnnotationTests.java251
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlKeyAnnotationTests.java74
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlPathAnnotationTests.java162
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java121
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml70
943 files changed, 0 insertions, 92133 deletions
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project
deleted file mode 100644
index 7064cbb9c5..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.properties
deleted file mode 100644
index 7d721a4154..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/build.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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties
deleted file mode 100644
index 1ec5c11f47..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink DBWS Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink DBWS Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml
deleted file mode 100644
index f0855f8e97..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.dbws.eclipselink.feature"
- label="%featureName"
- version="1.1.100.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.dbws.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.eclipselink.feature" version="1.2.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.dbws.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.dbws.eclipselink.core.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="javax.wsdl"
- download-size="0"
- install-size="0"
- version="1.6.2.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.dbws"
- download-size="0"
- install-size="0"
- version="2.4.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.dbws.builder"
- download-size="0"
- install-size="0"
- version="2.4.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.dbws.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not 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
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/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@
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 80f93d0255..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# 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.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - DBWS EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 1c3e2eb73b..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /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
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 1429a53f4c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateBundle/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 - DBWS EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index c6c18cd9d0..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - DBWS EclipseLink Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not 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
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/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@
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index a8c9da3a8a..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# 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.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - DBWS EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2010, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 1429a53f4c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink.feature/sourceTemplatePlugin/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 - DBWS EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project
deleted file mode 100644
index b4ba97299c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.dbws.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index 931945e37c..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.dbws.eclipselink.feature.source=org.eclipse.jpt.dbws.eclipselink.feature
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index 8150339a80..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink DBWS Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink DBWS Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2010, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml b/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 711fd8ea1e..0000000000
--- a/jaxb/features/org.eclipse.jpt.dbws.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.dbws.eclipselink_sdk.feature"
- label="%featureName"
- version="1.1.100.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.dbws.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.dbws.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project
deleted file mode 100644
index b3f1d9bfe7..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.properties
deleted file mode 100644
index e29906deb9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/build.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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties
deleted file mode 100644
index 0227502983..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +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
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JAXB Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml
deleted file mode 100644
index b6d8b52c70..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.eclipselink.feature"
- label="%featureName"
- version="1.3.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jaxb.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.jaxb.feature" version="1.2.0"/>
- <import feature="org.eclipse.jpt.common.eclipselink.feature" version="1.2.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.persistence.moxy"
- download-size="0"
- install-size="0"
- version="2.4.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.core.schemagen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not 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
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/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@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index e21f19415d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# 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.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - JAXB EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 57daebf248..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 8a4402b35f..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB EclipseLink Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not 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
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/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@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index e21f19415d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +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
-###############################################################################
-# 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.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - JAXB EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 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
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 57daebf248..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +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
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.project
deleted file mode 100644
index d6cc694f83..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.properties
deleted file mode 100644
index b0e15e413e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JAXB Core JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools EclipseLink JAXB Core JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.xml
deleted file mode 100644
index cf1675411a..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink.tests.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.eclipselink.tests.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jaxb.eclipselink.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project
deleted file mode 100644
index a51d4183a3..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index c8dc8260e0..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jaxb.eclipselink.feature.source=org.eclipse.jpt.jaxb.eclipselink.feature
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index ebf310a10d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JAXB Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2010, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 8e362466de..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.eclipselink_sdk.feature"
- label="%featureName"
- version="1.2.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jaxb.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.feature/.project
deleted file mode 100644
index 6b7e145cd1..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/build.properties
deleted file mode 100644
index e29906deb9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/build.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
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties
deleted file mode 100644
index 2aabe7d81f..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.properties
+++ /dev/null
@@ -1,43 +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
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml
deleted file mode 100644
index ba30bb88c5..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/feature.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.feature"
- label="%featureName"
- version="1.2.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jaxb.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.feature" version="1.2.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jaxb.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.core.schemagen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jaxb.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +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>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not 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
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/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@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 5bc4b671f1..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 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.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source - JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 86c4916ad2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 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/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index fba3ef0266..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +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
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 1a12bce83a..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +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>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; 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 (&quot;Redistributor&quot;) 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.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not 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
-
-
-
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/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@
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 6f32073796..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 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.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source - JAXB Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008, 2010. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,12 +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
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gif b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.png b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties b/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 86c4916ad2..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 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/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project
deleted file mode 100644
index d48dee7bd4..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties
deleted file mode 100644
index 918f79e94d..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Core JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools JAXB JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml
deleted file mode 100644
index 7c26e5f952..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb.tests.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb.tests.feature"
- label="%featureName"
- version="1.1.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jaxb.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore
deleted file mode 100644
index 9d0e114f67..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-feature.temp.folder
-build.xml
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project
deleted file mode 100644
index dbf60be032..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties
deleted file mode 100644
index cb9672db24..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jaxb.feature.source=org.eclipse.jpt.jaxb.feature
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpg b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties
deleted file mode 100644
index 5bd2b66567..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2010, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JAXB Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence Tools - JAXB Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2010, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml b/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml
deleted file mode 100644
index b7ba9b0811..0000000000
--- a/jaxb/features/org.eclipse.jpt.jaxb_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jaxb_sdk.feature"
- label="%featureName"
- version="1.2.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jaxb.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jaxb.feature.source"
- version="0.0.0"/>
-
-</feature>
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 7360b507a5..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.1.100.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 64c5e31b7a..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/J2SE-1.5"/>
- <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 ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
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/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7fd88b1dd7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:03 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.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 be182acf00..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +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: J2SE-1.5
-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,
- org.eclipse.jpt.dbws.eclipselink.core.gen.internal;x-internal:=true
-Import-Package: org.eclipse.persistence.oxm
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 5a838ab2cc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.core.gen/build.properties
+++ /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
-################################################################################
-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 76f5da81fa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.classpath
+++ /dev/null
@@ -1,15 +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/jpt/common/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <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.dbws.eclipselink.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
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 3fa75e2387..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:08 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.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 7afa8ef09c..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.200.qualifier
-Bundle-Activator: org.eclipse.jpt.dbws.eclipselink.ui.JptDbwsUiPlugin
-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.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 377eb5ce7a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
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 7313ad6ac4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.dbws.eclipselink.ui/src/org/eclipse/jpt/dbws/eclipselink/core/internal/gen/DbwsGenerator.java
+++ /dev/null
@@ -1,143 +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.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-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
-
- }
-
- // ********** 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 de2e5e81d3..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, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.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 ((IJavaElement) project.getAdapter(IJavaElement.class)).getJavaProject();
- }
-
- 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 5b91e00fa6..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, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.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 ((IJavaElement) project.getAdapter(IJavaElement.class)).getJavaProject();
- }
-}
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 afadb452a1..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.2.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 2fc0e3f0a8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath
+++ /dev/null
@@ -1,11 +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">
- <accessrules>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
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/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b92672fdf6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:29 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index 6bb4d25868..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.200.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 d535c6112b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core.schemagen/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
-###############################################################################
-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 84e5b0b8a4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project
deleted file mode 100644
index 54ea9292fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0569657a4d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:18 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 23f50e58c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,56 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.core;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.402,2.0.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.2.100,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.common.uriresolver;bundle-version="[1.1.401,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.200,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.wst.xsd.core;bundle-version="[1.1.600,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.core,
- org.eclipse.jpt.jaxb.core.context,
- org.eclipse.jpt.jaxb.core.context.java,
- org.eclipse.jpt.jaxb.core.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.facet;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.gen;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.jaxb21;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.jaxb22;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.libprov;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.platform;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.prefs;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;x-internal:=true,
- org.eclipse.jpt.jaxb.core.internal.validation;x-internal:=true,
- org.eclipse.jpt.jaxb.core.libprov,
- org.eclipse.jpt.jaxb.core.platform,
- org.eclipse.jpt.jaxb.core.resource.java,
- org.eclipse.jpt.jaxb.core.resource.jaxbindex,
- org.eclipse.jpt.jaxb.core.resource.jaxbprops,
- org.eclipse.jpt.jaxb.core.xsd
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
deleted file mode 100644
index 30afd4a06d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = schema/
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml
deleted file mode 100644
index 1bf3de57da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/component.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jaxb.core">
- <description url=""></description>
- <component-depends unrestricted="true"></component-depends>
- <plugin id="org.eclipse.jpt.jaxb.core" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
deleted file mode 100644
index f5d65fa9c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JAXB Core
-providerName = Eclipse Web Tools Platform
-
-JAXB_PLATFORMS = JAXB Platforms
-
-JAXB_INDEX_CONTENT = JAXB Index File
-JAXB_PROPERTIES_CONTENT = JAXB Properties File
-
-JAXB_PROBLEM_MARKER = JAXB Problem
-
-GENERIC_PLATFORM_GROUP_LABEL = Generic JAXB
-GENERIC_2_2_PLATFORM_LABEL = Generic JAXB 2.2
-GENERIC_2_1_PLATFORM_LABEL = Generic JAXB 2.1
-
-JAXB_FACET_LABEL = JAXB
-JAXB_FACET_DESCRIPTION = Adds support for data binding using the Java Architecture for XML Binding (JAXB).
-JAXB_TEMPLATE_LABEL = JAXB Project
-
-JAXB_NO_OP_LIBRARY_PROVIDER_MESSAGE = The JAXB facet requires a JAXB implementation library to be present on the project classpath. By disabling library configuration, the user takes on the responsibility of ensuring that the classpath is configured appropriately via alternate means.
-
-JAXB_JRE_LIBRARY_PROVIDER_LABEL = JRE
-JAXB_JRE_LIBRARY_PROVIDER_MESSAGE = The project JRE provides the annotations and implementation to support the chosen JAXB platform.
-
-JAXB_VALIDATOR = JAXB Validator
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
deleted file mode 100644
index 6be37f5087..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/plugin.xml
+++ /dev/null
@@ -1,356 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- Copyright (c) 2010, 2012 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jaxbPlatforms"
- name="%JAXB_PLATFORMS"
- schema="schema/jaxbPlatforms.exsd"/>
-
-
- <!-- ***** adapters ***** -->
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.ResourceAdapterFactory"
- adaptableType="org.eclipse.core.resources.IResource">
- <adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.JavaElementAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IJavaElement">
- <adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"/>
- </factory>
-
- <!-- IPackageFragment -> JaxbPackage -->
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.context.JaxbPackageAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IPackageFragment">
- <adapter type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbLibraryProviderInstallOperationConfigAdapterFactory"
- adaptableType="org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig">
- <adapter type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"/>
- </factory>
-
- </extension>
-
-
- <!-- ***** content types ***** -->
-
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.jaxb.core.content.jaxbIndex"
- name="%JAXB_INDEX_CONTENT"
- base-type="org.eclipse.core.runtime.text"
- priority="high"
- file-names="jaxb.index"/>
-
- <content-type
- id="org.eclipse.jpt.jaxb.core.content.jaxbProperties"
- name="%JAXB_PROPERTIES_CONTENT"
- base-type="org.eclipse.jdt.core.javaProperties"
- priority="high"
- file-names="jaxb.properties"/>
-
- <file-association
- content-type="org.eclipse.core.runtime.xml"
- file-extensions="xjb"/>
-
- </extension>
-
-
- <!-- ***** property testers ***** -->
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.jaxbPlatformDescription"
- type="org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="jaxbPlatform, jaxbPlatformGroup"
- class="org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.core.propertyTester.jaxbPackage"
- type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"
- namespace="org.eclipse.jpt.jaxb.core"
- properties="hasPackageInfo"
- class="org.eclipse.jpt.jaxb.core.internal.context.JaxbPackageTester"/>
-
- </extension>
-
-
- <!-- ***** markers ***** -->
- <!--
- *** Do NOT qualify the marker id with "org.eclipse.jpt.jaxb.core".
- *** See bug 252891.
- -->
- <extension
- point="org.eclipse.core.resources.markers"
- id="jaxbProblemMarker"
- name="%JAXB_PROBLEM_MARKER">
-
- <persistent value="true"/>
-
- <!-- Can't use text marker until we have specific models for each input type (XML, java)
- <super type="org.eclipse.core.resources.textmarker"/>
- -->
-
- <super type="org.eclipse.wst.validation.problemmarker2"/>
- <super type="org.eclipse.jdt.core.problem"/>
- </extension>
-
-
- <!-- ***** Dali extensions (eat our own dogfood) ***** -->
-
- <extension
- point="org.eclipse.jpt.jaxb.core.jaxbPlatforms">
-
- <jaxbPlatformGroup
- id="generic"
- label="%GENERIC_PLATFORM_GROUP_LABEL"/>
-
- <jaxbPlatform
- id="generic_2_1"
- label="%GENERIC_2_1_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinitionFactory"
- group="generic"
- jaxbFacetVersion="2.1"
- default="false"/>
-
- <jaxbPlatform
- id="generic_2_2"
- label="%GENERIC_2_2_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinitionFactory"
- group="generic"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
-
- <libraryValidator
- id="jaxbJreLibraryValidator"
- class="org.eclipse.jpt.jaxb.core.internal.libval.JaxbJreLibraryValidator">
- <enablement>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId"
- value="jaxb-jre-library-provider"/>
- </with>
- </enablement>
- </libraryValidator>
-
- <libraryValidator
- id="genericJaxbUserLibraryValidator"
- class="org.eclipse.jpt.jaxb.core.internal.libval.GenericJaxbUserLibraryValidator">
- <enablement>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId"
- value="jaxb-user-library-provider"/>
- </with>
- </enablement>
- </libraryValidator>
-
- <!--
- <libraryValidator
- id="genericEclipselinkBundlesLibraryValidator"
- class="org.eclipse.jpt.core.internal.libval.GenericEclipseLinkBundlesLibraryValidator">
- <enablement>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.core.extendsId"
- value="eclipselink-bundles-library-provider"/>
- </with>
- </enablement>
- </libraryValidator>
- -->
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider
- id="jaxb-no-op-library-provider"
- extends="jpt-no-op-library-provider">
- <param name="message" value="%JAXB_NO_OP_LIBRARY_PROVIDER_MESSAGE"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider
- id="jaxb-jre-library-provider">
- <label>%JAXB_JRE_LIBRARY_PROVIDER_LABEL</label>
- <priority>900</priority>
- <param name="message" value="%JAXB_JRE_LIBRARY_PROVIDER_MESSAGE"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </and>
- </enablement>
- <action type="INSTALL">
- <config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbJreLibraryProviderInstallOperationConfig"/>
- <operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
- </action>
- <action type="UNINSTALL">
- <operation class="org.eclipse.jst.common.project.facet.core.libprov.NoOpLibraryProviderOperation"/>
- </action>
- </provider>
-
- <provider
- id="jaxb-user-library-provider"
- extends="wtp-user-library-provider">
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </enablement>
- <action type="INSTALL">
- <config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig"/>
- <operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperation"/>
- </action>
- </provider>
-
- <!--
- <provider
- id="jaxb-osgi-bundles-library-provider"
- extends="wtp-osgi-bundles-library-provider"
- abstract="true">
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </with>
- </enablement>
- <action type="INSTALL">
- <config class="org.eclipse.jpt.jaxb.core.internal.libprov.JaxbOsgiBundlesLibraryProviderInstallOperationConfig"/>
- <operation class="org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperation"/>
- </action>
- </provider>
-
- <provider
- id="jaxb-eclipselink-bundles-library-provider"
- extends="jaxb-osgi-bundles-library-provider"
- abstract="true"/>
- -->
-
- </extension>
-
-
- <!-- ***** WTP facet framework ***** -->
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
-
- <supported>
- <facet id="jpt.jaxb"/>
- <runtime-component any="true"/>
- </supported>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jpt.jaxb">
- <label>%JAXB_FACET_LABEL</label>
- <description>%JAXB_FACET_DESCRIPTION</description>
- <default-version version="2.1"/>
- </project-facet>
-
- <project-facet-version facet="jpt.jaxb" version="2.1">
- <constraint>
- <requires facet="java" version="[5.0"/>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jpt.jaxb" version="2.2">
- <constraint>
- <requires facet="java" version="[5.0"/>
- </constraint>
- </project-facet-version>
-
- <template id="jpt.jaxb.template">
- <label>%JAXB_TEMPLATE_LABEL</label>
- <fixed facet="jpt.jaxb"/>
- <fixed facet="java"/>
- </template>
-
- <action facet="jpt.jaxb" type="install" id="jpt.jaxb.install">
- <config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProvider"/>
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDelegate"/>
- </action>
-
- <action facet="jpt.jaxb" type="version-change" id="jpt.jaxb.version-change">
- <config-factory class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProvider"/>
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDelegate"/>
- </action>
-
- <action facet="jpt.jaxb" type="uninstall" id="jpt.jaxb.uninstall">
- <delegate class="org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetUninstallDelegate"/>
- </action>
-
- </extension>
-
-
- <!-- ***** WTP validation framework ***** -->
-
- <extension
- point="org.eclipse.wst.validation.validatorV2"
- id="jaxbValidator"
- name="%JAXB_VALIDATOR">
-
- <validator
- class="org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidator"
- markerId="org.eclipse.jpt.jaxb.core.jaxbProblemMarker">
- <include>
- <rules>
- <facet id="jpt.jaxb"/>
- </rules>
- </include>
- <include>
- <rules>
- <contentType id="org.eclipse.jdt.core.javaSource" exactMatch="false"/>
- <contentType id="org.eclipse.jpt.core.content.javaPackageInfo" exactMatch="false"/>
- <contentType id="org.eclipse.jpt.jaxb.core.content.jaxbProperties" exactMatch="false"/>
- </rules>
- </include>
- </validator>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
deleted file mode 100644
index 98fb8d159d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties
+++ /dev/null
@@ -1,94 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-NO_JAXB_PROJECT = This project has the JAXB facet, but no JAXB content could be created. See the error log for more details.
-PROJECT_INVALID_LIBRARY_PROVIDER = The currently selected JAXB library provider is invalid.
-PROJECT__UNRESOLVED_SCHEMA = Cannot resolve the schema with location ''{0}''.
-PROJECT__DUPLICATE_NAMESPACE = Duplicate schema library entries with the namespace ''{0}''.
-
-PACKAGE_NO_SCHEMA_FOR_NAMESPACE = There is no schema specified on the project for the namespace ''{0}'' on the package ''{1}''. No schema-specific validation will be performed.
-PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED = The type must be specified for an XML Java type adapter on a package
-XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT = The attribute form default conflicts with what is specified on the schema
-XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT = The element form default conflicts with what is specified on the schema
-
-XML_ENUM__NON_SIMPLE_SCHEMA_TYPE = The type ''{0}'' must be associated with a simple schema type.
-
-XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = The namespace for an anonymous type should not be different from its package
-XML_TYPE__UNSPECIFIED_FACTORY_METHOD = If a factory class is specified, a factory method must also be specified.
-XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR = A class must have a public or protected no-arg constructor, unless a factory class/method is provided or the class is adapted with an XmlAdapter.
-XML_TYPE__DUPLICATE_PROP = Duplicate property ''{0}''.
-XML_TYPE__MISSING_PROP = Missing required property ''{0}''.
-XML_TYPE__NONEXISTENT_PROP = Nonexistent property ''{0}''.
-XML_TYPE__TRANSIENT_PROP = The property ''{0}'' is transient and should not be included in the property order.
-XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM = The factory class element is ignored for enums.
-XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM = The factory method element is ignored for enums.
-XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM = The prop order element is ignored for enums.
-
-XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = The xml type of the element declaration with name ''{0}'' and namespace ''{1}'' conflicts with the xml type of the associated class
-
-XML_ENUM_VALUE__INVALID_LEXICAL_VALUE = Invalid lexical value \"{0}\" for schema type ''{1}''.
-
-ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION = The annotation ''{0}'' is not allowed to be used in conjunction with ''{1}''.
-ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED = The type for XML Java type adapter is not defined.
-XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION = An XML element wrapper may only be defined on a collection or array property
-
-XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlAnyAttribute. At most one field or property per class is allowed.
-XML_ANY_ATTRIBUTE__NON_MAP_TYPE = The type of a field or property annotated with @XmlAnyAttribute must be assignable to java.util.Map.
-
-XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are annotated with @XmlAnyElement. At most one field or property per class is allowed.
-
-XML_ATTRIBUTE__INVALID_SCHEMA_TYPE = The expected XML type associated with ''{0}'' is not valid for XML attribute ''{1}''.
-
-XML_ELEMENT__UNSPECIFIED_TYPE = Unspecified XML element type.
-XML_ELEMENT__ILLEGAL_TYPE = XML element type must be a sub-type of ''{0}''.
-XML_ELEMENT__INVALID_SCHEMA_TYPE = The expected XML type associated with ''{0}'' is not valid for XML element ''{1}''.
-
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = An element factory method must have a return type of ''javax.xml.bind.JAXBElement''.
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM = An element factory method must have a single parameter assignable to ''java.lang.Object''.
-XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME = XML element decl substitution head must not match its XML element.
-XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL = XML element decl substitution head must match another XML element decl.
-
-XML_ELEMENT_REF__UNSPECIFIED_TYPE = Unspecified XML element ref type.
-XML_ELEMENT_REF__ILLEGAL_TYPE = XML element ref type must be a sub-type of ''{0}''.
-XML_ELEMENT_REF__NO_ROOT_ELEMENT = No root element specified on type ''{0}'' or any of its sub-types.
-XML_ELEMENT_REF__NO_REGISTRY = No XML registry configured for this package.
-XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL = No XML element decl in the XML registry matching the namespace ''{0}'' and name ''{1}''.
-
-XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE = Duplicate type ''{0}'' in XML element refs.
-XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME = Duplicate element name ''{0}'' in XML element refs.
-
-XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE = Duplicate type ''{0}'' in XML elements.
-XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME = Duplicate element name ''{0}'' in XML elements.
-
-XML_ID__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are mapped as XmlID. At most one field or property per class is allowed.
-XML_ID__ATTRIBUTE_TYPE_NOT_STRING = An attribute mapped as XmlID must have type ''java.lang.String''.
-XML_ID__SCHEMA_TYPE_NOT_ID = In order to be mapped as XmlID, the type of the schema component ''{0}'' must be ''ID''.
-
-XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID = In order to be used with XmlIDREF, type ''{0}'' must contain a property or field mapped as an XmlID.
-XML_ID_REF__SCHEMA_TYPE_NOT_IDREF = In order to be used with XmlIDREF, the item type of the schema component ''{0}'' must be ''IDREF''.
-
-XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE = In order to be mapped as XmlList, an attribute must have a collection or array type.
-XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE = In order to be mapped as XmlList, the type ''{0}'' must be mapped to a non-list simple schema type.
-
-XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE = Multiple classes in package annotated with XmlRegistry.
-XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME = Duplicate XmlElementDecl name ''{0}'' {1}.
-
-XML_VALUE__MULTIPLE_MAPPINGS_DEFINED = Multiple attributes are mapped as XmlValue. At most one field or property per class is allowed.
-XML_VALUE__NO_TEXT_CONTENT = There is no text content for the XML type associated with this class.
-XML_VALUE__INVALID_SCHEMA_TYPE = The expected XML type associated with ''{0}'' is not valid for text content of the XML type associated with this class.
-
-XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = Attribute ''{0}'' must be mapped as XmlAttribute because another attribute ''{1}'' is mapped as XmlValue
-
-XML_SCHEMA_TYPE__NON_SIMPLE_TYPE = The schema type ''{0}'' is not a simple type.
-XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE = The ''type'' element should be specified when defining a schema type on a package.
-XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE = The ''type'' element should not be specified when defining a schema type on a field or property.
-
-QNAME__MISSING_NAME = {0} name not specified
-QNAME__UNRESOLVED_COMPONENT = Cannot resolve {0} with namespace ''{1}'' and name ''{2}'' in this context \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
deleted file mode 100644
index 067fcecf05..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jpt_jaxb_core.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-# Copyright (c) 2010, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-CONTEXT_MODEL_SYNC_JOB_NAME=Synchronize JAXB project: ''{0}''
-UPDATE_JOB_NAME=Update JAXB project: ''{0}''
-PREFERENCES_FLUSH_JOB_NAME=Flush Preferences: {0}
-
-ClassesGenerator_generatingClasses = Generating JAXB Classes from Schema
-ClassesGenerator_generatingClassesTask = Generating classes
-
-JaxbFacetConfig_validatePlatformNotSpecified = Platform must be specified
-JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion = Platform does not support the current JAXB facet version
-
-JreLibraryValidator_invalidPlatform = The JRE only provides implementation for a Generic JAXB platform.
-JreLibraryValidator_invalidJavaFacet = The specified Java version of {0} is insufficient to provide an implementation for JAXB version {1}. The JAXB implementation of a Java {0} runtime environment must be manually overridden by an endorsement mechanism of your choice.
-JreLibraryValidator_invalidJavaLibrary = The configured runtime is insufficient to provide an implementation for JAXB {0}.
-
-SchemaGenerator_creatingJAXBPropertiesFileTask = Creating jaxb.properties file
-
-UserLibraryValidator_incompatibleJavaFacet = The specified Java version of {0} provides a JAXB implementation that conflicts with JAXB version {1}. The JAXB implementation of a Java {0} runtime environment must be manually overridden by an endorsement mechanism of your choice.
-UserLibraryValidator_incompatibleJavaLibrary = The configured runtime conflicts with JAXB version {0}.
-
-XML_ATTRIBUTE_DESC = XML attribute declaration
-XML_ELEMENT_DESC = XML element declaration
-XML_TYPE_DESC = XML type definition
-SUBSTITUTION_HEAD_DESC = XML element substitution head
-
-XML_ELEMENT_DECL__SCOPE = in the scope of ''{0}''
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd b/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd
deleted file mode 100644
index 92b9195c13..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/schema/jaxbPlatforms.exsd
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.jaxb.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.jaxb.core" id="jaxbPlatforms" name="JAXB Platforms"/>
- </appinfo>
- <documentation>
- This is used for defining JAXB platforms and JAXB platform versions.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="jaxbPlatformGroup"/>
- <element ref="jaxbPlatform"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatformGroup">
- <annotation>
- <documentation>
- Declares a JAXB platform group. Acts as a sort of &quot;super&quot; platform. Most useful for enabling functionality for a set of platforms without having to enable the functionality for each platform separately.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique identifier for a JAXB platform group.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A translatable string representation of the JAXB platform group.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="jaxbPlatform">
- <annotation>
- <documentation>
- Declares a JAXB platform. One JAXB platform will be selected per JAXB-faceted project. See &lt;samp&gt;org.eclipse.jpt.jaxb.core.JaxbPlatform&lt;/samp&gt; for more information on JAXB platforms. Also see the org.eclipse.jpt.jaxb.ui.jaxbPlatformUis extension point.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string" use="required">
- <annotation>
- <documentation>
- A translatable string representation of the platform.
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;samp&gt;org.eclipse.jpt.jaxb.core.JaxbPlatformDefinitionFactory&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.jaxb.core.JaxbPlatformDefinitionFactory"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="group" type="string">
- <annotation>
- <documentation>
- Declares which JAXB platform group this platform belongs to. If none is specified, this platform will be assumed to belong to its own group with the same id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jaxbFacetVersion" type="string">
- <annotation>
- <documentation>
- Declares the JAXB facet version for which this platform may be used. If no facet version is specified, this platform is available for all JAXB facet versions.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="default" type="boolean" use="default" value="false">
- <annotation>
- <documentation>
- Declares whether this platform should be used as a default JAXB platform for new JAXB project content. Note that if a workspace contains more than one default platform for a JAXB facet version, one of them will be chosen at random. By default, a platform is not a default platform.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- JPT 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;
-The following example is the included generic JAXB 2.2 platform and its platform group
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension point=&quot;org.eclipse.jpt.jaxb.core.jaxbPlatforms&quot;&gt;
-
- &lt;jaxbPlatformGroup
- id=&quot;generic&quot;
- label=&quot;%GENERIC_PLATFORM_GROUP_LABEL&quot;/&gt;
-
- &lt;jaxbPlatform
- id=&quot;generic_2_2&quot;
- label=&quot;%GENERIC_2_2_PLATFORM_LABEL&quot;
- factoryClass=&quot;org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinitionFactory&quot;
- group=&quot;generic&quot;
- jaxbFacetVersion=&quot;2.2&quot;
- default=&quot;false&quot;/&gt;
-
- &lt;/extension&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-Provisional API: This interface is part of an interim API that is still
-under development and expected to change significantly before reaching
-stability. It is available at this early stage to solicit feedback from
-pioneering adopters on the understanding that any code that uses this API
-will almost certainly be broken (repeatedly) as the API evolves.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- &lt;br&gt;
-&lt;p&gt;The org.eclipse.jpt.jaxb.core plug-in provides the following jaxb platforms:
-&lt;ul&gt;
-&lt;li&gt;generic_2_2&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
-&lt;p&gt;and the following jaxb platform groups:
-&lt;ul&gt;
-&lt;li&gt;generic&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2010 Oracle. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0, which accompanies this distribution
-and is available at http://www.eclipse.org/legal/epl-v10.html.
-
-Contributors:
-Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java
deleted file mode 100644
index a6cda374d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbPlatform.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-/**
- * Constants pertaining to the Generic JAXB platforms and their group.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class GenericJaxbPlatform {
-
- public static final JaxbPlatformGroupDescription GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("generic"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_1
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("generic_2_1"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_2
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("generic_2_2"); //$NON-NLS-1$
-
-
- /**
- * Not for instantiation
- */
- private GenericJaxbPlatform() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
deleted file mode 100644
index d8fbf291a5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/GenericJaxbProjectManager.java
+++ /dev/null
@@ -1,1107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.internal.JptCommonCoreMessages;
-import org.eclipse.jpt.common.core.internal.utility.CallbackJobSynchronizer;
-import org.eclipse.jpt.common.core.internal.utility.JobSynchronizer;
-import org.eclipse.jpt.common.core.utility.command.JobCommand;
-import org.eclipse.jpt.common.utility.ExceptionHandler;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.command.StatefulCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.common.utility.internal.command.AsynchronousExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.command.SimpleStatefulExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.SimpleJaxbProjectConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
-import org.osgi.framework.BundleContext;
-
-/**
- * The JAXB project manager maintains a list of all JAXB projects in the workspace.
- * It keeps the list (and the state of the JAXB projects themselves)
- * synchronized with the workspace by listening for various
- * changes:<ul>
- * <li>Resource
- * <li>Java
- * <li>Faceted Project
- * </ul>
- * We use an Eclipse {@link ILock lock} to synchronize access to the JAXB
- * projects when dealing with these events. In an effort to reduce deadlocks,
- * the simple Resource and Java change events are dispatched to a background
- * thread, allowing us to handle the events outside of the workspace lock held
- * during resource and Java change notifications.
- * <p>
- * Events that trigger either the adding or removing of a JAXB project (e.g.
- * {@link IResourceChangeEvent#POST_CHANGE}) are handled "synchronously"
- * by allowing the background thread to handle any outstanding events before
- * updating the list of JAXB projects and returning execution to the event
- * source.
- * <p>
- * Various things that cause us to add or remove a JAXB project:<ul>
- * <li>The {@link JptJaxbCorePlugin} will "lazily" instantiate and {@link #start() start}
- * a JAXB project manager as appropriate. This will trigger the manager
- * to find and add all pre-existing JAXB projects.
- *
- * <li>Project created and facet installed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * <li>Project facet uninstalled<p>
- * {@link IFacetedProjectEvent.Type#PRE_UNINSTALL}
- *
- * <li>Project opened<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#ADDED} facet settings file
- * (<code>/.settings/org.eclipse.wst.common.project.facet.core.xml</code>)
- * <li>Project closed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file
- *
- * <li>Pre-existing project imported from directory or archive (created and opened)<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#ADDED} facet settings file
- * <li>Project renamed<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file of old project
- * -> {@link IResourceDelta#ADDED} facet settings file of new project
- * <li>Project deleted<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#REMOVED} facet settings file
- *
- * <li>Project facet installed by editing the facets settings file directly<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#CHANGED} facet settings file
- * <li>Project facet uninstalled by editing the facets settings file directly<p>
- * {@link IResourceChangeEvent#POST_CHANGE}
- * -> {@link IResource#FILE}
- * -> {@link IResourceDelta#CHANGED} facet settings file
- * </ul>
- */
-//TODO Still need to look at faceted project listener for facet uninstall
-class GenericJaxbProjectManager
- extends AbstractModel
- implements JaxbProjectManager {
-
- /**
- * All the JAXB projects in the workspace.
- */
- private final Vector<JaxbProject> jaxbProjects = new Vector<JaxbProject>();
-
- /**
- * Synchronize access to the JAXB projects.
- */
- /* private */ final ILock lock = this.getJobManager().newLock();
-
- /**
- * Determine how Resource and Java change events are
- * handled (i.e. synchronously or asynchronously).
- */
- private volatile StatefulCommandExecutor eventHandler =
- new AsynchronousExtendedCommandExecutor(
- JptCommonCoreMessages.DALI_EVENT_HANDLER_THREAD_NAME,
- new LocalExceptionHandler()
- );
-
- /* CU private */ class LocalExceptionHandler
- implements ExceptionHandler
- {
- public void handleException(Throwable t) {
- JptJaxbCorePlugin.log(t);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- /**
- * Listen for<ul>
- * <li>changes to projects and files
- * <li>clean builds
- * </ul>
- */
- private final IResourceChangeListener resourceChangeListener = new ResourceChangeListener();
-
- /**
- * The types of resource change events that interest
- * {@link #resourceChangeListener}.
- */
- private static final int RESOURCE_CHANGE_EVENT_TYPES =
- IResourceChangeEvent.POST_CHANGE |
- IResourceChangeEvent.POST_BUILD;
-
- /**
- * Listen for changes to this file to determine when the JAXB facet is
- * added to or removed from a "faceted" project.
- */
- private static final String FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME = FacetedProjectFramework.PLUGIN_ID + ".xml"; //$NON-NLS-1$
-
- /**
- * Listen for the JAXB facet being added to or removed from a "faceted" project.
- */
- private final IFacetedProjectListener facetedProjectListener = new FacetedProjectListener();
-
- /**
- * The types of faceted project events that interest
- * {@link #facetedProjectListener}.
- */
- private static final IFacetedProjectEvent.Type[] FACETED_PROJECT_EVENT_TYPES = new IFacetedProjectEvent.Type[] {
- IFacetedProjectEvent.Type.PRE_UNINSTALL
- };
-
- /**
- * Listen for Java changes (unless the Dali UI is active).
- * @see #javaElementChangeListenerIsActive()
- */
- private final JavaElementChangeListener javaElementChangeListener = new JavaElementChangeListener();
-
- /**
- * The types of resource change events that interest
- * {@link #javaElementChangeListener}.
- */
- private static final int JAVA_CHANGE_EVENT_TYPES =
- ElementChangedEvent.POST_CHANGE |
- ElementChangedEvent.POST_RECONCILE;
-
-
- // ********** constructor **********
-
- /**
- * Internal: called by {@link JptJUaxbCorePlugin Dali plug-in}.
- */
- GenericJaxbProjectManager() {
- super();
- }
-
-
- // ********** plug-in controlled life-cycle **********
-
- /**
- * Internal: called by {@link JptJaxbCorePlugin Dali plug-in}.
- */
- void start() {
- try {
- this.lock.acquire();
- this.start_();
- } finally {
- this.lock.release();
- }
- }
-
- private void start_() {
- debug("*** JAXB project manager START ***"); //$NON-NLS-1$
- try {
- this.buildJaxbProjects();
- this.eventHandler.start();
- this.getWorkspace().addResourceChangeListener(this.resourceChangeListener, RESOURCE_CHANGE_EVENT_TYPES);
- FacetedProjectFramework.addListener(this.facetedProjectListener, FACETED_PROJECT_EVENT_TYPES);
- JavaCore.addElementChangedListener(this.javaElementChangeListener, JAVA_CHANGE_EVENT_TYPES);
- } catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- this.stop_();
- }
- }
-
- /**
- * Side-effect: {@link #jaxbProjects} populated.
- */
- private void buildJaxbProjects() {
- try {
- this.buildJaxbProjects_();
- } catch (CoreException ex) {
- // if we have a problem, leave the currently built JAXB projects in
- // place and keep executing (should be OK...)
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- private void buildJaxbProjects_() throws CoreException {
- this.getWorkspace().getRoot().accept(new ResourceProxyVisitor(), IResource.NONE);
- }
-
- /**
- * Internal: called by {@link JptJaxbCorePlugin Dali plug-in}.
- */
- void stop() throws Exception {
- try {
- this.lock.acquire();
- this.stop_();
- } finally {
- this.lock.release();
- }
- }
-
- private void stop_() {
- debug("*** JAXB project manager STOP ***"); //$NON-NLS-1$
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- FacetedProjectFramework.removeListener(this.facetedProjectListener);
- this.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- try {
- this.eventHandler.stop();
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- }
- this.clearJaxbProjects();
- }
-
- private void clearJaxbProjects() {
- // clone to prevent concurrent modification exceptions
- for (JaxbProject jaxbProject : this.getJaxbProjects_()) {
- this.removeJaxbProject(jaxbProject);
- }
- }
-
-
- // ********** JaxbProjectManager implementation **********
-
- public Iterable<JaxbProject> getJaxbProjects() {
- try {
- this.lock.acquire();
- return this.getJaxbProjects_();
- } finally {
- this.lock.release();
- }
- }
-
- private Iterable<JaxbProject> getJaxbProjects_() {
- return new LiveCloneIterable<JaxbProject>(this.jaxbProjects);
- }
-
- public int getJaxbProjectsSize() {
- return this.jaxbProjects.size();
- }
-
- public JaxbProject getJaxbProject(IProject project) {
- try {
- this.lock.acquire();
- return this.getJaxbProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- private JaxbProject getJaxbProject_(IProject project) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- if (jaxbProject.getProject().equals(project)) {
- return jaxbProject;
- }
- }
- return null;
- }
-
- public JaxbFile getJaxbFile(IFile file) {
- JaxbProject jaxbProject = this.getJaxbProject(file.getProject());
- return (jaxbProject == null) ? null : jaxbProject.getJaxbFile(file);
- }
-
- public void rebuildJaxbProject(IProject project) {
- try {
- this.lock.acquire();
- this.rebuildJaxbProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- /**
- * assumption: the JAXB project holder exists
- */
- private void rebuildJaxbProject_(IProject project) {
- this.removeJaxbProject(this.getJaxbProject_(project));
- this.addJaxbProject(project);
- }
-
- public boolean javaElementChangeListenerIsActive() {
- return this.javaElementChangeListener.isActive();
- }
-
- public void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive) {
- this.javaElementChangeListener.setActive(javaElementChangeListenerIsActive);
- }
-
- public IWorkspace getWorkspace() {
- return ResourcesPlugin.getWorkspace();
- }
-
- public IJobManager getJobManager() {
- return Job.getJobManager();
- }
-
-
- // ********** adding/removing JAXB projects **********
-
- /* private */ void addJaxbProject(IProject project) {
- this.addJaxbProject(this.buildJaxbProject(project));
- }
-
- private void addJaxbProject(JaxbProject jaxbProject) {
- // figure out exactly when JAXB projects are added
- dumpStackTrace("add: ", jaxbProject); //$NON-NLS-1$
- // the JAXB project will be null if we have any problems building it...
- // (e.g. if we have problems getting the JAXB platform)
- if (jaxbProject != null) {
- this.addItemToCollection(jaxbProject, this.jaxbProjects, JAXB_PROJECTS_COLLECTION);
- }
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(IProject project) {
- return this.buildJaxbProject(this.buildJaxbProjectConfig(project));
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(JaxbProject.Config config) {
- JaxbPlatformDefinition platformDefinition = config.getPlatformDefinition();
- if (platformDefinition == null) {
- return null;
- }
- JaxbProject jaxbProject = this.buildJaxbProject(platformDefinition, config);
- if (jaxbProject == null) {
- return null;
- }
- jaxbProject.setContextModelSynchronizer(buildJobContextModelSynchronizer(jaxbProject));
- jaxbProject.setUpdateSynchronizer(buildJobUpdateSynchronizer(jaxbProject));
- return jaxbProject;
- }
-
- /**
- * return null if we have any problems...
- */
- private JaxbProject buildJaxbProject(JaxbPlatformDefinition platformDefinition, JaxbProject.Config config) {
- try {
- return platformDefinition.getFactory().buildJaxbProject(config);
- }
- catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- return null;
- }
- }
-
- private JaxbProject.Config buildJaxbProjectConfig(IProject project) {
- SimpleJaxbProjectConfig config = new SimpleJaxbProjectConfig();
- config.setProject(project);
- config.setPlatformDefinition(JptJaxbCorePlugin.getJaxbPlatformManager().buildJaxbPlatformDefinition(project));
- return config;
- }
-
- private Synchronizer buildJobContextModelSynchronizer(JaxbProject jaxbProject) {
- return new JobSynchronizer(
- buildContextModelJobName(jaxbProject),
- buildContextModelJobCommand(jaxbProject),
- jaxbProject.getProject());
- }
-
- private String buildContextModelJobName(JaxbProject jaxbProject) {
- return NLS.bind(JptJaxbCoreMessages.CONTEXT_MODEL_SYNC_JOB_NAME, jaxbProject.getName());
- }
-
- private JobCommand buildContextModelJobCommand(final JaxbProject jaxbProject) {
- return new JobCommand() {
- public IStatus execute(IProgressMonitor monitor) {
- return jaxbProject.synchronizeContextModel(monitor);
- }
- };
- }
-
- private CallbackSynchronizer buildJobUpdateSynchronizer(JaxbProject jaxbProject) {
- return new CallbackJobSynchronizer(
- buildUpdateJobName(jaxbProject),
- buildUpdateJobCommand(jaxbProject),
- jaxbProject.getProject());
- }
-
- private String buildUpdateJobName(JaxbProject jaxbProject) {
- return NLS.bind(JptJaxbCoreMessages.UPDATE_JOB_NAME, jaxbProject.getName());
- }
-
- private JobCommand buildUpdateJobCommand(final JaxbProject jaxbProject) {
- return new JobCommand() {
- public IStatus execute(IProgressMonitor monitor) {
- return jaxbProject.update(monitor);
- }
- };
- }
-
- /* private */ void removeJaxbProject(JaxbProject jaxbProject) {
- // figure out exactly when JAXB projects are removed
- dumpStackTrace("remove: ", jaxbProject); //$NON-NLS-1$
- this.removeItemFromCollection(jaxbProject, this.jaxbProjects, JAXB_PROJECTS_COLLECTION);
- jaxbProject.dispose();
- }
-
-
- // ********** Project POST_CHANGE **********
-
- /* private */ void projectChanged(IResourceDelta delta) {
- this.eventHandler.execute(this.buildProjectChangedCommand(delta));
- }
-
- private Command buildProjectChangedCommand(final IResourceDelta delta) {
- return new EventHandlerCommand("Project POST_CHANGE Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.projectChanged_(delta);
- }
- };
- }
-
- /**
- * Forward the specified resource delta to all our JAXB projects;
- * they will each determine whether the event is significant.
- */
- /* private */ void projectChanged_(IResourceDelta delta) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- jaxbProject.projectChanged(delta);
- }
- }
-
-
- // ********** Project POST_BUILD (CLEAN_BUILD) **********
-
- /* private */ void projectPostCleanBuild(IProject project) {
- this.executeAfterEventsHandled(this.buildProjectPostCleanBuildCommand(project));
- }
-
- private Command buildProjectPostCleanBuildCommand(final IProject project) {
- return new EventHandlerCommand("Project POST_BUILD (CLEAN_BUILD) Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.projectPostCleanBuild_(project);
- }
- };
- }
-
- /* private */ void projectPostCleanBuild_(IProject project) {
- JaxbProject jaxbProject = this.getJaxbProject_(project);
- if (jaxbProject != null) {
- this.removeJaxbProject(jaxbProject);
- this.addJaxbProject(project);
- }
- }
-
-
- // ********** File POST_CHANGE **********
-
- /**
- * The Faceted Project settings file has changed in some fashion, check
- * whether the JAXB facet has been added to or removed from the specified
- * project.
- */
- /* private */ void checkForJaxbFacetTransition(IProject project) {
- JaxbProject jaxbProject = this.getJaxbProject_(project);
-
- if (JaxbFacet.isInstalled(project)) {
- if (jaxbProject == null) { // JAXB facet added
- this.executeAfterEventsHandled(this.buildAddJaxbProjectCommand(project));
- }
- } else {
- if (jaxbProject != null) { // JAXB facet removed
- this.executeAfterEventsHandled(this.buildRemoveJaxbProjectCommand(jaxbProject));
- }
- }
- }
-
- private Command buildAddJaxbProjectCommand(final IProject project) {
- return new EventHandlerCommand("Add JAXB Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.addJaxbProject(project);
- }
- };
- }
-
- private Command buildRemoveJaxbProjectCommand(final JaxbProject jaxbProject) {
- return new EventHandlerCommand("Remove JAXB Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.removeJaxbProject(jaxbProject);
- }
- };
- }
-
- // ********** FacetedProject PRE_UNINSTALL **********
-
- /* private */ void jaxbFacetedProjectPreUninstall(IProjectFacetActionEvent event) {
- IProject project = event.getProject().getProject();
- this.executeAfterEventsHandled(this.buildJaxbFacetedProjectPreUninstallCommand(project));
- }
-
- private Command buildJaxbFacetedProjectPreUninstallCommand(final IProject project) {
- return new EventHandlerCommand("Faceted Project PRE_UNINSTALL Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.jaxbFacetedProjectPreUninstall_(project);
- }
- };
- }
-
- /* private */ void jaxbFacetedProjectPreUninstall_(IProject project) {
- // assume(?) this is the first event to indicate we need to remove the JAXB project from the JAXB project manager
- this.removeJaxbProject(this.getJaxbProject_(project));
- }
-
-
- // ********** Java element changed **********
-
- /* private */ void javaElementChanged(ElementChangedEvent event) {
- this.eventHandler.execute(this.buildJavaElementChangedCommand(event));
- }
-
- private Command buildJavaElementChangedCommand(final ElementChangedEvent event) {
- return new EventHandlerCommand("Java element changed Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJaxbProjectManager.this.javaElementChanged_(event);
- }
- };
- }
-
- /**
- * Forward the Java element changed event to all the JAXB projects
- * because the event could affect multiple projects.
- */
- /* private */ void javaElementChanged_(ElementChangedEvent event) {
- for (JaxbProject jaxbProject : this.jaxbProjects) {
- jaxbProject.javaElementChanged(event);
- }
- }
-
-
- // ********** miscellaneous **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.jaxbProjects);
- }
-
-
- // ********** event handler **********
-
- /**
- * If the event handler is executing asynchronously:<br>
- * Allow all the commands currently on the command executor's queue to execute.
- * Once they have executed, suspend the command executor and process the
- * specified command (on <em>this</em> thread, <em>not</em> the command
- * executor thread). Once the specified command is finished, allow the
- * command executor to resume processing its command queue.
- * <p>
- * If the event handler is executing synchronously:<br>
- * All the events have already been handled synchronously, so we simply
- * execute the specified command [sorta] directly.
- */
- private void executeAfterEventsHandled(Command command) {
- SynchronizedBoolean flag = new SynchronizedBoolean(false);
- this.eventHandler.execute(new PauseCommand(flag));
- try {
- flag.waitUntilTrue();
- } catch (InterruptedException ex) {
- // ignore - not sure why this thread would be interrupted
- }
- try {
- command.execute();
- } finally {
- flag.setFalse();
- }
- }
-
- /**
- * If this "pause" command is executing (asynchronously) on a different
- * thread than the JAXB project manager:<ol>
- * <li>it will set the flag to <code>true</code>, allowing the JAXB project
- * manager to resume executing on its own thread
- * <li>then it will suspend its command executor until the JAXB project
- * manager sets the flag back to <code>false</code>.
- * </ol>
- * If this "pause" command is executing (synchronously) on the same thread
- * as the JAXB project manager, it will simply set the flag to
- * <code>true</code> and return.
- */
- private static class PauseCommand
- implements Command
- {
- private final Thread producerThread;
- private final SynchronizedBoolean flag;
-
- PauseCommand(SynchronizedBoolean flag) {
- this(Thread.currentThread(), flag);
- }
-
- PauseCommand(Thread producerThread, SynchronizedBoolean flag) {
- super();
- this.producerThread = producerThread;
- this.flag = flag;
- }
-
- public void execute() {
- this.flag.setTrue();
- if (Thread.currentThread() != this.producerThread) {
- try {
- this.flag.waitUntilFalse();
- } catch (InterruptedException ex) {
- // ignore - the command executor will check for interruptions
- }
- }
- }
- }
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * @see JptJaxbCoreTestsPlugin#start(BundleContext)
- */
- public void handleEventsSynchronously() throws InterruptedException {
- try {
- this.lock.acquire();
- this.handleEventsSynchronously_();
- } finally {
- this.lock.release();
- }
- }
-
- private void handleEventsSynchronously_() throws InterruptedException {
- this.eventHandler.stop();
- this.eventHandler = new SimpleStatefulExtendedCommandExecutor();
- this.eventHandler.start();
- }
-
-
- // ********** resource proxy visitor **********
-
- /**
- * Visit the workspace resource tree, adding a JAXB project to the
- * JAXB project manager for each open Eclipse project that has a JAXB facet.
- */
- private class ResourceProxyVisitor implements IResourceProxyVisitor {
- ResourceProxyVisitor() {
- super();
- }
-
- public boolean visit(IResourceProxy resourceProxy) {
- switch (resourceProxy.getType()) {
- case IResource.ROOT :
- return true; // all projects are in the "root"
- case IResource.PROJECT :
- this.processProject(resourceProxy);
- return false; // no nested projects
- case IResource.FOLDER :
- return false; // ignore
- case IResource.FILE :
- return false; // ignore
- default :
- return false;
- }
- }
-
- private void processProject(IResourceProxy resourceProxy) {
- if (resourceProxy.isAccessible()) { // the project exists and is open
- IProject project = (IProject) resourceProxy.requestResource();
- if (JaxbFacet.isInstalled(project)) {
- GenericJaxbProjectManager.this.addJaxbProject(project);
- }
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** event handler command **********
-
- /**
- * Command that holds the JAXB project manager lock while
- * executing.
- */
- private abstract class EventHandlerCommand
- implements Command
- {
- private final String name;
-
- EventHandlerCommand(String name) {
- super();
- this.name = name;
- }
-
- public final void execute() {
- try {
- GenericJaxbProjectManager.this.lock.acquire();
- this.execute_();
- } catch (RuntimeException ex) {
- JptJaxbCorePlugin.log(ex);
- } finally {
- GenericJaxbProjectManager.this.lock.release();
- }
- }
-
- abstract void execute_();
-
- @Override
- public String toString() {
- return this.name;
- }
- }
-
-
- // ********** resource change listener **********
-
- private class ResourceChangeListener implements IResourceChangeListener {
-
- ResourceChangeListener() {
- super();
- }
-
- /**
- * PRE_UNINSTALL is the only facet event we use for
- * removing JAXB projects. These are the cases where we listen for resource events.
- * <p>
- * Check for:<ul>
- * <li>facet settings file added/removed/changed
- * (<code>/.settings/org.eclipse.wst.common.project.facet.core.xml</code>)
- * <li>file add/remove - forwarded to the individual JAXB projects
- * <li>project clean
- * </ul>
- */
- public void resourceChanged(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.POST_CHANGE :
- this.processPostChangeEvent(event);
- break;
-
- // workspace or project events
- case IResourceChangeEvent.PRE_REFRESH :
- break; // ignore
- case IResourceChangeEvent.PRE_BUILD :
- break; // ignore
- case IResourceChangeEvent.POST_BUILD :
- this.processPostBuildEvent(event);
- break;
-
- // project-only events
- case IResourceChangeEvent.PRE_CLOSE :
- break; // ignore
- case IResourceChangeEvent.PRE_DELETE :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostChangeEvent(IResourceChangeEvent event) {
- debug("Resource POST_CHANGE"); //$NON-NLS-1$
- this.processPostChangeDelta(event.getDelta());
- }
-
- private void processPostChangeDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.processPostChangeRootDelta(delta);
- break;
- case IResource.PROJECT :
- this.processPostChangeProjectDelta(delta);
- break;
- case IResource.FOLDER :
- this.processPostChangeFolderDelta((IFolder) resource, delta);
- break;
- case IResource.FILE :
- this.processPostChangeFileDelta((IFile) resource, delta);
- break;
- default :
- break;
- }
- }
-
- // ***** POST_CHANGE ROOT
- private void processPostChangeRootDelta(IResourceDelta delta) {
- this.processPostChangeDeltaChildren(delta);
- }
-
- // ***** POST_CHANGE PROJECT
- /**
- * Process the project first for the Opening project case.
- * The JAXB project will not be built until the children are processed
- * and we see that the facet metadata file is added.
- * Otherwise the JAXB project would be built and then we would process
- * the ADDED deltas for all the files in the project.
- */
- private void processPostChangeProjectDelta(IResourceDelta delta) {
- GenericJaxbProjectManager.this.projectChanged(delta);
- this.processPostChangeDeltaChildren(delta);
- }
-
- // ***** POST_CHANGE FOLDER
- private void processPostChangeFolderDelta(IFolder folder, IResourceDelta delta) {
- if (folder.getName().equals(".settings")) { //$NON-NLS-1$
- this.processPostChangeDeltaChildren(delta);
- }
- }
-
- // ***** POST_CHANGE FILE
- private void processPostChangeFileDelta(IFile file, IResourceDelta delta) {
- if (file.getName().equals(FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME)) {
- this.checkForFacetFileChanges(file, delta);
- }
- }
-
- private void checkForFacetFileChanges(IFile file, IResourceDelta delta) {
- switch (delta.getKind()) {
- case IResourceDelta.ADDED :
- case IResourceDelta.REMOVED :
- case IResourceDelta.CHANGED :
- GenericJaxbProjectManager.this.checkForJaxbFacetTransition(file.getProject());
- break;
- case IResourceDelta.ADDED_PHANTOM :
- break; // ignore
- case IResourceDelta.REMOVED_PHANTOM :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostChangeDeltaChildren(IResourceDelta delta) {
- for (IResourceDelta child : delta.getAffectedChildren()) {
- this.processPostChangeDelta(child); // recurse
- }
- }
-
- /**
- * A post build event has occurred.
- * Check for whether the build was a "clean" build and trigger project update.
- */
- // ***** POST_BUILD
- private void processPostBuildEvent(IResourceChangeEvent event) {
- debug("Resource POST_BUILD: ", event.getResource()); //$NON-NLS-1$
- if (event.getBuildKind() == IncrementalProjectBuilder.CLEAN_BUILD) {
- this.processPostCleanBuildDelta(event.getDelta());
- }
- }
-
- private void processPostCleanBuildDelta(IResourceDelta delta) {
- IResource resource = delta.getResource();
- switch (resource.getType()) {
- case IResource.ROOT :
- this.processPostCleanBuildDeltaChildren(delta);
- break;
- case IResource.PROJECT :
- this.processProjectPostCleanBuild((IProject) resource);
- break;
- case IResource.FOLDER :
- break; // ignore
- case IResource.FILE :
- break; // ignore
- default :
- break;
- }
- }
-
- private void processPostCleanBuildDeltaChildren(IResourceDelta delta) {
- for (IResourceDelta child : delta.getAffectedChildren()) {
- this.processPostCleanBuildDelta(child); // recurse
- }
- }
-
- private void processProjectPostCleanBuild(IProject project) {
- debug("\tProject CLEAN: ", project.getName()); //$NON-NLS-1$
- GenericJaxbProjectManager.this.projectPostCleanBuild(project);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** faceted project listener **********
-
- /**
- * Forward the Faceted project change event back to the JAXB project manager.
- */
- private class FacetedProjectListener implements IFacetedProjectListener {
-
- FacetedProjectListener() {
- super();
- }
-
- /**
- * Check for:<ul>
- * <li>un-install of JAXB facet
- * </ul>
- */
- public void handleEvent(IFacetedProjectEvent event) {
- switch (event.getType()) {
- case PRE_UNINSTALL :
- this.processPreUninstallEvent((IProjectFacetActionEvent) event);
- break;
- default :
- break;
- }
- }
-
- private void processPreUninstallEvent(IProjectFacetActionEvent event) {
- debug("Facet PRE_UNINSTALL: ", event.getProjectFacet()); //$NON-NLS-1$
- if (event.getProjectFacet().equals(JaxbFacet.FACET)) {
- GenericJaxbProjectManager.this.jaxbFacetedProjectPreUninstall(event);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** Java element change listener **********
-
- /**
- * Forward the Java element change event back to the JAXB project manager.
- */
- private class JavaElementChangeListener implements IElementChangedListener {
- /**
- * A flag to activate/deactivate the listener
- * so we can ignore Java events whenever Dali is manipulating the Java
- * source code via the Dali model. We do this because the 0.5 sec delay
- * between the Java source being changed and the corresponding event
- * being fired causes us no end of pain.
- */
- private volatile boolean active = true;
-
- JavaElementChangeListener() {
- super();
- }
-
- public void elementChanged(ElementChangedEvent event) {
- if (this.active) {
- GenericJaxbProjectManager.this.javaElementChanged(event);
- }
- }
-
- void setActive(boolean active) {
- this.active = active;
- }
-
- boolean isActive() {
- return this.active;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** DEBUG **********
-
- // @see JaxbProjectManagerTests#testDEBUG()
- private static final boolean DEBUG = false;
-
- /**
- * trigger #toString() call and string concatenation only if DEBUG is true
- */
- /* private */ static void debug(String message, Object object) {
- if (DEBUG) {
- debug_(message + object);
- }
- }
-
- /* private */ static void debug(String message) {
- if (DEBUG) {
- debug_(message);
- }
- }
-
- private static void debug_(String message) {
- System.out.println(Thread.currentThread().getName() + ": " + message); //$NON-NLS-1$
- }
-
- /* private */ static void dumpStackTrace() {
- dumpStackTrace(null);
- }
-
- /* private */ static void dumpStackTrace(String message, Object object) {
- if (DEBUG) {
- dumpStackTrace_(message + object);
- }
- }
-
- /* private */ static void dumpStackTrace(String message) {
- if (DEBUG) {
- dumpStackTrace_(message);
- }
- }
-
- private static void dumpStackTrace_(String message) {
- // lock System.out so the stack elements are printed out contiguously
- synchronized (System.out) {
- if (message != null) {
- debug_(message);
- }
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- // skip the first 3 elements - those are this method and 2 methods in Thread
- for (int i = 3; i < stackTrace.length; i++) {
- StackTraceElement element = stackTrace[i];
- if (element.getMethodName().equals("invoke0")) { //$NON-NLS-1$
- break; // skip all elements outside of the JUnit test
- }
- System.out.println("\t" + element); //$NON-NLS-1$
- }
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
deleted file mode 100644
index 1f647ca770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFacet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class JaxbFacet {
-
- public static final String ID = "jpt.jaxb"; //$NON-NLS-1$
-
- public static final IProjectFacet FACET = ProjectFacetsManager.getProjectFacet(ID);
-
- public static final IProjectFacetVersion VERSION_2_1 = FACET.getVersion("2.1"); //$NON-NLS-1$
-
- public static final IProjectFacetVersion VERSION_2_2 = FACET.getVersion("2.2"); //$NON-NLS-1$
-
-
- public static boolean isInstalled(final IProject project) {
- try {
- return FacetedProjectFramework.hasProjectFacet(project, ID);
- }
- catch (CoreException e) {
- JptJaxbCorePlugin.log(e);
- return false;
- }
- }
-
-
- /**
- * Not for instantiation
- */
- private JaxbFacet() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
deleted file mode 100644
index c97623657c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * Use a JAXB factory to build any core (e.g. {@link JaxbProject})
- * model object or any Java (e.g. {@link XmlType}) context model objects
- * <p>
- * Assumes a base JAXB project context structure
- * corresponding to the JAXB spec:
- * <pre>
- * RootContext
- * |- jaxb packages/types
- * |- jaxb attributes/methods
- * </pre>
- * ... and associated objects.
- *<p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @see org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbFactory {
-
- // ********** Core Model **********
-
- /**
- * Construct a JaxbProject for the specified config, to be
- * added to the specified JAXB project. Return null if unable to create
- * the JAXB file (e.g. the content type is unrecognized).
- */
- JaxbProject buildJaxbProject(JaxbProject.Config config);
-
- /**
- * Construct a JAXB file for the specified JAXB project, file, content type,
- * and resource model.
- */
- JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel);
-
-
- // ********** Non-resource-specific context nodes **********
-
- /**
- * Build a (/an updated) root context node to be associated with the given
- * JAXB project.
- * The root context node will be built once, but updated many times.
- * @see JaxbProject#update(org.eclipse.core.runtime.IProgressMonitor)
- */
- JaxbContextRoot buildContextRoot(JaxbProject jaxbProject);
-
- JaxbPackage buildPackage(JaxbContextRoot parent, String packageName);
-
-
- // ********** Java context nodes **********
-
- JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage);
-
- XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent);
-
- XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation);
-
- JaxbClass buildJaxbClass(JaxbContextRoot parent, JavaResourceType resourceType);
-
- JaxbEnum buildJaxbEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum);
-
- JaxbClassMapping buildJaxbClassMapping(JaxbClass parent);
-
- JaxbEnumMapping buildJaxbEnumMapping(JaxbEnum parent);
-
- XmlRegistry buildXmlRegistry(JaxbClass parent);
-
- JaxbElementFactoryMethod buildJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod);
-
- XmlRootElement buildJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation xmlRootElementAnnotation);
-
- JaxbPersistentAttribute buildJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor);
-
- JaxbPersistentAttribute buildJavaPersistentField(JaxbClassMapping parent, JavaResourceField resourceField);
-
- JaxbPersistentAttribute buildJavaPersistentProperty(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- JaxbAttributeMapping buildJavaNullAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent);
-
- XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent);
-
- XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent);
-
- XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent);
-
- XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent);
-
- XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent);
-
- JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent);
-
- XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent);
-
- JaxbEnumConstant buildJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java
deleted file mode 100644
index a3e133a33d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFile.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-/**
- * A JAXB Project contains JAXB files for all files in the project that
- * are relevant to the JAXB spec.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbFile
- extends JaxbNode
-{
- /**
- * Return the JAXB file's Eclipse file.
- */
- IFile getFile();
-
- /**JAXB
- * Return the JPA file's content type.
- */
- IContentType getContentType();
-
- /**
- * Return the resource model corresponding to the JPA file; typically a JPA
- * compilation unit, a JPA XML resource, or a JPA package fragment root (JAR).
- */
- JptResourceModel getResourceModel();
-
- /**
- * Convenience method. Return the resource model corresponding to the JPA
- * file if the file's content is a "kind-of" the specified content type;
- * otherwise, return null. This is useful when a client has looked up the
- * JPA file via a file name [and assumed content type].
- * @see #getResourceModel()
- */
- JptResourceModel getResourceModel(IContentType contentType);
-
-
- // ********** root structure nodes **********
-
-// /**
-// * Return the JPA file's root structure nodes.
-// */
-// Iterator<JpaStructureNode> rootStructureNodes();
-// String ROOT_STRUCTURE_NODES_COLLECTION = "rootStructureNodes"; //$NON-NLS-1$
-//
-// /**
-// * Return the count of the JPA file's root context model objects.
-// */
-// int rootStructureNodesSize();
-//
-// /**
-// * Add a root structure node.
-// * There is the potential for multiple root structure nodes
-// * for a particular key. For example, a Java file that is listed
-// * both as a <class> in the persistence.xml and as an <entity> in
-// * an orm.xml file. In this case the orm.xml file needs to set
-// * the root structure node after the Java class reference.
-// * Last one in during project "update" wins.
-// */
-// void addRootStructureNode(Object key, JpaStructureNode rootStructureNode);
-//
-// /**
-// * @see #addRootStructureNode(Object, JpaStructureNode)
-// */
-// void removeRootStructureNode(Object key);
-//
-// /**
-// * Return the structure node best corresponding to the location in the file.
-// */
-// JpaStructureNode getStructureNode(int textOffset);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java
deleted file mode 100644
index 3558c3f254..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbNode.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.utility.model.Model;
-
-/**
- * JAXB-specific protocol. All JAXB objects belong to a JAXB project, are
- * associated with a resource, and have a parent (excepting the JAXB project).
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbNode
- extends Model, IAdaptable
-{
- /**
- * Return the JAXB project the node belongs to.
- */
- JaxbProject getJaxbProject();
-
- /**
- * Return the JAXB node's parent. The JAXB project will not have a parent.
- */
- JaxbNode getParent();
-
- void stateChanged();
-
- /**
- * Return the node's resource, typically for validation messages.
- */
- IResource getResource();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
deleted file mode 100644
index df8afc4081..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.command.ExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * A JAXB project is associated with an Eclipse project (and its corresponding
- * Java project). It holds the "resource" model that corresponds to the various
- * JPA-related resources (the <code>persistence.xml</code> file, its mapping files
- * [<code>orm.xml</code>],
- * and the Java source files). It also holds the "context" model that represents
- * the JPA metadata, as derived from spec-defined defaults, Java source code
- * annotations, and XML descriptors.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbProject
- extends JaxbNode
-{
-
- // ********** general **********
-
- /**
- * Return the JAXB project's name, which is the same as the associated
- * Eclipse project's name.
- */
- String getName();
-
- /**
- * Return the Eclipse project associated with the JAXB project.
- */
- IProject getProject();
-
- /**
- * Return the Java project associated with the JAXB project.
- */
- IJavaProject getJavaProject();
-
- /**
- * Return the vendor-specific JAXB platform that builds the JAXB project
- * and its contents.
- */
- JaxbPlatform getPlatform();
-
- /**
- * Return the schema library used for validating and user assist
- */
- SchemaLibrary getSchemaLibrary();
-
- /**
- * The JAXB project has been removed from the JJAXBPA model. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
-
- // ********** JAXB files **********
-
- /**
- * ID string used when the JAXB project's collection of JAXB files changes.
- * @see #addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener)
- */
- String JAXB_FILES_COLLECTION = "jaxbFiles"; //$NON-NLS-1$
-
- /**
- * Return the JAXB project's JAXB files.
- */
- Iterable<JaxbFile> getJaxbFiles();
-
- /**
- * Return the size of the JAXB project's JAXB files.
- */
- int getJaxbFilesSize();
-
- /**
- * Return the JAXB file corresponding to the specified file.
- * Return null if there is no JAXB file associated with the specified file.
- */
- JaxbFile getJaxbFile(IFile file);
-
-
-// // ********** external Java resource compilation units **********
-//
-// /**
-// * ID string used when the JPA project's collection of external Java
-// * resource compilation units changes.
-// * @see #addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener)
-// */
-// String EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION = "externalJavaResourceCompilationUnits"; //$NON-NLS-1$
-//
-// /**
-// * Return the JPA project's external Java resource compilation units.
-// */
-// Iterator<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits();
-//
-// /**
-// * Return the size of the JPA project's external Java resource compilation units.
-// */
-// int externalJavaResourceCompilationUnitsSize();
-//
-//
-// // ********** external Java resource persistent types **********
-//
-// /**
-// * Return the JPA project's external Java resource persistent type cache.
-// */
-// JavaResourcePersistentTypeCache getExternalJavaResourcePersistentTypeCache();
-//
-
- // ********** Java resources **********
-
- /**
- * Return the Java resource packages for the project.
- * Return null if invalid or absent. These correspond to package-info.java files
- */
- Iterable<JavaResourcePackage> getJavaResourcePackages();
-
- /**
- * Return the Java resource package for the specified package.
- * Return null if invalid or absent.
- */
- JavaResourcePackage getJavaResourcePackage(String packageName);
-
- /**
- * Return the java resource packages that are annotated with
- * 1 or more valid JAXB package annotations
- */
- Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages();
-
- /**
- * Return the java resource package for the specified package if and only if it has
- * recognized annotations.
- * Return null otherwise.
- */
- JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName);
-
-// /**
-// * Return the Java resource package fragement root for the specified JAR.
-// * Return null if absent.
-// */
-// JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName);
-
- /**
- * Return all {@link JavaResourceAbstractType}s that are represented by java source within this project
- */
- Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes();
-
- /**
- * Return all {@link JavaResourceAbstractType}s that are represented by java source within this project,
- * that are also annotated with a recognized annotation (and are persistable)
- */
- Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes();
-
-// /**
-// * Return the names of the JAXB project's annotated Java classes
-// */
-// Iterable<String> getAnnotatedJavaSourceClassNames();
-
- /**
- * Return the {@link JavaResourceAbstractType} with the specified type name, regardless of
- * what kind it is.
- * Return null if absent.
- */
- JavaResourceAbstractType getJavaResourceType(String typeName);
-
- /**
- * Return the {@link JavaResourceAbstractType} with the specified type name and kind.
- * Return null if invalid or absent or if the kind does not match.
- */
- JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAbstractType.Kind kind);
-
-
- // **************** jaxb.index resources **********************************
-
- /**
- * Return all jaxb.index resource models within the project
- */
- Iterable<JaxbIndexResource> getJaxbIndexResources();
-
- /**
- * Return the first jaxb.index resource model (could be multiple if there are multiple locations
- * for a given package) with the given package name
- */
- JaxbIndexResource getJaxbIndexResource(String packageName);
-
-
- // **************** jaxb.properties resources *****************************
-
- /**
- * Return all jaxb.properties resource models within the project
- */
- Iterable<JaxbPropertiesResource> getJaxbPropertiesResources();
-
- /**
- * Return the first jaxb.properties resource model (could be multiple if there are multiple locations
- * for a given package) with the given package name
- */
- JaxbPropertiesResource getJaxbPropertiesResource(String packageName);
-
-
- // **************** context model *****************************************
-
- /**
- * Return the root of the JAXB project's context model.
- */
- JaxbContextRoot getContextRoot();
-
- /**
- * Return all types/package infos that are primary context objects for the
- * given compilation unit
- */
- Iterable<? extends JavaContextNode> getPrimaryJavaNodes(ICompilationUnit cu);
-
-
- // ********** model synchronization **********
-
- /**
- * Synchronize the JPA project with the specified project resource
- * delta, watching for added and removed files in particular.
- */
- void projectChanged(IResourceDelta delta);
-
- /**
- * Synchronize the JPA project with the specified Java change.
- */
- void javaElementChanged(ElementChangedEvent event);
-
-
-
- // ********** synchronize context model with resource model **********
-
- /**
- * Return the synchronizer that will synchronize the context model with
- * the resource model whenever the resource model changes.
- */
- Synchronizer getContextModelSynchronizer();
-
- /**
- * Set the synchronizer that will keep the context model synchronized with
- * the resource model whenever the resource model changes.
- * Before setting the synchronizer, clients should save the current
- * synchronizer so it can be restored later.
- *
- * @see #getContextModelSynchronizer()
- */
- void setContextModelSynchronizer(Synchronizer synchronizer);
-
- /**
- * The JAXB project's resource model has changed; synchronize the JPA
- * project's context model with it. This method is typically called when the
- * resource model state has changed when it is synchronized with its
- * underlying Eclipse resource as the result of an Eclipse resource change
- * event. This method can also be called when a client (e.g. a JUnit test
- * case) has manipulated the resource model via its API (as opposed to
- * modifying the underlying Eclipse resource directly) and needs the context
- * model to be synchronized accordingly (since manipulating the resource
- * model via its API will not trigger this method). Whether the context
- * model is synchronously (or asynchronously) depends on the current context
- * model synchronizer.
- *
- * @see #synchronizeContextModelAndWait()
- */
- void synchronizeContextModel();
-
- /**
- * Force the JAXB project's context model to synchronize with it resource
- * model <em>synchronously</em>.
- *
- * @see #synchronizeContextModel()
- * @see #updateAndWait()
- */
- void synchronizeContextModelAndWait();
-
- /**
- * This is the callback used by the context model synchronizer to perform
- * the actual "synchronize".
- */
- IStatus synchronizeContextModel(IProgressMonitor monitor);
-
- // ********** project "update" **********
-
- /**
- * Return the synchronizer that will update the context model whenever
- * it has any changes. This allows any intra-JAXB project dependencies to
- * be updated.
- */
- CallbackSynchronizer getUpdateSynchronizer();
-
- /**
- * Set the synchronizer that will update the context model whenever
- * it has any changes. This allows any intra-JAXB project dependencies to
- * be updated.
- * Before setting the update synchronizer, clients should save the current
- * synchronizer so it can be restored later.
- *
- * @see #getUpdateSynchronizer()
- */
- void setUpdateSynchronizer(CallbackSynchronizer synchronizer);
-
- /**
- * Force the JAXB project to "update" <em>synchronously</em>.
- *
- * @see #synchronizeContextModelAndWait()
- */
- void updateAndWait();
-
- /**
- * This is the callback used by the update synchronizer to perform the
- * actual "update".
- */
- IStatus update(IProgressMonitor monitor);
-
-
-
-
-// // ********** utility **********
-//
-// /**
-// * Return an {@link IFile} that best represents the given runtime location
-// */
-// IFile getPlatformFile(IPath runtimePath);
-
-
- // ********** validation **********
-
- /**
- * Return project's validation messages.
- */
- Iterable<IMessage> getValidationMessages(IReporter reporter);
-
-
- // ********** modifying shared documents **********
-
- /**
- * Set a thread-specific implementation of the {@link ExtendedCommandExecutor}
- * interface that will be used to execute a command to modify a shared
- * document. If necessary, the command executor can be cleared by
- * setting it to null.
- * This allows background clients to modify documents that are
- * already present in the UI. See implementations of {@link ExtendedCommandExecutor}.
- */
- void setThreadLocalModifySharedDocumentCommandExecutor(ExtendedCommandExecutor commandExecutor);
-
- /**
- * Return the project-wide implementation of the
- * {@link ExtendedCommandExecutor} interface.
- */
- ExtendedCommandExecutor getModifySharedDocumentCommandExecutor();
-
-
- // ********** construction config **********
-
- /**
- * The settings used to construct a JAXB project.
- */
- interface Config {
-
- /**
- * Return the Eclipse project to be associated with the new JAXB project.
- */
- IProject getProject();
-
- /**
- * Return the JAXB platform definition to be associated with the new JAXB project.
- */
- JaxbPlatformDefinition getPlatformDefinition();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java
deleted file mode 100644
index 68258577ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProjectManager.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.model.Model;
-
-
-/**
- * The JAXB project manager holds all the JAXB projects in the workspace.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbProjectManager
- extends Model {
-
- /**
- * Return the JAXB model's JAXB projects.
- */
- Iterable<JaxbProject> getJaxbProjects();
- public static final String JAXB_PROJECTS_COLLECTION = "jaxbProjects"; //$NON-NLS-1$
-
- /**
- * Return the size of the JAXB model's list of JAXB projects.
- */
- int getJaxbProjectsSize();
-
- /**
- * Return the JAXB project corresponding to the specified Eclipse project.
- * Return null if unable to associate the specified Eclipse project
- * with a JAXB project.
- */
- JaxbProject getJaxbProject(IProject project);
-
- /**
- * Return the JAXB file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JAXB file.
- */
- JaxbFile getJaxbFile(IFile file);
-
- /**
- * The JAXB settings associated with the specified Eclipse project
- * have changed in such a way as to require the associated
- * JPA project to be completely rebuilt
- * (e.g. when the user changes a project's JAXB platform).
- */
- void rebuildJaxbProject(IProject project);
-
- /**
- * Return whether the model's Java change listener is active.
- */
- boolean javaElementChangeListenerIsActive();
-
- /**
- * Set whether the model's Java change listener is active.
- */
- void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java
deleted file mode 100644
index 5a7c5eab5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbResourceModelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-/**
- * Map a content type to a JAXB resource model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbResourceModelProvider
-{
- /**
- * Return the file content type the provider is for.
- */
- IContentType getContentType();
-
- /**
- * Build a JAXB resource model for the specified JAXB project and file.
- * Use the specified factory for creation so extenders can simply override
- * the appropriate creation method instead of building a provider for the
- * same content.
- */
- JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
deleted file mode 100644
index c284fecf9f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JptJaxbCorePlugin.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformManagerImpl;
-import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * The Dali JAXB core plug-in lifecycle implementation.
- * A number of globally-available constants and methods.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public class JptJaxbCorePlugin
- extends Plugin {
-
- // ********** public constants **********
-
- /**
- * The plug-in identifier of Dali JAXB core
- * (value <code>"org.eclipse.jpt.jaxb.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- /**
- * The identifier for the JAXB validation marker
- * (value <code>"org.eclipse.jpt.jaxb.core.jaxbProblemMarker"</code>).
- */
- public static final String VALIDATION_MARKER_ID = PLUGIN_ID + ".jaxbProblemMarker"; //$NON-NLS-1$
-
- /**
- * The content type for jaxb.index files
- */
- public static final IContentType JAXB_INDEX_CONTENT_TYPE = getJaxbContentType("jaxbIndex");
-
- /**
- * The resource type for jaxb.index files
- */
- public static final JptResourceType JAXB_INDEX_RESOURCE_TYPE = new JptResourceType(JAXB_INDEX_CONTENT_TYPE);
-
- /**
- * The content type for jaxb.properties files
- */
- public static final IContentType JAXB_PROPERTIES_CONTENT_TYPE = getJaxbContentType("jaxbProperties");
-
- /**
- * The resource type for jaxb.properties files
- */
- public static final JptResourceType JAXB_PROPERTIES_RESOURCE_TYPE = new JptResourceType(JAXB_PROPERTIES_CONTENT_TYPE);
-
- private static IContentType getJaxbContentType(String contentType) {
- return getContentType(CONTENT_PREFIX_ + contentType);
- }
-
- public static final String CONTENT_PREFIX = PLUGIN_ID_ + "content"; //$NON-NLS-1$
-
- public static final String CONTENT_PREFIX_ = CONTENT_PREFIX + '.';
-
- private static IContentType getContentType(String contentType) {
- return Platform.getContentTypeManager().getContentType(contentType);
- }
-
-
- // **************** fields ************************************************
-
- private volatile GenericJaxbProjectManager projectManager;
-
-
- // **************** singleton *********************************************
-
- private static JptJaxbCorePlugin INSTANCE;
-
- /**
- * Return the singleton plug-in
- */
- public static JptJaxbCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Return the singular JAXB project manager corresponding to the current workspace.
- */
- public static JaxbProjectManager getProjectManager() {
- return INSTANCE.getProjectManager_();
- }
-
- /**
- * Return the JAXB project corresponding to the specified Eclipse project,
- * or <code>null</code> if unable to associate the specified project with a
- * JAXB project.
- */
- public static JaxbProject getJaxbProject(IProject project) {
- return getProjectManager().getJaxbProject(project);
- }
-
- public static JaxbPlatformManager getJaxbPlatformManager() {
- return JaxbPlatformManagerImpl.instance();
- }
-
- /**
- * Set the default {@link JaxbPlatformDescription} for new JAXB projects with the given
- * JAXB facet version.
- */
- public static void setDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion, JaxbPlatformDescription platform) {
- String preferenceKey = null;
- if (JaxbFacet.VERSION_2_1.equals(jaxbFacetVersion)) {
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (JaxbFacet.VERSION_2_2.equals(jaxbFacetVersion)) {
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- JaxbPreferencesManager.setWorkspacePreference(preferenceKey, platform.getId());
- }
-
- /**
- * Return the default {@link JaxbPlatformDescription} for new JAXB projects with the given
- * JAXB facet version.
- */
- public static JaxbPlatformDescription getDefaultPlatform(IProjectFacetVersion jaxbFacetVersion) {
-
- JaxbPlatformDescription defaultPlatform =
- getDefaultPlatform(
- jaxbFacetVersion,
- JaxbPreferencesManager.getWorkspacePreferences(),
- JaxbPreferencesManager.getDefaultPreferences());
- if (defaultPlatform == null) {
- // if the platform ID stored in the workspace prefs is invalid (i.e. null), look in the default prefs
- defaultPlatform = getDefaultPlatform(jaxbFacetVersion, JaxbPreferencesManager.getDefaultPreferences());
- }
- return defaultPlatform;
- }
-
- //
- private static JaxbPlatformDescription getDefaultPlatform(
- IProjectFacetVersion jaxbFacetVersion, Preferences ... nodes) {
-
- JaxbPlatformDescription defaultDefaultPlatform;
- String preferenceKey;
- if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_1)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_1;
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY;
- }
- else if (jaxbFacetVersion.equals(JaxbFacet.VERSION_2_2)) {
- defaultDefaultPlatform = GenericJaxbPlatform.VERSION_2_2;
- preferenceKey = JaxbPreferencesManager.DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JAXB facet version: " + jaxbFacetVersion); //$NON-NLS-1$
- }
- return getDefaultPlatform(jaxbFacetVersion, preferenceKey, defaultDefaultPlatform, nodes);
- }
-
- private static JaxbPlatformDescription getDefaultPlatform(
- IProjectFacetVersion jaxbFacetVersion, String preferenceKey,
- JaxbPlatformDescription defaultDefault, Preferences ... nodes) {
-
- String defaultDefaultId = (defaultDefault == null) ? null : defaultDefault.getId();
- String defaultPlatformId = Platform.getPreferencesService().get(preferenceKey, defaultDefaultId, nodes);
- JaxbPlatformDescription defaultPlatform = getJaxbPlatformManager().getJaxbPlatform(defaultPlatformId);
- if (defaultPlatform != null && defaultPlatform.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return defaultPlatform;
- }
- else if (defaultDefault != null && defaultDefault.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return defaultDefault;
- }
- return null;
- }
-
- /**
- * Return the JAXB platform ID associated with the specified Eclipse project.
- */
- public static String getJaxbPlatformId(IProject project) {
- return (new JaxbPreferencesManager(project)).getJaxbPlatformId();
- }
-
- /**
- * Return the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public static JaxbPlatformDescription getJaxbPlatformDescription(IProject project) {
- String jpaPlatformId = getJaxbPlatformId(project);
- return getJaxbPlatformManager().getJaxbPlatform(jpaPlatformId);
- }
-
- /**
- * Set the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public static void setJaxbPlatform(IProject project, JaxbPlatformDescription platform) {
- (new JaxbPreferencesManager(project)).setJaxbPlatform(platform);
- }
-
- public static List<String> getSchemaLocations(IProject project) {
- return (new JaxbPreferencesManager(project)).getSchemaLocations();
- }
-
- public static void setSchemaLocations(IProject project, List<String> schemaLocations) {
- (new JaxbPreferencesManager(project)).setSchemaLocations(schemaLocations);
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null));
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable));
- }
-
-
- // ********** plug-in implementation **************************************************
-
- public JptJaxbCorePlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // nothing yet...
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- if (this.projectManager != null) {
- this.projectManager.stop();
- this.projectManager = null;
- }
- } finally {
- super.stop(context);
- }
- }
-
- private synchronized GenericJaxbProjectManager getProjectManager_() {
- if (this.projectManager == null) {
- this.projectManager = this.buildProjectManager();
- this.projectManager.start();
- }
- return this.projectManager;
- }
-
- private GenericJaxbProjectManager buildProjectManager() {
- return new GenericJaxbProjectManager();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java
deleted file mode 100644
index 00bc71254d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/MappingKeys.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-/**
- * Identifiers for JAXB class/attribute mapping types
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface MappingKeys {
-
- String XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY = "xml-any-attribute";
- String XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY = "xml-any-element";
- String XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY = "xml-attribute";
- String XML_ELEMENT_ATTRIBUTE_MAPPING_KEY = "xml-element";
- String XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY = "xml-elements";
- String XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY = "xml-element-ref";
- String XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY = "xml-element-refs";
- String XML_MIXED_ATTRIBUTE_MAPPING_KEY = "xml-mixed";
- String XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY = "xml-transient";
- String XML_VALUE_ATTRIBUTE_MAPPING_KEY = "xml-value";
-
- /** mapping key for attribute mappings that are unrecognized */
- String NULL_ATTRIBUTE_MAPPING_KEY = null;
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java
deleted file mode 100644
index df2686c56c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaEntry.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.jpt.jaxb.core;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-/**
- * Schema configuration object for {@link SchemaLibrary}
- *
- * @noimplement
- * @version 3.1
- * @since 3.1
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaEntry {
-
- /**
- * Return the location key of the entry.
- * This could be:
- * - a web location (that then redirects to a plugin resource location)
- * - a workspace location
- * - a namespace
- */
- String getLocation();
-
- /**
- * Return the namespace of the schema
- */
- String getNamespace();
-
- /**
- * Return whether the schema referred to by the entry is loaded
- */
- boolean isLoaded();
-
- /**
- * Return the {@link XsdSchema} associated with the entry.
- * The provided namespace is a last failsafe check that the loaded schema does in fact
- * have the namespace in question.
- * (Sometimes on a refresh the schema will turn out to have a different namespace than expected)
- */
- XsdSchema getXsdSchema(String namespace);
-
- /**
- * Refresh the associated schema
- */
- void refresh();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java
deleted file mode 100644
index f6ab0c18d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/SchemaLibrary.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
-
-import java.util.List;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-/**
- * Entry point for accessing project schema resources
- *
- * @noimplement
- * @version 3.1
- * @since 3.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaLibrary {
-
- /**
- * Return the schema entries that have been added to the project settings for validation purposes
- */
- public List<SchemaEntry> getSchemaEntries();
-
- /**
- * Return the locations associated with the schema entries
- */
- public List<String> getSchemaLocations();
-
- /**
- * Set the schema locations
- */
- public void setSchemaLocations(List<String> schemaLocations);
-
- /**
- * Return the XsdSchema identified by the given namespace, if it exists and is resolvable.
- * If there are multiple schemas with the given namespace, return the first one found.
- * Return null otherwise.
- */
- public XsdSchema getSchema(String namespace);
-
- /**
- * Refresh the schema with the given namespace, if it exists and is resolvable.
- * Refresh the first one found if there are multiple schemas for the namespace.
- * Do nothing otherwise.
- */
- public void refreshSchema(String namespace);
-
- /**
- * Refresh all schemas within the library.
- */
- public void refreshAllSchemas();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java
deleted file mode 100644
index 3aa84db340..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/Accessor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB accessor (field/property).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface Accessor
- extends JavaContextNode {
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
- /**
- * Return the type name of the java attribute, or the item type name of a collection or array.
- */
- String getJavaResourceAttributeBaseTypeName();
-
- /**
- * (See JAXB 2.2 Spec, sect. 5.5.2)
- * Return true if the java attribute type is an extension of java.util.Collection or a single
- * dimensional array (except for byte[], which is treated like a non-array)
- */
- boolean isJavaResourceAttributeCollectionType();
-
- /**
- * Return whether the java resource attribute type is a subtype of the given type
- * This might not return the same thing as getJavaResourceAttribute().typeIsSubTypeOf(String).
- */
- boolean isJavaResourceAttributeTypeSubTypeOf(String typeName);
-
-
- //**************** static methods *****************
-
- final class AccessorTools {
-
- public static final String BYTE_ARRAY_CLASS_NAME = "byte[]";
- public static final String COLLECTION_CLASS_NAME = Collection.class.getName();
- public static final String OBJECT_CLASS_NAME = Object.class.getName();
-
- public static String getBaseTypeName(JavaResourceAttribute attribute) {
- if (attribute.typeIsArray()) {
- if (BYTE_ARRAY_CLASS_NAME.equals(attribute.getTypeName())) {
- return BYTE_ARRAY_CLASS_NAME;
- }
- else if (attribute.getTypeArrayDimensionality() == 1) {
- return attribute.getTypeArrayComponentTypeName();
- }
- }
- else if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- if (attribute.getTypeTypeArgumentNamesSize() == 1) {
- return attribute.getTypeTypeArgumentName(0);
- }
- return OBJECT_CLASS_NAME;
- }
- return attribute.getTypeName();
- }
-
- /**
- * @see JaxbPersistentAttribute#isJavaResourceAttributeCollectionType()
- */
- public static boolean isCollectionType(JavaResourceAttribute attribute) {
- if (attribute.typeIsArray()) {
- if (attribute.getTypeArrayDimensionality() == 1
- && ! BYTE_ARRAY_CLASS_NAME.equals(attribute.getTypeName())) {
- return true;
- }
- return false;
- }
- else if (attribute.typeIsSubTypeOf(COLLECTION_CLASS_NAME)) {
- return true;
- }
-
- return false;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java
deleted file mode 100644
index b9e8340c67..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributeMapping.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-
-/**
- * Represents a JAXB attribute mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface JaxbAttributeMapping
- extends JavaContextNode {
-
- String getKey();
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- JaxbPersistentAttribute getPersistentAttribute();
-
- JaxbClassMapping getClassMapping();
-
-
- // ***** default *****
-
- String DEFAULT_PROPERTY = "default"; //$NON-NLS-1$
-
- /**
- * Return whether the mapping is its attribute's <em>default</em> mapping
- * (as opposed to its <em>specified</em> mapping).
- */
- boolean isDefault();
-
-
- // ***** misc *****
-
- /**
- * Return the (fully qualified) type of the attribute
- * (or the item type if in a collection/array)
- */
- String getBoundTypeName();
-
- /**
- * Return the (fully qualified) type used to map the bound type.
- * (Usually the same as the value type, except when an XmlJavaTypeAdapter is used.)
- */
- String getValueTypeName();
-
- /**
- * Return the (fully qualified) type of the data actually written to xml.
- * (Usually the same as the value type, except when an XmlIDREF is used.)
- */
- String getDataTypeName();
-
- /**
- * Return the schema type associated with the value type. May be null.
- */
- XsdTypeDefinition getDataTypeXsdTypeDefinition();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- /**
- * Return whether the attribute is mapped to a particle
- * (e.g. XmlElement, XmlElements, XmlElementRef, XmlElementRefs)
- */
- boolean isParticleMapping();
-
- /**
- * Return whether the attribute is specifically excluded from being mapped
- * (e.g. XmlTransient)
- */
- boolean isTransient();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
deleted file mode 100644
index 5f9e757bcd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbAttributesContainer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Holds the attributes represented by a particular JavaResourceType and XmlAccessType.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbAttributesContainer
- extends JavaContextNode {
-
- /**
- * Return true if this JaxbAtributesContainer contains attributes for the given JavaResourceType.
- */
- boolean isFor(JavaResourceType javaResourceType);
-
-
- /********** attributes **********/
-
- Iterable<JaxbPersistentAttribute> getAttributes();
-
- int getAttributesSize();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java
deleted file mode 100644
index 6a85bf3de7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClass.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-
-/**
- * Represents a <i>class</i> in a JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbClass
- extends JaxbType {
-
- // ***** overrides *****
-
- JavaResourceType getJavaResourceType();
-
- public JaxbClassMapping getMapping();
-
-
- // ***** XmlRegistry *****
-
- String XML_REGISTRY_PROPERTY = "xmlRegistry"; //$NON-NLS-1$
-
- XmlRegistry getXmlRegistry();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java
deleted file mode 100644
index ec286a8701..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbClassMapping.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-
-public interface JaxbClassMapping
- extends JaxbTypeMapping, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- // ***** overrides *****
-
- JaxbClass getJaxbType();
-
-
- // ***** XmlType.factoryClass *****
-
- String getFactoryClass();
-
- String SPECIFIED_FACTORY_CLASS_PROPERTY = "specifiedFactoryClass"; //$NON-NLS-1$
-
- /**
- * factory class corresponds to the XmlType annotation factoryClass element
- */
- String getSpecifiedFactoryClass();
-
- void setSpecifiedFactoryClass(String factoryClass);
-
-
- // ***** XmlType.factoryMethod *****
-
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * factory method corresponds to the XmlType annotation factoryMethod element
- */
- String getFactoryMethod();
-
- void setFactoryMethod(String factoryMethod);
-
-
- // ***** XmlType.propOrder *****
-
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * propOrder corresponds to the XmlType annotation propOrder element
- */
- ListIterable<String> getPropOrder();
-
- String getProp(int index);
-
- int getPropOrderSize();
-
- void addProp(int index, String prop);
-
- void removeProp(int index);
-
- void removeProp(String prop);
-
- void moveProp(int targetIndex, int sourceIndex);
-
-
- // ***** superclass *****
-
- String SUPERCLASS_PROPERTY = "superclass"; //$NON-NLS-1$
-
- JaxbClassMapping getSuperclass();
-
-
- // ***** attributes *****
-
- String ATTRIBUTES_COLLECTION = "attributes"; //$NON-NLS-1$
-
- Iterable<JaxbPersistentAttribute> getAttributes();
-
- int getAttributesSize();
-
-
- // ***** included attributes *****
-
- String INCLUDED_ATTRIBUTES_COLLECTION = "includedAttributes"; //$NON-NLS-1$
-
- /**
- * <i>Included</i> attributes come from any direct superclasses that are mapped as @XmlTransient.
- * (As opposed to <i>inherited</i> attributes, which a class has by way of <i>any</i> mapped superclasses.)
- * If there is an intervening class that is not transient, then that class will hold any
- * included attributes from any direct superclass that are mapped as @XmlTransient.
- * @see JaxbClassMapping#getSuperclass()
- */
- Iterable<JaxbPersistentAttribute> getIncludedAttributes();
-
- int getIncludedAttributesSize();
-
-
- // ***** misc attributes *****
-
- /**
- * Return all attributes that are defined by this class.
- * This is the combined set of #getAttributes() and #getIncludedAttributes()
- */
- Iterable<JaxbPersistentAttribute> getAllLocallyDefinedAttributes();
-
- /**
- * <i>Inherited</i> attributes are any attributes this class mapping has whose source
- * is a superclass.
- * Inherited attributes include <i>included</i> attributes.
- */
- Iterable<JaxbPersistentAttribute> getInheritedAttributes();
-
-
- // ***** misc *****
-
- /**
- * Return the id attribute mapping for this class mapping, if it has one.
- * (Will return the first one it finds, if this class has more than one.)
- */
- JaxbAttributeMapping getXmlIdMapping();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
deleted file mode 100644
index 9918f02d62..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextNode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-
-/**
- * Common protocol for JAXB objects that have a context, as opposed to
- * resource objects.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbContextNode
- extends JaxbNode {
-
- /**
- * Return the root of the context model
- */
- JaxbContextRoot getContextRoot();
-
- /**
- * Return the resource type of the context node's resource.
- */
- JptResourceType getResourceType();
-
-
- // ********** updating **********
-
- void synchronizeWithResourceModel();
-
- /**
- * Update the context model with the content of the JAXB resource model.
- */
- void update();
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
deleted file mode 100644
index f203a01b64..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbContextRoot.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Root of the JAXB context model.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbContextRoot
- extends JaxbContextNode {
-
- // ***** packages *****
-
- static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
-
- /**
- * The set of packages. Includes any package with any interesting JAXB content.
- */
- Iterable<JaxbPackage> getPackages();
-
- /**
- * Return the package with the given name
- */
- JaxbPackage getPackage(String packageName);
-
- int getPackagesSize();
-
-
- // ***** jaxb types *****
-
- public final static String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Return the set of all JAXB types within this context root.
- */
- Iterable<JaxbType> getTypes();
-
- /**
- * Return the type with the given (fully qualified) type name
- */
- JaxbType getType(String typeName);
-
- int getTypesSize();
-
- /**
- * Return the set of types that are in the given package
- */
- Iterable<JaxbType> getTypes(JaxbPackage jaxbPackage);
-
- /**
- * The set of jaxb classes. These may be explicitly or implicitly included.
- */
- Iterable<JaxbClass> getClasses();
-
- /**
- * Return the set of jaxb classes that are in the given package
- */
- Iterable<JaxbClass> getClasses(JaxbPackage jaxbPackage);
-
- /**
- * The set of jaxb enums. These may be explicitly or implicitly included.
- */
- Iterable<JaxbEnum> getEnums();
-
- /**
- * Return the set of jaxb enums that are in the given package
- */
- Iterable<JaxbEnum> getEnums(JaxbPackage jaxbPackage);
-
- /**
- * Return the set of {@link XmlRegistry}(ie)s that are in the given package
- */
- Iterable<XmlRegistry> getXmlRegistries(JaxbPackage jaxbPackage);
-
- /**
- * Return the {@link JaxbTypeMapping} for the given (fully qualified) type name
- */
- JaxbTypeMapping getTypeMapping(String typeName);
-
- /**
- * Return the {@link JaxbClassMapping} for the given (fully qualified) type name
- */
- JaxbClassMapping getClassMapping(String typeName);
-
-
- // ***** misc *****
-
-
-
-
- // ***** validation *****
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
deleted file mode 100644
index 563907c44a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB element factory method
- * (A method inside an object factory (@XmlRegistry) with an explicit @XmlElementDecl annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbElementFactoryMethod
- extends JavaContextNode {
-
- JavaResourceMethod getResourceMethod();
-
- /**
- * Return the method name
- */
- String getName();
-
-
- // ***** scope *****
-
- /**
- * Corresponds to the XmlElementDecl annotation 'scope' element
- */
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- String getScope();
-
- void setScope(String scope);
-
- String DEFAULT_SCOPE_CLASS_NAME = "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"; //$NON-NLS-1$
-
- String getFullyQualifiedScope();
-
- /**
- * Return true if the scope is default or is specified to be XmlElementDecl.GLOBAL.
- */
- boolean isGlobalScope();
-
-
- // ***** qName *****
-
- JaxbQName getQName();
-
-
- // ***** substitution head qName *****
-
- JaxbQName getSubstitutionHeadQName();
-
-
- // ***** default value *****
-
- /**
- * Corresponds to the XmlElementDecl annotation 'defaultValue' element
- */
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- void setDefaultValue(String defaultValue);
-
- String DEFAULT_DEFAULT_VALUE = "\u0000"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java
deleted file mode 100644
index 5a98a688b8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-
-/**
- * Represents an <i>enum</i> in a JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbEnum
- extends JaxbType {
-
- // ***** covariant overrides *****
-
- JavaResourceEnum getJavaResourceType();
-
- public JaxbEnumMapping getMapping();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
deleted file mode 100644
index f84439f633..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB enum constant.
- * (A constant inside an enum with either an explicit or implicit @XmlEnumValue annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbEnumConstant
- extends JavaContextNode {
-
- JavaResourceEnumConstant getResourceEnumConstant();
-
- /**
- * Return the name of the enum constant. This will not change, a
- * new JaxbEnumConstant will be built if the name changes.
- */
- String getName();
-
-
- /**
- * Return the enum constant's value, whether specified or default.
- */
- String getValue();
-
- /**
- * The default value will be the name of the enum constant.
- * It will be used if the XmlEnumValue annotation is null.
- * @see getName()
- */
- String getDefaultValue();
-
- /**
- * Corresponds to the XmlEnumValue annotation 'value' element
- */
- String getSpecifiedValue();
- void setSpecifiedValue(String value);
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java
deleted file mode 100644
index 7d3b1db097..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-
-/**
- * Represents mapping metadata on an enum (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbEnumMapping
- extends JaxbTypeMapping {
-
- // ***** XmlEnum.value *****
-
- /**
- * Return the type specified for the XmlEnum.value, or "java.lang.String" if unspecified
- */
- String getXmlEnumValue();
-
- String SPECIFIED_XML_ENUM_VALUE_PROPERTY = "specifiedXmlEnum"; //$NON-NLS-1$
-
- /**
- * Return the value of the XmlEnum.value element
- */
- String getSpecifiedXmlEnumValue();
-
- void setSpecifiedXmlEnumValue(String xmlEnumValue);
-
- /**
- * Return the value of the XmlEnum.value element, taking into consideration imports
- */
- String getFullyQualifiedXmlEnumValue();
-
- String DEFAULT_XML_ENUM_VALUE = "java.lang.String"; //$NON-NLS-1$
-
-
- // ***** enum constants *****
-
- String ENUM_CONSTANTS_COLLECTION = "enumConstants"; //$NON-NLS-1$
-
- Iterable<JaxbEnumConstant> getEnumConstants();
-
- int getEnumConstantsSize();
-
-
- // ***** misc *****
-
- XsdSimpleTypeDefinition getValueXsdTypeDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
deleted file mode 100644
index 739cbe8806..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPackage
- extends JaxbContextNode {
-
- /**
- * The package name.
- * This is unchanging in that, if a package name changes, a new JaxbPackage is created.
- */
- String getName();
-
- /**
- * The optional package-info
- */
- JaxbPackageInfo getPackageInfo();
- public final static String PACKAGE_INFO_PROPERTY = "package-info"; //$NON-NLS-1$
-
- /**
- * Return the namespace associated with this package, default or specified
- */
- String getNamespace();
-
- /**
- * Return the attribute form default associated with this package
- */
- XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the element form default associated with this package
- */
- XmlNsForm getElementFormDefault();
-
- /**
- * Return whether this package has no useful information.
- * Useful information includes:
- * - annotated package-info.java
- * - jaxb.index
- * - object factory
- */
- boolean isEmpty();
-
- /**
- * Return the {@link XmlRegistry} for this package if there is one.
- * Return *one* if there are more than one (which is an error case at any rate)
- */
- XmlRegistry getRegistry();
-
- /**
- * Return the {@link XsdSchema} associated with this package, if there is one, null otherwise
- */
- XsdSchema getXsdSchema();
-
-
- // **************** validation ********************************************
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
deleted file mode 100644
index 062c95439f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackageInfo.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbPackageInfo
- extends JavaContextNode, XmlAccessTypeHolder, XmlAccessOrderHolder {
-
- JavaResourcePackage getResourcePackage();
-
- JaxbPackage getJaxbPackage();
-
-
- // ***** XmlSchema *****
-
- /**
- * Return the XML schema for this package info, this will not be null.
- */
- XmlSchema getXmlSchema();
-
-
- // ***** XmlSchemaTypes *****
-
- String XML_SCHEMA_TYPES_LIST = "xmlSchemaTypes"; //$NON-NLS-1$
-
- ListIterable<XmlSchemaType> getXmlSchemaTypes();
-
- int getXmlSchemaTypesSize();
-
- XmlSchemaType addXmlSchemaType(int index);
-
- void removeXmlSchemaType(int index);
-
- void removeXmlSchemaType(XmlSchemaType xmlSchemaType);
-
- void moveXmlSchemaType(int targetIndex, int sourceIndex);
-
-
- // ***** XmlJavaTypeAdapters ******
-
- String XML_JAVA_TYPE_ADAPTERS_LIST = "xmlJavaTypeAdapters"; //$NON-NLS-1$
-
- ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters();
-
- int getXmlJavaTypeAdaptersSize();
-
- XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index);
-
- void removeXmlJavaTypeAdapter(int index);
-
- void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlJavaTypeAdapter);
-
- void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex);
-
- /**
- * return an {@link XmlJavaTypeAdapter} for the given bound type name, if one exists
- */
- XmlJavaTypeAdapter getXmlJavaTypeAdapter(String boundTypeName);
-
-
- // ***** misc *****
-
- String getNamespaceForPrefix(String prefix);
-
- String getPrefixForNamespace(String namespace);
-
-
- // ***** validation *****
-
- /**
- * Add validation messages to the specified list.
- */
- void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
deleted file mode 100644
index d9321a53e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentAttribute.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB attribute (field/property).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPersistentAttribute
- extends JavaContextNode {
-
- JaxbClassMapping getClassMapping();
-
-
- // ***** declaring class/ inheritance *****
-
- /**
- * Return the resource type where the source of the attribute is declared.
- * This may not be where the attribute is fully defined, as it may be inherited
- */
- JavaResourceType getDeclaringJavaResourceType();
-
- /**
- * Return true if the source of the attribute is defined in a superclass
- */
- boolean isInherited();
-
-
- // ***** name *****
-
- /**
- * Return the name of the attribute. This will not change, a
- * new JaxbPersistentAttribute will be built if the name changes.
- */
- String getName();
-
-
- // ***** resource attribute *****
-
- JavaResourceAttribute getJavaResourceAttribute();
-
- /**
- * Return the type name of the java attribute, or the item type name of a collection or array.
- */
- String getJavaResourceAttributeBaseTypeName();
-
- /**
- * (See JAXB 2.2 Spec, sect. 5.5.2)
- * Return true if the java attribute type is an extension of java.util.Collection or a single
- * dimensional array (except for byte[], which is treated like a non-array)
- */
- boolean isJavaResourceAttributeCollectionType();
-
- /**
- * Return whether the java resource attribute type is a subtype of the given type
- * This might not return the same thing as getJavaResourceAttribute().typeIsSubTypeOf(String).
- */
- boolean isJavaResourceAttributeTypeSubTypeOf(String typeName);
-
- boolean isFor(JavaResourceField resourceField);
-
- boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter);
-
-
- // ********** mapping **********
-
- /**
- * Return the attribute's mapping. This is never <code>null</code>
- * (although, it may be a <em>null</em> mapping).
- * Set the mapping via {@link PersistentAttribute#setMappingKey(String)}.
- */
- JaxbAttributeMapping getMapping();
- String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- /**
- * Return the attribute's mapping key.
- */
- String getMappingKey();
-
- /**
- * Set the attribute's mapping.
- * If the specified key is <code>null</code>, clear the specified mapping,
- * allowing the attribute's mapping to default (if appropriate).
- * Return the new mapping (which may be a <em>null</em> mapping).
- */
- JaxbAttributeMapping setMappingKey(String key);
-
- /**
- * Return the key for the attribute's default mapping.
- * This can be <code>null</code> (e.g. for <em>specified</em>
- * <code>orm.xml</code> attributes).
- * @see JaxbAttributeMapping#isDefault()
- */
- String getDefaultMappingKey();
- String DEFAULT_MAPPING_KEY_PROPERTY = "defaultMappingKey"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java
deleted file mode 100644
index 5ef41785db..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a namespace, name pairing
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.?
- */
-public interface JaxbQName
- extends JavaContextNode {
-
- // ***** namespace *****
-
- static String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- String getNamespace();
-
- String getDefaultNamespace();
-
- String getSpecifiedNamespace();
-
- void setSpecifiedNamespace(String namespace);
-
-
- // ***** name *****
-
- static String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- String getName();
-
- String getDefaultName();
-
- String getSpecifiedName();
-
- void setSpecifiedName(String name);
-
-
- // ***** validation *****
-
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- TextRange getNameTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
deleted file mode 100644
index 656bef92af..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbType.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Represents a java class (or enum or interface) with JAXB metadata (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbType
- extends JavaContextNode, XmlAdaptable {
-
- // ***** kind *****
-
- Kind getKind();
-
-
- // ***** type mapping *****
-
- final String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- /**
- * Return the mapping of this type.
- * May be null.
- * Will <b>not</b> be null if this type has an XmlType annotation (or other mapping annotation)
- * or if this type is default mapped.
- */
- JaxbTypeMapping getMapping();
-
-
- // ***** default mapped *****
-
- final String DEFAULT_MAPPED_PROPERTY = "defaultMapped"; //$NON-NLS-1$
-
- /**
- * Return true if this type is mapped by reference.
- * (If this type has a default mapping by virtue of it being referenced by another mapped type.)
- */
- boolean isDefaultMapped();
-
- /**
- * Set this to <code>true</code> if this type is referenced by another mapped type.
- * (NB: should only be called by {@link JaxbContextRoot} object.)
- */
- void setDefaultMapped(boolean newValue);
-
-
- /**
- * Return the associated java resource type
- */
- JavaResourceAbstractType getJavaResourceType();
-
- /**
- * Return the name of the type without any package or type qualifiers
- */
- String getSimpleName();
-
- /**
- * Returns the type-qualified name of this type, including qualification for any
- * enclosing types, but not including package qualification.
- */
- String getTypeQualifiedName();
-
- /**
- * Returns the fully qualified name of this type, including qualification for any
- * enclosing types and packages.
- */
- String getFullyQualifiedName();
-
- /**
- * Return the name of the type's package. Empty string if none.
- */
- String getPackageName();
-
- /**
- * Return the {@link JaxbPackage} associated with this type
- * (NB: may be null in some partially built cases)
- */
- JaxbPackage getJaxbPackage();
-
- /**
- * Return the {@link JaxbPackageInfo} associated with this type, if it exists
- */
- JaxbPackageInfo getJaxbPackageInfo();
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
-
- // ****** validation *****
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
-
- public enum Kind {
-
- /**
- * {@link JaxbType}s of {@link Kind} CLASS may safely be cast as {@link JaxbClass}
- */
- CLASS,
-
- /**
- * {@link JaxbType}s of {@link Kind} ENUM may safely be cast as {@link JaxbEnum}
- */
- ENUM;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java
deleted file mode 100644
index 2aa4110064..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbTypeMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-/**
- * Represents mapping metadata on a JaxbType (specified or implied).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JaxbTypeMapping
- extends JavaContextNode {
-
- // ***** JaxbType *****
-
- JaxbType getJaxbType();
-
-
- // ***** XmlTransient *****
-
- String XML_TRANSIENT_PROPERTY = "xmlTransient"; //$NON-NLS-1$
-
- boolean isXmlTransient();
-
- void setXmlTransient(boolean newValue);
-
-
- // ***** XmlType.name and XmlType.namespace *****
-
- JaxbQName getQName();
-
-
- // ***** XmlRootElement *****
-
- String XML_ROOT_ELEMENT_PROPERTY = "xmlRootElement"; //$NON-NLS-1$
-
- XmlRootElement getXmlRootElement();
-
- XmlRootElement addXmlRootElement();
-
- void removeXmlRootElement();
-
-
- // ***** XmlSeeAlso *****
-
- String XML_SEE_ALSO_PROPERTY = "xmlSeeAlso"; //$NON-NLS-1$
-
- XmlSeeAlso getXmlSeeAlso();
-
- XmlSeeAlso addXmlSeeAlso();
-
- void removeXmlSeeAlso();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- XsdTypeDefinition getXsdTypeDefinition();
-
- /**
- * Return true if this class or a subclass (if it can have subclasses) has a root element defined
- */
- boolean hasRootElementInHierarchy();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java
deleted file mode 100644
index 7c3a887420..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Access Order
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessOrder {
-
- ALPHABETICAL(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.ALPHABETICAL
- ),
- UNDEFINED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder;
-
- XmlAccessOrder(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- if (javaAccessOrder == null) {
- throw new NullPointerException();
- }
- this.javaAccessOrder = javaAccessOrder;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder getJavaAccessOrder() {
- return this.javaAccessOrder;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessOrder fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- return (javaAccessOrder == null) ? null : fromJavaResourceModel_(javaAccessOrder);
- }
-
- private static XmlAccessOrder fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
- for (XmlAccessOrder accessOrder : XmlAccessOrder.values()) {
- if (accessOrder.getJavaAccessOrder() == javaAccessOrder) {
- return accessOrder;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder toJavaResourceModel(XmlAccessOrder accessOrder) {
- return (accessOrder == null) ? null : accessOrder.getJavaAccessOrder();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java
deleted file mode 100644
index 6fa5eae416..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessOrderHolder
- extends JaxbContextNode {
-
- /**
- * Return the access order, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- XmlAccessOrder getAccessOrder();
-
- /**
- * String constant associated with changes to the default access order
- */
- String DEFAULT_ACCESS_ORDER_PROPERTY = "defaultAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the default access order, never null
- */
- XmlAccessOrder getDefaultAccessOrder();
-
- /**
- * String constant associated with changes to the specified access order
- */
- String SPECIFIED_ACCESS_ORDER_PROPERTY = "specifiedAccessOrder"; //$NON-NLS-1$
-
- /**
- * Return the specified access order;
- */
- XmlAccessOrder getSpecifiedAccessOrder();
-
- /**
- * Set the specified access order.
- */
- void setSpecifiedAccessOrder(XmlAccessOrder newSpecifiedAccessOrder);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java
deleted file mode 100644
index b2c8fd639a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Access Type
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessType {
-
- FIELD(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD
- ),
- NONE(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE
- ),
- PROPERTY(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PROPERTY
- ),
- PUBLIC_MEMBER(
- org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType;
-
- XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- if (javaAccessType == null) {
- throw new NullPointerException();
- }
- this.javaAccessType = javaAccessType;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType getJavaAccessType() {
- return this.javaAccessType;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessType fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- return (javaAccessType == null) ? null : fromJavaResourceModel_(javaAccessType);
- }
-
- private static XmlAccessType fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
- for (XmlAccessType accessType : XmlAccessType.values()) {
- if (accessType.getJavaAccessType() == javaAccessType) {
- return accessType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType toJavaResourceModel(XmlAccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAccessType();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java
deleted file mode 100644
index 6a562650ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessTypeHolder
- extends JaxbContextNode {
-
- /**
- * Return the access type, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- XmlAccessType getAccessType();
-
- /**
- * String constant associated with changes to the default access type
- */
- String DEFAULT_ACCESS_TYPE_PROPERTY = "defaultAccessType"; //$NON-NLS-1$
-
- /**
- * Return the default access type, never null
- */
- XmlAccessType getDefaultAccessType();
-
- /**
- * String constant associated with changes to the specified access type
- */
- String SPECIFIED_ACCESS_TYPE_PROPERTY = "specifiedAccessType"; //$NON-NLS-1$
-
- /**
- * Return the specified access type;
- */
- XmlAccessType getSpecifiedAccessType();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedAccessType(XmlAccessType newSpecifiedAccessType);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java
deleted file mode 100644
index 1597b485f7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptable.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-public interface XmlAdaptable
- extends JavaContextNode {
-
- // ***** XmlJavaTypeAdapter *****
-
- String XML_JAVA_TYPE_ADAPTER_PROPERTY = "xmlJavaTypeAdapter"; //$NON-NLS-1$
-
- XmlJavaTypeAdapter getXmlJavaTypeAdapter();
-
- XmlJavaTypeAdapter addXmlJavaTypeAdapter();
-
- void removeXmlJavaTypeAdapter();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java
deleted file mode 100644
index 3ba89d68a9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdaptableMapping.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents an attribute mapping that may also have an XmlJavaTypeAdapter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlAdaptableMapping
- extends XmlAdaptable {
-
- /**
- * Return either the {@link XmlAdapter} defined here or any XmlAdapter defined at a higher level
- * that also applies here.
- */
- XmlAdapter getXmlAdapter();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java
deleted file mode 100644
index 99fc144c4b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAdapter.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-
-/**
- * Represents a java class used as an XmlAdapter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAdapter
- extends JaxbContextNode {
-
- static String MARSHAL_METHOD_NAME = "marshal"; //$NON-NLS-1$
-
-
- // ***** bound type *****
-
- /**
- * String associated with changes to the "boundType" property
- */
- static String BOUND_TYPE_PROPERTY = "boundType"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified bound type name (the type used in the java model)
- */
- String getBoundType();
-
-
- // ***** value type *****
-
- /**
- * String associated with changes to the "valueType" property
- */
- static String VALUE_TYPE_PROPERTY = "valueType"; //$NON-NLS-1$
-
- /**
- * Return the fully qualified value type name (the type that corresponds to the xml schema)
- */
- String getValueType();
-
-
- // ***** misc *****
-
- JavaResourceType getJavaResourceType();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java
deleted file mode 100644
index d118b04ae4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml any attribute mapping (@XmlAnyAttribute)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyAttributeMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java
deleted file mode 100644
index f5695b1007..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAnyElementMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml any element mapping (@XmlAnyElement)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyElementMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** lax *****
-
- boolean isLax();
-
- String SPECIFIED_LAX_PROPERTY = "specifiedLax"; //$NON-NLS-1$
-
- Boolean getSpecifiedLax();
-
- void setSpecifiedLax(Boolean specifiedLax);
-
- boolean isDefaultLax();
-
- boolean DEFAULT_LAX = false;
-
-
- // ***** value *****
-
- String getValue();
-
- String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
-
- String getSpecifiedValue();
-
- void setSpecifiedValue(String value);
-
- String DEFAULT_TYPE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- String DEFAULT_VALUE = "javax.xml.bind.annotation.W3CDomHandler"; //$NON-NLS-1$
-
-
- // ***** XmlElementRefs *****
-
- XmlElementRefs getXmlElementRefs();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java
deleted file mode 100644
index 903e3c246f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttachmentRef.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XmlAttachmentRef
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttachmentRef
- extends JavaContextNode {
-
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java
deleted file mode 100644
index a3c6ca9396..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml attribute mapping (@XmlAttribute)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttributeMapping
- extends XmlNamedNodeMapping {
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java
deleted file mode 100644
index 333cbcf353..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-
-/**
- * Represents an @XmlElement, whether at top level or nested in @XmlElements
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElement
- extends JavaContextNode {
-
- // ***** annotation *****
-
- XmlElementAnnotation getAnnotation(boolean createIfNull);
-
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** nillable *****
-
- boolean isNillable();
-
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- Boolean getSpecifiedNillable();
-
- void setSpecifiedNillable(Boolean specifiedNillable);
-
- String DEFAULT_NILLABLE_PROPERTY = "defaultNillable"; //$NON-NLS-1$
-
- boolean isDefaultNillable();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
-
- // ***** default value *****
-
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- String getDefaultValue();
-
- void setDefaultValue(String defaultValue);
-
-
- // ***** type *****
-
- String getType();
-
- String getFullyQualifiedType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
- /**
- * Return the schema element declaration referenced, if it can be resolved.
- */
- XsdElementDeclaration getXsdElement();
-
-
- // ***** validation *****
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java
deleted file mode 100644
index 33a293f4b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementMapping.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents a JAXB xml element mapping (@XmlElement)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementMapping
- extends XmlNamedNodeMapping {
-
- XmlElement getXmlElement();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
deleted file mode 100644
index 9a713bba4a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * Represents an @XmlElementRef, whether at top level or nested in @XmlElementRefs
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRef
- extends JavaContextNode {
-
- // ***** annotation *****
-
- XmlElementRefAnnotation getAnnotation();
-
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** required *****
-
- boolean isRequired();
-
- static String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
-
- // ***** type *****
-
- String getType();
-
- String getFullyQualifiedType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-
-
- // ***** validation *****
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java
deleted file mode 100644
index 51c8cd587d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefMapping.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Represents a JAXB xml element ref mapping (@XmlElementRef)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRefMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElementRef *****
-
- XmlElementRef getXmlElementRef();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java
deleted file mode 100644
index 01d8fdba14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefs.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-public interface XmlElementRefs
- extends JavaContextNode {
-
- // ***** XmlElementRefs *****
-
- String XML_ELEMENT_REFS_LIST = "xmlElementRefs"; //$NON-NLS-1$
-
- ListIterable<XmlElementRef> getXmlElementRefs();
-
- int getXmlElementRefsSize();
-
- XmlElementRef addXmlElementRef(int index);
-
- void removeXmlElementRef(int index);
-
- void removeXmlElementRef(XmlElementRef xmlElementRef);
-
- void moveXmlElementRef(int targetIndex, int sourceIndex);
-
-
- // ***** misc *****
-
- /**
- * Return all directly referenced xml types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java
deleted file mode 100644
index 14a4a55934..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRefsMapping.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml element refs mapping (@XmlElementRefs)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementRefsMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElementRefs *****
-
- XmlElementRefs getXmlElementRefs();
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlMixed *****
-
- String XML_MIXED_PROPERTY = "xmlMixed"; //$NON-NLS-1$
-
- XmlMixed getXmlMixed();
-
- XmlMixed addXmlMixed();
-
- void removeXmlMixed();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
deleted file mode 100644
index 2f227762d0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-
-
-/**
- * Represents a JAXB XML element wrapper
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementWrapper
- extends JavaContextNode {
-
- // ***** qname *****
-
- JaxbQName getQName();
-
-
- // ***** nillable *****
-
- boolean isNillable();
-
- String SPECIFIED_NILLABLE_PROPERTY = "specifiedNillable"; //$NON-NLS-1$
-
- Boolean getSpecifiedNillable();
-
- void setSpecifiedNillable(Boolean specifiedNillable);
-
- boolean isDefaultNillable();
-
- boolean DEFAULT_NILLABLE = false;
-
-
- // ***** required *****
-
- boolean isRequired();
-
- String SPECIFIED_REQUIRED_PROPERTY = "specifiedRequired"; //$NON-NLS-1$
-
- Boolean getSpecifiedRequired();
-
- void setSpecifiedRequired(Boolean specifiedRequired);
-
- boolean isDefaultRequired();
-
- boolean DEFAULT_REQUIRED = false;
-
-
- // ***** misc *****
-
- XsdElementDeclaration getXsdElementDeclaration();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java
deleted file mode 100644
index fd4bd249ee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementsMapping.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Represents a JAXB xml elements mapping (@XmlElements)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface XmlElementsMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** XmlElements *****
-
- String XML_ELEMENTS_LIST = "xmlElements"; //$NON-NLS-1$
-
- ListIterable<XmlElement> getXmlElements();
-
- int getXmlElementsSize();
-
- XmlElement addXmlElement(int index);
-
- void removeXmlElement(int index);
-
- void removeXmlElement(XmlElement xmlElement);
-
- void moveXmlElement(int targetIndex, int sourceIndex);
-
-
- // ***** XmlElementWrapper *****
-
- String XML_ELEMENT_WRAPPER_PROPERTY = "xmlElementWrapper"; //$NON-NLS-1$
-
- XmlElementWrapper getXmlElementWrapper();
-
- XmlElementWrapper addXmlElementWrapper();
-
- void removeXmlElementWrapper();
-
-
- // ***** XmlIDREF *****
-
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
- XmlIDREF getXmlIDREF();
-
- XmlIDREF addXmlIDREF();
-
- void removeXmlIDREF();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java
deleted file mode 100644
index 83169f9133..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlID.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML ID (@XmlID)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlID
- extends JavaContextNode {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java
deleted file mode 100644
index 5eaefd3d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlIDREF.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB XML ID ref (@XmlIDREF)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDREF
- extends JavaContextNode {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
deleted file mode 100644
index a7b342bdbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface XmlJavaTypeAdapter
- extends JavaContextNode {
-
- XmlJavaTypeAdapterAnnotation getAnnotation();
-
-
- // ***** value *****
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- String getValue();
-
- void setValue(String value);
-
- String getFullyQualifiedValue();
-
-
- // ***** xmlAdapter *****
-
- String XML_ADAPTER_PROPERTY = "xmlAdapter"; //$NON-NLS-1$
-
- /**
- * Object based on specified "value"
- */
- XmlAdapter getXmlAdapter();
-
-
- // ***** type *****
-
- String getType();
-
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getSpecifiedType();
-
- void setSpecifiedType(String type);
-
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
-
- String getDefaultType();
-
- String getFullyQualifiedType();
-
- String DEFAULT_TYPE = "javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
deleted file mode 100644
index dfc6df927a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlMixed.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents the @XmlMixed JAXB annotation
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMixed
- extends JavaContextNode {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java
deleted file mode 100644
index 6efc373067..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNamedNodeMapping.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-
-/**
- * Common interface for XmlElementMapping and XmlAttributeMapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlNamedNodeMapping
- extends XmlNodeMapping {
-
- // ***** XmlID *****
-
- String XML_ID_PROPERTY = "xmlID"; //$NON-NLS-1$
-
- XmlID getXmlID();
-
- XmlID addXmlID();
-
- void removeXmlID();
-
-
- // ***** XmlIDREF *****
-
- String XML_IDREF_PROPERTY = "xmlIDREF"; //$NON-NLS-1$
-
- XmlIDREF getXmlIDREF();
-
- XmlIDREF addXmlIDREF();
-
- void removeXmlIDREF();
-
-
- // ***** XmlAttachmentRef *****
-
- String XML_ATTACHMENT_REF_PROPERTY = "xmlAttachmentRef"; //$NON-NLS-1$
-
- XmlAttachmentRef getXmlAttachmentRef();
-
- XmlAttachmentRef addXmlAttachmentRef();
-
- void removeXmlAttachmentRef();
-
-
- // ***** misc *****
-
- XsdFeature getXsdFeature();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java
deleted file mode 100644
index d223416f95..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNodeMapping.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- * Common interface for XmlElementMapping, XmlAttributeMapping, and XmlValueMapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlNodeMapping
- extends JaxbAttributeMapping, XmlAdaptableMapping {
-
- // ***** xml schema type *****
-
- String XML_SCHEMA_TYPE_PROPERTY = "xmlSchemaType"; //$NON-NLS-1$
-
- XmlSchemaType getXmlSchemaType();
-
- XmlSchemaType addXmlSchemaType();
-
- void removeXmlSchemaType();
-
-
- // ***** XmlList *****
-
- boolean isXmlList();
-
- String SPECIFIED_XML_LIST_PROPERTY = "specifiedXmlList"; //$NON-NLS-1$
-
- boolean isSpecifiedXmlList();
-
- void setSpecifiedXmlList(boolean newValue);
-
- String DEFAULT_XML_LIST_PROPERTY = "defaultXmlList"; //$NON-NLS-1$
-
- boolean isDefaultXmlList();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
deleted file mode 100644
index 2957f574d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNs.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlNs
- extends JavaContextNode {
-
-
- XmlNsAnnotation getResourceXmlNs();
-
-
- // ***** namespaceURI *****
-
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- String getNamespaceURI();
-
- void setNamespaceURI(String namespaceURI);
-
-
- // ***** prefix *****
-
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-
- String getPrefix();
-
- void setPrefix(String prefix);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java
deleted file mode 100644
index 25b8ebc374..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlNsForm.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlNsForm {
-
- QUALIFIED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED
- ),
- UNQUALIFIED(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED
- ),
- UNSET(
- org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNSET
- );
-
-
- private org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm;
-
- XmlNsForm(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- if (javaNsForm == null) {
- throw new NullPointerException();
- }
- this.javaNsForm = javaNsForm;
- }
-
- public org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm getJavaNsForm() {
- return this.javaNsForm;
- }
-
-
- // ********** static methods **********
-
- public static XmlNsForm fromJavaResourceModel(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- return (javaNsForm == null) ? null : fromJavaResourceModel_(javaNsForm);
- }
-
- private static XmlNsForm fromJavaResourceModel_(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm javaNsForm) {
- for (XmlNsForm nsForm : XmlNsForm.values()) {
- if (nsForm.getJavaNsForm() == javaNsForm) {
- return nsForm;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm toJavaResourceModel(XmlNsForm nsForm) {
- return (nsForm == null) ? null : nsForm.getJavaNsForm();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java
deleted file mode 100644
index 8e8be55590..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRegistry.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-/**
- * Represents a JAXB registry
- * (A class with an explicit @XmlRegistry annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRegistry
- extends JavaContextNode {
-
- // ***** element factory methods ******
-
- String ELEMENT_FACTORY_METHODS_COLLECTION = "elementFactoryMethods"; //$NON-NLS-1$
-
- Iterable<JaxbElementFactoryMethod> getElementFactoryMethods();
-
- int getElementFactoryMethodsSize();
-
-
- // ***** misc *****
-
- JaxbClass getJaxbClass();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
deleted file mode 100644
index 9c57969d97..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents a JAXB xml root element.
- * (A class with an explicit @XmlRootElement annotation)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRootElement
- extends JavaContextNode {
-
- JaxbTypeMapping getTypeMapping();
-
- JaxbQName getQName();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
deleted file mode 100644
index 02be8d7833..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchema
- extends JavaContextNode {
-
- JaxbPackageInfo getJaxbPackageInfo();
-
-
- // ***** namespace *****
-
- /**
- * Return the specified namespace or "" (default value)
- */
- String getNamespace();
-
- /**
- * Return the specified namespace, null if it is not specified
- */
- String getSpecifiedNamespace();
-
- /**
- * Set the namespace, null to unspecify
- */
- void setSpecifiedNamespace(String namespace);
-
- /**
- * String constant associated with changes to the specified namespace
- */
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the XmlSchema annotation location element
- */
- String getLocation();
- void setLocation(String location);
- String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
- String DEFAULT_LOCATION = "##generate"; //$NON-NLS-1$
-
-
- // **************** attribute form default ********************************
-
- /**
- * Return the specified attribute form default or XmlNsForm.UNSET (default value)
- */
- XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the specified attribute form default, null if it is not specified
- */
- XmlNsForm getSpecifiedAttributeFormDefault();
-
- /**
- * Set the attribute form default, null to unspecify
- */
- void setSpecifiedAttributeFormDefault(XmlNsForm attributeFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
-
-
- // **************** element form default ********************************
-
- /**
- * Return the specified element form default or XmlNsForm.UNSET (default value)
- */
- XmlNsForm getElementFormDefault();
-
- /**
- * Return the specified element form default, null if it is not specified
- */
- XmlNsForm getSpecifiedElementFormDefault();
-
- /**
- * Set the element form default, null to unspecify
- */
- void setSpecifiedElementFormDefault(XmlNsForm elementFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
-
-
- // ********** xml namespace prefixes **********
-
- ListIterable<XmlNs> getXmlNsPrefixes();
- int getXmlNsPrefixesSize();
- XmlNs addXmlNsPrefix(int index);
- void removeXmlNsPrefix(int index);
- void removeXmlNsPrefix(XmlNs xmlNsPrefix);
- void moveXmlNsPrefix(int targetIndex, int sourceIndex);
- String XML_NS_PREFIXES_LIST = "xmlNsPrefixes"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
deleted file mode 100644
index 55b5a60229..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.xsd.util.XSDUtil;
-
-/**
- *
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlSchemaType
- extends JavaContextNode {
-
- String DEFAULT_NAMESPACE = XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001;
-
- XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation();
-
- JaxbQName getQName();
-
-
- // ***** type *****
-
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the XmlSchemaType annotation 'type' element
- */
- String getType();
-
- void setType(String type);
-
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT"; //$NON-NLS-1$
-
- public String getFullyQualifiedType();
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java
deleted file mode 100644
index f291894fd8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSeeAlso.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Maintains a list of classes (class names here) to be added to the JAXB context.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-
-public interface XmlSeeAlso
- extends JavaContextNode {
-
- // **************** value *************************************************
-
- public static final String CLASSES_LIST = "classes";
-
- ListIterable<String> getClasses();
-
- int getClassesSize();
-
- void addClass(int index, String clazz);
-
- void removeClass(int index);
-
- void moveClass(int targetIndex, int sourceIndex);
-
-
- // **************** misc **************************************************
-
- /**
- * Return all directly referenced types, fully qualified.
- * (Used for constructing Jaxb context)
- */
- Iterable<String> getReferencedXmlTypeNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java
deleted file mode 100644
index e01c18e7fd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlValueMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context;
-
-
-/**
- * Represents a JAXB xml value mapping (@XmlValue)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlValueMapping
- extends XmlNodeMapping {
-
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java
deleted file mode 100644
index ff6fdc4ac3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/DefaultJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface DefaultJavaAttributeMappingDefinition extends JavaAttributeMappingDefinition
-{
-
- /**
- * Return whether this mapping provider should be used for the given {@link JaxbPersistentAttribute}
- * in the default (ignoring all mapping annotations) case.
- */
- boolean isDefault(JaxbPersistentAttribute persistentAttribute);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java
deleted file mode 100644
index d427d8eb01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-/**
- * Map a string key to an attribute mapping and its corresponding
- * Java annotation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaAttributeMappingDefinition
-{
- /**
- * Return the attribute mapping's key.
- */
- String getKey();
-
- /**
- * Return the attribute mapping's Java annotation name.
- */
- String getAnnotationName();
-
- /**
- * Build a Java attribute mapping for the specified attribute. Use the specified
- * factory for creation so extenders can simply override the appropriate
- * creation method instead of building a provider for the same key.
- */
- JaxbAttributeMapping buildMapping(JaxbPersistentAttribute attribute, JaxbFactory factory);
-
- /**
- * Return all fully qualified annotation names that are supported with this mapping type.
- * This includes all possible annotations, not just the ones that currently exist on the attribute.
- */
- Iterable<String> getSupportingAnnotationNames();
-
- /**
- * Return whether this mapping provider should be used for the given {@link PersistentAttribute}
- * in the specified (observing all mapping annotations) case.
- */
- boolean isSpecified(JaxbPersistentAttribute persistentAttribute);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java
deleted file mode 100644
index b2859f03dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/java/JavaContextNode.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public interface JavaContextNode
- extends JaxbContextNode {
-
- // **************** content assist ****************************************
-
- /**
- * Return the Java code-completion proposals for the specified position in the source code.
- */
- Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot);
-
-
- // ******************** validation ****************************************
-
- /**
- * Adds to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- /**
- * Return the text range for highlighting errors for this object
- */
- TextRange getValidationTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
deleted file mode 100644
index 2bfd9edc6e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbProject.Config;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.GenericContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.context.GenericPackage;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaClassMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumConstant;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaEnumMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaJaxbClass;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaJaxbEnum;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPackageInfo;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlNs;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlRootElement;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlSchema;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlTransientMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * Central class that allows extenders to easily replace implementations of
- * various Dali interfaces.
- */
-public abstract class AbstractJaxbFactory
- implements JaxbFactory {
-
- protected AbstractJaxbFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- public JaxbProject buildJaxbProject(Config config) {
- return new GenericJaxbProject(config);
- }
-
- public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel) {
- return new GenericJaxbFile(jaxbProject, file, contentType, resourceModel);
- }
-
-
- // ********** Non-resource-specific context nodes **********
-
- public JaxbContextRoot buildContextRoot(JaxbProject parent) {
- return new GenericContextRoot(parent);
- }
-
- public JaxbPackage buildPackage(JaxbContextRoot parent, String packageName) {
- return new GenericPackage(parent, packageName);
- }
-
-
- // ***** Java context nodes *****
-
- public JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage) {
- return new GenericJavaPackageInfo(parent, resourcePackage);
- }
-
- public XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent) {
- return new GenericJavaXmlSchema(parent);
- }
-
- public XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- return new GenericJavaXmlNs(parent, xmlNsAnnotation);
- }
-
- public JaxbClass buildJaxbClass(JaxbContextRoot parent, JavaResourceType resourceType) {
- return new GenericJavaJaxbClass(parent, resourceType);
- }
-
- public JaxbEnum buildJaxbEnum(JaxbContextRoot parent, JavaResourceEnum resourceEnum) {
- return new GenericJavaJaxbEnum(parent, resourceEnum);
- }
-
- public JaxbClassMapping buildJaxbClassMapping(JaxbClass parent) {
- return new GenericJavaClassMapping(parent);
- }
-
- public JaxbEnumMapping buildJaxbEnumMapping(JaxbEnum parent) {
- return new GenericJavaEnumMapping(parent);
- }
-
- public XmlRegistry buildXmlRegistry(JaxbClass parent) {
- return new GenericJavaXmlRegistry(parent);
- }
-
- public JaxbElementFactoryMethod buildJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- return new GenericJavaElementFactoryMethod(parent, resourceMethod);
- }
-
- public XmlRootElement buildJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation xmlRootElementAnnotation) {
- return new GenericJavaXmlRootElement(parent, xmlRootElementAnnotation);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor) {
- return new GenericJavaPersistentAttribute(parent, accessor);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentField(JaxbClassMapping parent, JavaResourceField resourceField) {
- return GenericJavaPersistentAttribute.buildPersistentField(parent, resourceField);
- }
-
- public JaxbPersistentAttribute buildJavaPersistentProperty(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return GenericJavaPersistentAttribute.buildPersistentProperty(parent, resourceGetter, resourceSetter);
- }
-
- public JaxbAttributeMapping buildJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaNullAttributeMapping(parent);
- }
-
- public JaxbAttributeMapping buildJavaXmlTransientMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlTransientMapping(parent);
- }
-
- public XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAnyAttributeMapping(parent);
- }
-
- public XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAnyElementMapping(parent);
- }
-
- public XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlAttributeMapping(parent);
- }
-
- public XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementMapping(parent);
- }
-
- public XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementRefMapping(parent);
- }
-
- public XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementRefsMapping(parent);
- }
-
- public XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlElementsMapping(parent);
- }
-
- public XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- return new GenericJavaXmlValueMapping(parent);
- }
-
- public JaxbEnumConstant buildJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant) {
- return new GenericJavaEnumConstant(parent, resourceEnumConstant);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
deleted file mode 100644
index 8357f5f173..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbNode.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.JDTModifiedDeclaration.Adapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.AspectChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-
-/**
- * Some common Dali behavior:<ul>
- * <li>containment hierarchy
- * <li>Eclipse adaptable
- * <li>update triggers
- * </ul>
- */
-public abstract class AbstractJaxbNode
- extends AbstractModel
- implements JaxbNode
-{
- private final JaxbNode parent;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJaxbNode(JaxbNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- protected void checkParent(JaxbNode p) {
- if (p == null) {
- if (this.requiresParent()) {
- throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
- }
- } else {
- if (this.forbidsParent()) {
- throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
- }
- }
- }
-
- protected boolean requiresParent() {
- return true;
- }
-
- protected boolean forbidsParent() {
- return ! this.requiresParent(); // assume 'parent' is not optional
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new AspectChangeSupport(this, this.buildChangeSupportListener());
- }
-
- protected AspectChangeSupport.Listener buildChangeSupportListener() {
- return new AspectChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJaxbNode.this.aspectChanged(aspectName);
- }
- };
- }
-
-
- // ********** IAdaptable implementation **********
-
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public Object getAdapter(Class adapter) {
- return PlatformTools.getAdapter(this, adapter);
- }
-
-
- // ********** JaxbNode implementation **********
-
- public JaxbNode getParent() {
- return this.parent;
- }
-
- public IResource getResource() {
- return this.parent.getResource();
- }
-
- public JaxbProject getJaxbProject() {
- return this.parent.getJaxbProject();
- }
-
-
- // ********** convenience methods **********
-
- protected JaxbPlatform getPlatform() {
- return this.getJaxbProject().getPlatform();
- }
-
-// protected JaxbPlatform.Version getJaxbPlatformVersion() {
-// return this.getJaxbPlatform().getJaxbPlatformVersion();
-// }
-
- protected JaxbFactory getFactory() {
- return this.getPlatform().getFactory();
- }
-
- protected JaxbFile getJaxbFile(IFile file) {
- return this.getJaxbProject().getJaxbFile(file);
- }
-
-
- // ********** CallbackChangeSupport.Listener support **********
-
- protected void aspectChanged(String aspectName) {
- if (this.aspectTriggersUpdate(aspectName)) {
-// String msg = Thread.currentThread() + " aspect change: " + this + ": " + aspectName;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- this.stateChanged();
- }
- }
-
- private boolean aspectTriggersUpdate(String aspectName) {
- return ! this.aspectDoesNotTriggerUpdate(aspectName);
- }
-
- protected boolean aspectDoesNotTriggerUpdate(String aspectName) {
- // ignore state changes so we don't get a stack overflow :-)
- // (and we don't use state changes except here)
- return (aspectName == null) ||
- this.nonUpdateAspectNames().contains(aspectName);
- }
-
- protected final Set<String> nonUpdateAspectNames() {
- synchronized (nonUpdateAspectNameSets) {
- HashSet<String> nonUpdateAspectNames = nonUpdateAspectNameSets.get(this.getClass());
- if (nonUpdateAspectNames == null) {
- nonUpdateAspectNames = new HashSet<String>();
- this.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNameSets.put(this.getClass(), nonUpdateAspectNames);
- }
- return nonUpdateAspectNames;
- }
- }
-
- private static final HashMap<Class<? extends AbstractJaxbNode>, HashSet<String>> nonUpdateAspectNameSets = new HashMap<Class<? extends AbstractJaxbNode>, HashSet<String>>();
-
- protected void addNonUpdateAspectNamesTo(@SuppressWarnings("unused") Set<String> nonUpdateAspectNames) {
- // when you override this method, don't forget to include:
- // super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- }
-
- public void stateChanged() {
- this.fireStateChanged();
- if (this.parent != null) {
- this.parent.stateChanged();
- }
- }
-
-
- /**
- * Adapter used to synchronize a context collection container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class CollectionContainer<C, R> {
-
- protected final Vector<C> contextElements = new Vector<C>();
-
- protected CollectionContainer() {
- super();
- }
-
- /**
- * Return the container's current set of resource elements.
- * These are what the context elements will be synchronized to.
- */
- protected abstract Iterable<R> getResourceElements();
-
- /**
- * Return the resource element corresponding to the specified context
- * element.
- */
- protected abstract R getResourceElement(C contextElement);
-
- /**
- * Build and return a context element for the given resource element
- */
- protected abstract C buildContextElement(R resourceElement);
-
- /**
- * Return the property name for event notification when the collection is changed.
- */
- protected abstract String getContextElementsPropertyName();
-
- /**
- * clients needs to call initialize if necessary
- */
- public void initialize() {
- for (R resourceElement : this.getResourceElements()) {
- this.contextElements.add(this.buildContextElement(resourceElement));
- }
- }
-
- /**
- * Return an Iterable of the context elements
- */
- public Iterable<C> getContextElements() {
- return new LiveCloneIterable<C>(this.contextElements);
- }
-
- /**
- * Return the size of the context elements collection
- */
- public int getContextElementsSize() {
- return this.contextElements.size();
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- public C addContextElement(int index, R resourceElement) {
- return this.addContextElement_(index, this.buildContextElement(resourceElement));
- }
-
- /**
- * Add the specified context element to the collection ignoring
- * the specified index as we only have a collection
- */
- protected C addContextElement_(@SuppressWarnings("unused") int index, C contextElement) {
- AbstractJaxbNode.this.addItemToCollection(contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Remove the specified context element from the container.
- */
- public void removeContextElement(C element) {
- AbstractJaxbNode.this.removeItemFromCollection(element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- @SuppressWarnings("unused")
- protected void moveContextElement(int index, C element) {
- //no-op, not a list
- }
- }
-
- /**
- * Adapter used to synchronize a context collection container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ContextCollectionContainer<C extends JaxbContextNode, R> extends CollectionContainer<C, R> {
-
- protected ContextCollectionContainer() {
- super();
- }
-
- /**
- * Using the specified adapter, synchronize a context container with its
- * corresponding resource container: moving, removing, and adding elements
- * as necessary.
- * <p>
- * We can do this because:<ul>
- * <li>the XML translators will <em>move</em> the EMF elements when
- * appropriate (as opposed to simply rebuilding them in place).
- * <li>the Java resource model will re-use existing annotations when
- * appropriate (as opposed to simply rebuilding them in place).
- * </ul>
- */
- public void synchronizeWithResourceModel() {
- sync(true); // true = sync
- }
-
- /**
- * @see #synchronizeWithResourceModel(Adapter)
- */
- public void update() {
- sync(false); // false = update
- }
-
- /**
- * The specified <code>sync</code> flag controls whether any surviving
- * context nodes are either <em>synchronized</em> (<code>true</code>) or
- * <em>updated</em> (<code>false</code>).
- */
- protected void sync(boolean sync) {
- HashSet<C> contextElements = CollectionTools.set(this.getContextElements());
- int resourceIndex = 0;
-
- for (R resourceElement : this.getResourceElements()) {
- boolean match = false;
- for (Iterator<C> stream = contextElements.iterator(); stream.hasNext(); ) {
- C contextElement = stream.next();
- if (Tools.valuesAreEqual(this.getResourceElement(contextElement), resourceElement)) {
- // we don't know the source index because the element has been moved by previously moved elements
- this.moveContextElement(resourceIndex, contextElement);
- stream.remove();
- if (sync) {
- contextElement.synchronizeWithResourceModel();
- } else {
- contextElement.update();
- }
- match = true;
- break;
- }
- }
- if ( ! match) {
- // added elements are sync'ed during construction or will be
- // updated during the next "update" (which is triggered by
- // their addition to the model)
- this.addContextElement(resourceIndex, resourceElement);
- }
- resourceIndex++;
- }
- // remove any leftover context elements
- for (C contextElement : contextElements) {
- this.removeContextElement(contextElement);
- }
- }
- }
-
- /**
- * Adapter used to synchronize a context list container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ListContainer<C, R>
- extends CollectionContainer<C, R> {
-
- protected ListContainer() {
- super();
- }
-
- @Override
- public ListIterable<C> getContextElements() {
- return new LiveCloneListIterable<C>(this.contextElements);
- }
-
- @Override
- protected abstract ListIterable<R> getResourceElements();
-
- /**
- * Return the index of the specified context element.
- */
- public int indexOfContextElement(C contextElement) {
- return this.contextElements.indexOf(contextElement);
- }
-
- public C getContextElement(int index) {
- return this.contextElements.elementAt(index);
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- @Override
- protected C addContextElement_(int index, C contextElement) {
- AbstractJaxbNode.this.addItemToList(index, contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Move the context element at the specified target index to the
- * specified source index.
- */
- public void moveContextElement(int targetIndex, int sourceIndex) {
- this.moveContextElement(targetIndex, this.contextElements.get(sourceIndex));
- }
-
- /**
- * Move the specified context element to the specified index.
- */
- @Override
- public void moveContextElement(int index, C element) {
- AbstractJaxbNode.this.moveItemInList(index, element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- /**
- * Remove the context element at the specified index from the container.
- */
- public void removeContextElement(int index) {
- AbstractJaxbNode.this.removeItemFromList(index, this.contextElements, this.getContextElementsPropertyName());
- }
-
- public void synchronizeWithResourceModel() {
- ListIterable<R> resourceElements = getResourceElements();
-
- int index = 0;
- for (R resourceElement : resourceElements) {
- if (this.getContextElementsSize() > index) {
- if (this.getContextElement(index) != resourceElement) {
- this.addContextElement(index, resourceElement);
- }
- }
- else {
- this.addContextElement(index, resourceElement);
- }
- index++;
- }
-
- for ( ; index < this.getContextElementsSize(); ) {
- this.removeContextElement(index);
- }
- }
- }
-
- /**
- * Adapter used to synchronize a context list container with its corresponding
- * resource container.
- * @param <C> the type of context elements
- * @param <R> the type of resource elements
- */
- protected abstract class ContextListContainer<C extends JaxbContextNode, R>
- extends ContextCollectionContainer<C, R> {
-
- protected ContextListContainer() {
- super();
- }
-
- @Override
- public ListIterable<C> getContextElements() {
- return new LiveCloneListIterable<C>(this.contextElements);
- }
-
- @Override
- protected abstract ListIterable<R> getResourceElements();
-
- /**
- * Return the index of the specified context element.
- */
- public int indexOfContextElement(C contextElement) {
- return this.contextElements.indexOf(contextElement);
- }
-
- public C getContextElement(int index) {
- return this.contextElements.elementAt(index);
- }
-
- /**
- * Add a context element for the specified resource element at the
- * specified index.
- */
- @Override
- protected C addContextElement_(int index, C contextElement) {
- AbstractJaxbNode.this.addItemToList(index, contextElement, this.contextElements, this.getContextElementsPropertyName());
- return contextElement;
- }
-
- /**
- * Move the context element at the specified target index to the
- * specified source index.
- */
- public void moveContextElement(int targetIndex, int sourceIndex) {
- this.moveContextElement(targetIndex, this.contextElements.get(sourceIndex));
- }
-
- /**
- * Move the specified context element to the specified index.
- */
- @Override
- public void moveContextElement(int index, C element) {
- AbstractJaxbNode.this.moveItemInList(index, element, this.contextElements, this.getContextElementsPropertyName());
- }
-
- /**
- * Remove the context element at the specified index from the container.
- */
- public void removeContextElement(int index) {
- AbstractJaxbNode.this.removeItemFromList(index, this.contextElements, this.getContextElementsPropertyName());
- }
-
- @Override
- public void removeContextElement(C contextElement) {
- AbstractJaxbNode.this.removeItemFromList(contextElement, this.contextElements, this.getContextElementsPropertyName());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java
deleted file mode 100644
index dd75e3a83e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbPlatformDefinition.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-/**
- * All the state in the JAXB platform definition should be "static"
- * (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractJaxbPlatformDefinition
- implements JaxbPlatformDefinition {
-
- private Map<String, String> javaToSchemaTypes;
-
- private AnnotationDefinition[] annotationDefinitions;
-
- private NestableAnnotationDefinition[] nestableAnnotationDefinitions;
-
- private JaxbResourceModelProvider[] resourceModelProviders;
-
- private ArrayList<DefaultJavaAttributeMappingDefinition> defaultJavaAttributeMappingDefinitions;
-
- private ArrayList<JavaAttributeMappingDefinition> specifiedJavaAttributeMappingDefinitions;
-
-// private ResourceDefinition[] resourceDefinitions;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractJaxbPlatformDefinition() {
- super();
- }
-
-
- // ***** platform-y things *****
-
- public String getSchemaTypeMapping(String javaTypeName) {
- if (this.javaToSchemaTypes == null) {
- this.javaToSchemaTypes = new HashMap<String, String>();
- this.javaToSchemaTypes.putAll(buildJavaToSchemaTypes());
- }
- return this.javaToSchemaTypes.get(javaTypeName);
- }
-
- protected Map<String, String> buildJavaToSchemaTypes() {
- return Collections.EMPTY_MAP;
- }
-
-
- // ********** annotation definitions **********
-
- public AnnotationDefinition[] getAnnotationDefinitions() {
- if (this.annotationDefinitions == null) {
- this.annotationDefinitions = this.buildAnnotationDefinitions();
- }
- return this.annotationDefinitions;
- }
-
- protected abstract AnnotationDefinition[] buildAnnotationDefinitions();
-
-
- // ********** nestable annotation definitions **********
-
- public NestableAnnotationDefinition[] getNestableAnnotationDefinitions() {
- if (this.nestableAnnotationDefinitions == null) {
- this.nestableAnnotationDefinitions = this.buildNestableAnnotationDefinitions();
- }
- return this.nestableAnnotationDefinitions;
- }
-
- protected abstract NestableAnnotationDefinition[] buildNestableAnnotationDefinitions();
-
-
- // ********** resource models **********
-
- public ListIterable<JaxbResourceModelProvider> getResourceModelProviders() {
- return new ArrayListIterable<JaxbResourceModelProvider>(getResourceModelProviders_());
- }
-
- protected synchronized JaxbResourceModelProvider[] getResourceModelProviders_() {
- if (this.resourceModelProviders == null) {
- this.resourceModelProviders = this.buildResourceModelProviders();
- }
- return this.resourceModelProviders;
- }
-
- protected abstract JaxbResourceModelProvider[] buildResourceModelProviders();
-
-
- // ********** Java attribute mappings **********
-
- public synchronized Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions() {
- if (this.defaultJavaAttributeMappingDefinitions == null) {
- this.defaultJavaAttributeMappingDefinitions = this.buildDefaultJavaAttributeMappingDefinitions();
- }
- return this.defaultJavaAttributeMappingDefinitions;
- }
-
- protected ArrayList<DefaultJavaAttributeMappingDefinition> buildDefaultJavaAttributeMappingDefinitions() {
- ArrayList<DefaultJavaAttributeMappingDefinition> definitions = new ArrayList<DefaultJavaAttributeMappingDefinition>();
- this.addDefaultJavaAttributeMappingDefinitionsTo(definitions);
- return definitions;
- }
-
- /**
- * To the specified list, add mapping definitions to use for analyzing the
- * default mapping of an attribute. The order is important,
- * as once a mapping definition tests positive for an attribute,
- * all following mapping definitions are ignored.
- */
- protected abstract void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions);
-
- public synchronized Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions() {
- if (this.specifiedJavaAttributeMappingDefinitions == null) {
- this.specifiedJavaAttributeMappingDefinitions = this.buildSpecifiedJavaAttributeMappingDefinitions();
- }
- return this.specifiedJavaAttributeMappingDefinitions;
- }
-
- protected ArrayList<JavaAttributeMappingDefinition> buildSpecifiedJavaAttributeMappingDefinitions() {
- ArrayList<JavaAttributeMappingDefinition> definitions = new ArrayList<JavaAttributeMappingDefinition>();
- this.addSpecifiedJavaAttributeMappingDefinitionsTo(definitions);
- return definitions;
- }
-
- /**
- * To the specified list, add mapping definitions to use for analyzing the
- * specified mapping of an attribute given all annotations on it. The order
- * is important, as once a mapping definition tests positive for an
- * attribute, all following mapping definitions are ignored.
- */
- protected abstract void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions);
-
-
-// // ********** Mapping Files **********
-//
-// public ListIterator<ResourceDefinition> resourceDefinitions() {
-// return new ArrayListIterator<ResourceDefinition>(getResourceDefinitions());
-// }
-//
-// protected synchronized ResourceDefinition[] getResourceDefinitions() {
-// if (this.resourceDefinitions == null) {
-// this.resourceDefinitions = this.buildResourceDefinitions();
-// }
-// return this.resourceDefinitions;
-// }
-//
-// protected abstract ResourceDefinition[] buildResourceDefinitions();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
deleted file mode 100644
index 35af48af0d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java
+++ /dev/null
@@ -1,1660 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IResourceProxy;
-import org.eclipse.core.resources.IResourceProxyVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageDeclaration;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.command.ExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.command.ThreadLocalExtendedCommandExecutor;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.synchronizers.CallbackSynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.common.utility.synchronizers.Synchronizer;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.platform.JaxbPlatformImpl;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * JAXB project. Holds all the JAXB stuff.
- *
- * The JAXB platform provides the hooks for vendor-specific stuff.
- *
- * The JAXB files are the "resource" model (i.e. objects that correspond directly
- * to Eclipse resources; e.g. Java source code files, XML files, JAR files).
- *
- * The root context node is the "context" model (i.e. objects that attempt to
- * model the JAXB spec, using the "resource" model as an adapter to the Eclipse
- * resources).
- */
-public abstract class AbstractJaxbProject
- extends AbstractJaxbNode
- implements JaxbProject {
-
- /**
- * The Eclipse project corresponding to the JAXB project.
- */
- protected final IProject project;
-
- /**
- * The vendor-specific JAXB platform that builds the JAXB project
- * and all its contents.
- */
- protected final JaxbPlatform jaxbPlatform;
-
- /**
- * The library of schemas associated with this project
- */
- protected final SchemaLibraryImpl schemaLibrary;
-
- /**
- * The JAXB files associated with the JAXB project:
- * java
- * jaxb.index
- * platform-specific files
- */
- protected final Vector<JaxbFile> jaxbFiles = new Vector<JaxbFile>();
-
-// /**
-// * The "external" Java resource compilation units (source). Populated upon demand.
-// */
-// protected final Vector<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits = new Vector<JavaResourceCompilationUnit>();
-//
-// /**
-// * The "external" Java resource persistent types (binary). Populated upon demand.
-// */
-// protected final JavaResourcePersistentTypeCache externalJavaResourcePersistentTypeCache;
-
- /**
- * Resource models notify this listener when they change. A project update
- * should occur any time a resource model changes.
- */
- protected final JptResourceModelListener resourceModelListener;
-
- /**
- * The root of the model representing the collated resources associated with
- * the JAXB project.
- */
- protected final JaxbContextRoot contextRoot;
-
- /**
- * A pluggable synchronizer that keeps the JAXB
- * project's context model synchronized with its resource model, either
- * synchronously or asynchronously (or not at all). A synchronous synchronizer
- * is the default. For performance reasons, a UI should
- * immediately change this to an asynchronous synchronizer. A synchronous
- * synchronizer can be used when the project is being manipulated by a "batch"
- * (or non-UI) client (e.g. when testing "synchronization"). A null updater
- * can used during tests that do not care whether "synchronization" occur.
- * Clients will need to explicitly configure the synchronizer if they require
- * an asynchronous synchronizer.
- */
- protected volatile Synchronizer contextModelSynchronizer;
- protected volatile boolean synchronizingContextModel = false;
-
- /**
- * A pluggable synchronizer that "updates" the JAXB project, either
- * synchronously or asynchronously (or not at all). A synchronous updater
- * is the default, allowing a newly-constructed JAXB project to be "updated"
- * upon return from the constructor. For performance reasons, a UI should
- * immediately change this to an asynchronous updater. A synchronous
- * updater can be used when the project is being manipulated by a "batch"
- * (or non-UI) client (e.g. when testing the "update" behavior). A null
- * updater can used during tests that do not care whether "synchronization"
- * occur.
- * Clients will need to explicitly configure the updater if they require
- * an asynchronous updater.
- */
- protected volatile CallbackSynchronizer updateSynchronizer;
- protected final CallbackSynchronizer.Listener updateSynchronizerListener;
-
- /**
- * Support for modifying documents shared with the UI.
- */
- protected final ThreadLocalExtendedCommandExecutor modifySharedDocumentCommandExecutor;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJaxbProject(JaxbProject.Config config) {
- super(null); // JPA project is the root of the containment tree
- if ((config.getProject() == null) || (config.getPlatformDefinition() == null)) {
- throw new NullPointerException();
- }
- this.project = config.getProject();
- this.jaxbPlatform = new JaxbPlatformImpl(config.getPlatformDefinition());
-
- this.schemaLibrary = new SchemaLibraryImpl(this);
-
- this.modifySharedDocumentCommandExecutor = this.buildModifySharedDocumentCommandExecutor();
-
- this.resourceModelListener = this.buildResourceModelListener();
- // build the JPA files corresponding to the Eclipse project's files
- InitialResourceProxyVisitor visitor = this.buildInitialResourceProxyVisitor();
- visitor.visitProject(this.project);
-
-// this.externalJavaResourcePersistentTypeCache = this.buildExternalJavaResourcePersistentTypeCache();
-
- this.contextRoot = this.buildContextRoot();
-
- // there *shouldn't* be any changes to the resource model...
- this.setContextModelSynchronizer_(this.buildSynchronousContextModelSynchronizer());
-
- this.updateSynchronizerListener = this.buildUpdateSynchronizerListener();
- // "update" the project before returning
- this.setUpdateSynchronizer_(this.buildSynchronousUpdateSynchronizer());
-
-// // start listening to this cache once the context model has been built
-// // and all the external types are faulted in
-// this.externalJavaResourcePersistentTypeCache.addResourceModelListener(this.resourceModelListener);
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public IResource getResource() {
- return this.project;
- }
-
- protected ThreadLocalExtendedCommandExecutor buildModifySharedDocumentCommandExecutor() {
- return new ThreadLocalExtendedCommandExecutor();
- }
-
- protected InitialResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new InitialResourceProxyVisitor();
- }
-//
-// protected JavaResourcePersistentTypeCache buildExternalJavaResourcePersistentTypeCache() {
-// return new BinaryPersistentTypeCache(this.jpaPlatform.getAnnotationProvider());
-// }
-
- protected JaxbContextRoot buildContextRoot() {
- return this.getFactory().buildContextRoot(this);
- }
-
- // ***** inner class
- protected class InitialResourceProxyVisitor implements IResourceProxyVisitor {
- protected InitialResourceProxyVisitor() {
- super();
- }
- protected void visitProject(IProject p) {
- try {
- p.accept(this, IResource.NONE);
- } catch (CoreException ex) {
- // shouldn't happen - we don't throw any CoreExceptions
- throw new RuntimeException(ex);
- }
- }
- // add a JPA file for every [appropriate] file encountered by the visitor
- public boolean visit(IResourceProxy resource) {
- switch (resource.getType()) {
- case IResource.ROOT : // shouldn't happen
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- AbstractJaxbProject.this.addJaxbFile_((IFile) resource.requestResource());
- return false; // no children
- default :
- return false; // no children
- }
- }
- }
-
-
-// // ********** miscellaneous **********
-//
-// /**
-// * Ignore changes to this collection. Adds can be ignored since they are triggered
-// * by requests that will, themselves, trigger updates (typically during the
-// * update of an object that calls a setter with the newly-created resource
-// * type). Deletes will be accompanied by manual updates.
-// */
-// @Override
-// protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
-// super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
-// nonUpdateAspectNames.add(EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// }
-
-
- // ********** general queries **********
-
- @Override
- public JaxbProject getJaxbProject() {
- return this;
- }
-
- public String getName() {
- return this.project.getName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- public IProject getProject() {
- return this.project;
- }
-
- public IJavaProject getJavaProject() {
- return JavaCore.create(this.project);
- }
-
- @Override
- public JaxbPlatform getPlatform() {
- return this.jaxbPlatform;
- }
-
- public SchemaLibrary getSchemaLibrary() {
- return this.schemaLibrary;
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceCompilationUnit> getCombinedJavaResourceCompilationUnits() {
- return this.getInternalJavaResourceCompilationUnits();
-// return new CompositeIterable<JavaResourceCompilationUnit>(
-// this.getInternalJavaResourceCompilationUnits(),
-// this.getExternalJavaResourceCompilationUnits()
-// );
- }
-
-
- // ********** JAXB files **********
-
- public Iterable<JaxbFile> getJaxbFiles() {
- return new LiveCloneIterable<JaxbFile>(this.jaxbFiles); // read-only
- }
-
- public int getJaxbFilesSize() {
- return this.jaxbFiles.size();
- }
-
- protected Iterable<JaxbFile> getJaxbFiles(final IContentType contentType) {
- return new FilteringIterable<JaxbFile>(this.getJaxbFiles()) {
- @Override
- protected boolean accept(JaxbFile jaxbFile) {
- return jaxbFile.getContentType().isKindOf(contentType);
- }
- };
- }
-
- @Override
- public JaxbFile getJaxbFile(IFile file) {
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- if (jaxbFile.getFile().equals(file)) {
- return jaxbFile;
- }
- }
- return null;
- }
-
- /**
- * Add a JAXB file for the specified file, if appropriate.
- * Return true if a JAXB File was created and added, false otherwise
- */
- protected boolean addJaxbFile(IFile file) {
- JaxbFile jaxbFile = this.addJaxbFile_(file);
- if (jaxbFile != null) {
- this.fireItemAdded(JAXB_FILES_COLLECTION, jaxbFile);
- return true;
- }
- return false;
- }
-
- /**
- * Add a JAXB file for the specified file, if appropriate, without firing
- * an event; useful during construction.
- * Return the new JAXB file, null if it was not created.
- */
- protected JaxbFile addJaxbFile_(IFile file) {
- if (isJavaFile(file)) {
- if (! getJavaProject().isOnClasspath(file)) {
- // a java (.jar or .java) file must be on the Java classpath
- return null;
- }
- }
- else if (! fileResourceLocationIsValid(file)) {
- return null;
- }
-
- JaxbFile jaxbFile = null;
- try {
- jaxbFile = this.getPlatform().buildJaxbFile(this, file);
- }
- catch (Exception e) {
- //log any developer exceptions and don't build a JaxbFile rather
- //than completely failing to build the JaxbProject
- JptJaxbCorePlugin.log(e);
- }
- if (jaxbFile == null) {
- return null;
- }
- jaxbFile.getResourceModel().addResourceModelListener(this.resourceModelListener);
- this.jaxbFiles.add(jaxbFile);
- return jaxbFile;
- }
-
- /* file is .java or .jar */
- protected boolean isJavaFile(IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return contentType != null
- && (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)
- || contentType.isKindOf(JptCommonCorePlugin.JAR_CONTENT_TYPE));
- }
-
- /* (non-java resource) file is in acceptable resource location */
- protected boolean fileResourceLocationIsValid(IFile file) {
- return this.getProjectResourceLocator().resourceLocationIsValid(file.getParent());
- }
-
- protected ProjectResourceLocator getProjectResourceLocator() {
- return (ProjectResourceLocator) this.project.getAdapter(ProjectResourceLocator.class);
- }
-
- /**
- * Remove the JAXB file corresponding to the specified IFile, if it exists.
- * Return true if a JAXB File was removed, false otherwise
- */
- protected boolean removeJaxbFile(IFile file) {
- JaxbFile jaxbFile = this.getJaxbFile(file);
- if (jaxbFile != null) { // a JpaFile is not added for every IFile
- this.removeJaxbFile(jaxbFile);
- return true;
- }
- return false;
- }
-
- /**
- * Stop listening to the JAXB file and remove it.
- */
- protected void removeJaxbFile(JaxbFile jaxbFile) {
- jaxbFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- if ( ! this.removeItemFromCollection(jaxbFile, this.jaxbFiles, JAXB_FILES_COLLECTION)) {
- throw new IllegalArgumentException(jaxbFile.toString());
- }
- }
-
-
-// // ********** external Java resource persistent types (source or binary) **********
-//
-// protected JavaResourcePersistentType buildPersistableExternalJavaResourcePersistentType(String typeName) {
-// IType jdtType = this.findType(typeName);
-// return (jdtType == null) ? null : this.buildPersistableExternalJavaResourcePersistentType(jdtType);
-// }
-//
-// protected IType findType(String typeName) {
-// try {
-// return this.getJavaProject().findType(typeName);
-// } catch (JavaModelException ex) {
-// return null; // ignore exception?
-// }
-// }
-//
-// protected JavaResourcePersistentType buildPersistableExternalJavaResourcePersistentType(IType jdtType) {
-// JavaResourcePersistentType jrpt = this.buildExternalJavaResourcePersistentType(jdtType);
-// return ((jrpt != null) && jrpt.isPersistable()) ? jrpt : null;
-// }
-//
-// protected JavaResourcePersistentType buildExternalJavaResourcePersistentType(IType jdtType) {
-// return jdtType.isBinary() ?
-// this.buildBinaryExternalJavaResourcePersistentType(jdtType) :
-// this.buildSourceExternalJavaResourcePersistentType(jdtType);
-// }
-//
-// protected JavaResourcePersistentType buildBinaryExternalJavaResourcePersistentType(IType jdtType) {
-// return this.externalJavaResourcePersistentTypeCache.addPersistentType(jdtType);
-// }
-//
-// protected JavaResourcePersistentType buildSourceExternalJavaResourcePersistentType(IType jdtType) {
-// JavaResourceCompilationUnit jrcu = this.getExternalJavaResourceCompilationUnit(jdtType.getCompilationUnit());
-// String jdtTypeName = jdtType.getFullyQualifiedName('.'); // JDT member type names use '$'
-// for (Iterator<JavaResourcePersistentType> stream = jrcu.persistentTypes(); stream.hasNext(); ) {
-// JavaResourcePersistentType jrpt = stream.next();
-// if (jrpt.getQualifiedName().equals(jdtTypeName)) {
-// return jrpt;
-// }
-// }
-// // we can get here if the project JRE is removed;
-// // see SourceCompilationUnit#getPrimaryType(CompilationUnit)
-// // bug 225332
-// return null;
-// }
-//
-//
-// // ********** external Java resource persistent types (binary) **********
-//
-// public JavaResourcePersistentTypeCache getExternalJavaResourcePersistentTypeCache() {
-// return this.externalJavaResourcePersistentTypeCache;
-// }
-//
-//
-// // ********** external Java resource compilation units (source) **********
-//
-// public Iterator<JavaResourceCompilationUnit> externalJavaResourceCompilationUnits() {
-// return this.getExternalJavaResourceCompilationUnits().iterator();
-// }
-//
-// protected Iterable<JavaResourceCompilationUnit> getExternalJavaResourceCompilationUnits() {
-// return new LiveCloneIterable<JavaResourceCompilationUnit>(this.externalJavaResourceCompilationUnits); // read-only
-// }
-//
-// public int externalJavaResourceCompilationUnitsSize() {
-// return this.externalJavaResourceCompilationUnits.size();
-// }
-//
-// /**
-// * Return the resource model compilation unit corresponding to the specified
-// * JDT compilation unit. If it does not exist, build it.
-// */
-// protected JavaResourceCompilationUnit getExternalJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// if (jrcu.getCompilationUnit().equals(jdtCompilationUnit)) {
-// // we will get here if the JRCU could not build its persistent type...
-// return jrcu;
-// }
-// }
-// return this.addExternalJavaResourceCompilationUnit(jdtCompilationUnit);
-// }
-//
-// /**
-// * Add an external Java resource compilation unit.
-// */
-// protected JavaResourceCompilationUnit addExternalJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// JavaResourceCompilationUnit jrcu = this.buildJavaResourceCompilationUnit(jdtCompilationUnit);
-// this.addItemToCollection(jrcu, this.externalJavaResourceCompilationUnits, EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// jrcu.addResourceModelListener(this.resourceModelListener);
-// return jrcu;
-// }
-//
-// protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit jdtCompilationUnit) {
-// return new SourceTypeCompilationUnit(
-// jdtCompilationUnit,
-// this.jpaPlatform.getAnnotationProvider(),
-// this.jpaPlatform.getAnnotationEditFormatter(),
-// this.modifySharedDocumentCommandExecutor
-// );
-// }
-//
-// protected boolean removeExternalJavaResourceCompilationUnit(IFile file) {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// if (jrcu.getFile().equals(file)) {
-// this.removeExternalJavaResourceCompilationUnit(jrcu);
-// return true;
-// }
-// }
-// return false;
-// }
-//
-// protected void removeExternalJavaResourceCompilationUnit(JavaResourceCompilationUnit jrcu) {
-// jrcu.removeResourceModelListener(this.resourceModelListener);
-// this.removeItemFromCollection(jrcu, this.externalJavaResourceCompilationUnits, EXTERNAL_JAVA_RESOURCE_COMPILATION_UNITS_COLLECTION);
-// }
-
-
- // ********** context model **********
-
- public JaxbContextRoot getContextRoot() {
- return this.contextRoot;
- }
-
- public Iterable<? extends JavaContextNode> getPrimaryJavaNodes(ICompilationUnit cu) {
- IFile file = getCorrespondingResource(cu);
- if (file == null) {
- return EmptyIterable.instance();
- }
-
- IContentType contentType = PlatformTools.getContentType(file);
- if (contentType == null) {
- return EmptyIterable.instance();
- }
-
- if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- try {
- return new FilteringIterable<JaxbPackageInfo>(
- new TransformationIterable<IPackageDeclaration, JaxbPackageInfo>(
- new ArrayIterable<IPackageDeclaration>(cu.getPackageDeclarations())) {
- @Override
- protected JaxbPackageInfo transform(IPackageDeclaration o) {
- JaxbPackage jaxbPackage = getContextRoot().getPackage(o.getElementName());
- return (jaxbPackage != null) ? jaxbPackage.getPackageInfo() : null;
- }
- },
- NotNullFilter.<JaxbPackageInfo>instance());
- }
- catch (JavaModelException jme) {
- return EmptyIterable.instance();
- }
- }
- else if (contentType.isKindOf(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- try {
- return new FilteringIterable<JaxbType>(
- new TransformationIterable<IType, JaxbType>(
- new ArrayIterable<IType>(cu.getAllTypes())) {
- @Override
- protected JaxbType transform(IType o) {
- JaxbType jaxbType = getContextRoot().getType(o.getFullyQualifiedName('.'));
- return jaxbType;
- }
- },
- NotNullFilter.<JaxbType>instance());
- }
- catch (JavaModelException jme) {
- return EmptyIterable.instance();
- }
- }
-
- return EmptyIterable.instance();
- }
-
- private IFile getCorrespondingResource(ICompilationUnit cu) {
- try {
- return (IFile) cu.getCorrespondingResource();
- }
- catch (JavaModelException ex) {
- JptJaxbCorePlugin.log(ex);
- return null;
- }
- }
-
-
-// // ********** utility **********
-//
-// public IFile getPlatformFile(IPath runtimePath) {
-// return JptCorePlugin.getPlatformFile(this.project, runtimePath);
-// }
-
-
-//
-// /**
-// * If the specified file exists, is significant to the JPA project, and its
-// * content is a "kind of" the specified content type, return the JPA
-// * resource model corresponding to the file; otherwise, return null.
-// */
-// protected JpaResourceModel getResourceModel(IPath runtimePath, IContentType contentType) {
-// IFile file = this.getPlatformFile(runtimePath);
-// return file.exists() ? this.getResourceModel(file, contentType) : null;
-// }
-//
-// /**
-// * If the specified file is significant to the JPA project and its content
-// * is a "kind of" the specified content type, return the JPA resource model
-// * corresponding to the file; otherwise, return null.
-// */
-// protected JpaResourceModel getResourceModel(IFile file, IContentType contentType) {
-// JpaFile jpaFile = this.getJpaFile(file);
-// return (jpaFile == null) ? null : jpaFile.getResourceModel(contentType);
-// }
-
-
- // ********** annotated Java source classes **********
-
- public Iterable<JavaResourceAbstractType> getJavaSourceResourceTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.getInternalJavaSourceResourceTypeSets());
- }
-
- public Iterable<JavaResourceAbstractType> getAnnotatedJavaSourceResourceTypes() {
- return new FilteringIterable<JavaResourceAbstractType>(getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType type) {
- return type.isAnnotated();
- }
- };
- }
-
-// public Iterable<String> getAnnotatedJavaSourceClassNames() {
-// return new TransformationIterable<JavaResourceType, String>(this.getInternalAnnotatedSourceJavaResourceTypes()) {
-// @Override
-// protected String transform(JavaResourceType type) {
-// return type.getQualifiedName();
-// }
-// };
-// }
-
- /*
- * Return the sets of {@link JavaResourceType}s that are represented by java source within this project
- */
- protected Iterable<Iterable<JavaResourceAbstractType>> getInternalJavaSourceResourceTypeSets() {
- return new TransformationIterable<JavaResourceCompilationUnit, Iterable<JavaResourceAbstractType>>(
- this.getInternalJavaResourceCompilationUnits()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourceCompilationUnit compilationUnit) {
- return compilationUnit.getTypes();
- }
- };
- }
-
- protected Iterable<JavaResourceCompilationUnit> getInternalJavaResourceCompilationUnits() {
- return new TransformationIterable<JaxbFile, JavaResourceCompilationUnit>(this.getJavaSourceJaxbFiles()) {
- @Override
- protected JavaResourceCompilationUnit transform(JaxbFile jaxbFile) {
- return (JavaResourceCompilationUnit) jaxbFile.getResourceModel();
- }
- };
- }
-
- /**
- * return JAXB files with Java source "content"
- */
- protected Iterable<JaxbFile> getJavaSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
-
- // ********** Java resource package look-up **********
-
- public Iterable<JavaResourcePackage> getJavaResourcePackages(){
- return new FilteringIterable<JavaResourcePackage>(
- new TransformationIterable<JaxbFile, JavaResourcePackage>(this.getPackageInfoSourceJaxbFiles()) {
- @Override
- protected JavaResourcePackage transform(JaxbFile jaxbFile) {
- return ((JavaResourcePackageInfoCompilationUnit) jaxbFile.getResourceModel()).getPackage();
- }
- }) {
-
- @Override
- protected boolean accept(JavaResourcePackage resourcePackage) {
- return resourcePackage != null;
- }
- };
- }
-
- public JavaResourcePackage getJavaResourcePackage(String packageName) {
- for (JavaResourcePackage jrp : this.getJavaResourcePackages()) {
- if (jrp.getName().equals(packageName)) {
- return jrp;
- }
- }
- return null;
- }
-
- public Iterable<JavaResourcePackage> getAnnotatedJavaResourcePackages() {
- return new FilteringIterable<JavaResourcePackage>(this.getJavaResourcePackages()) {
- @Override
- protected boolean accept(JavaResourcePackage resourcePackage) {
- return resourcePackage.isAnnotated(); // i.e. the package has a valid package annotation
- }
- };
- }
-
- public JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName) {
- JavaResourcePackage jrp = getJavaResourcePackage(packageName);
- return (jrp != null && jrp.isAnnotated()) ? jrp : null;
- }
-
- /**
- * return JPA files with package-info source "content"
- */
- protected Iterable<JaxbFile> getPackageInfoSourceJaxbFiles() {
- return this.getJaxbFiles(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE);
- }
-
-
- // ********** Java resource type look-up **********
-
-
- public JavaResourceAbstractType getJavaResourceType(String typeName) {
- for (JavaResourceAbstractType type : this.getJavaResourceTypes()) {
- if (type.getQualifiedName().equals(typeName)) {
- return type;
- }
- }
- return null;
-// // if we don't have a type already, try to build new one from the project classpath
-// return this.buildPersistableExternalJavaResourcePersistentType(typeName);
- }
-
- public JavaResourceAbstractType getJavaResourceType(String typeName, JavaResourceAbstractType.Kind kind) {
- JavaResourceAbstractType resourceType = getJavaResourceType(typeName);
- if (resourceType == null || resourceType.getKind() != kind) {
- return null;
- }
- return resourceType;
- }
-
- protected Iterable<JavaResourceAbstractType> getJavaResourceTypes() {
- return new CompositeIterable<JavaResourceAbstractType>(this.getJavaResourceTypeSets());
- }
-
- protected Iterable<Iterable<JavaResourceAbstractType>> getJavaResourceTypeSets() {
- return new TransformationIterable<JavaResourceNode.Root, Iterable<JavaResourceAbstractType>>(
- this.getJavaResourceNodeRoots()) {
- @Override
- protected Iterable<JavaResourceAbstractType> transform(JavaResourceNode.Root root) {
- return root.getTypes();
- }
- };
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceNode.Root> getJavaResourceNodeRoots() {
- return new CompositeIterable<JavaResourceNode.Root>(
- this.getInternalJavaResourceCompilationUnits()/*,
- this.getInternalJavaResourcePackageFragmentRoots(),
- this.getExternalJavaResourceCompilationUnits(),
- Collections.singleton(this.externalJavaResourcePersistentTypeCache)*/
- );
- }
-
-
-// // ********** JARs **********
-//
-// // TODO
-// public JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName) {
-//// return this.getJarResourcePackageFragmentRoot(this.convertToPlatformFile(jarFileName));
-// return this.getJavaResourcePackageFragmentRoot(this.getProject().getFile(jarFileName));
-// }
-//
-// protected JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(IFile jarFile) {
-// for (JavaResourcePackageFragmentRoot pfr : this.getInternalJavaResourcePackageFragmentRoots()) {
-// if (pfr.getFile().equals(jarFile)) {
-// return pfr;
-// }
-// }
-// return null;
-// }
-//
-// protected Iterable<JavaResourcePackageFragmentRoot> getInternalJavaResourcePackageFragmentRoots() {
-// return new TransformationIterable<JpaFile, JavaResourcePackageFragmentRoot>(this.getJarJpaFiles()) {
-// @Override
-// protected JavaResourcePackageFragmentRoot transform(JpaFile jpaFile) {
-// return (JavaResourcePackageFragmentRoot) jpaFile.getResourceModel();
-// }
-// };
-// }
-//
-// /**
-// * return JPA files with JAR "content"
-// */
-// protected Iterable<JpaFile> getJarJpaFiles() {
-// return this.getJpaFiles(JptCorePlugin.JAR_CONTENT_TYPE);
-// }
-
-
-
-//
-// // ********** Java source folder names **********
-//
-// public Iterable<String> getJavaSourceFolderNames() {
-// try {
-// return this.getJavaSourceFolderNames_();
-// } catch (JavaModelException ex) {
-// JptCorePlugin.log(ex);
-// return EmptyIterable.instance();
-// }
-// }
-//
-// protected Iterable<String> getJavaSourceFolderNames_() throws JavaModelException {
-// return new TransformationIterable<IPackageFragmentRoot, String>(this.getJavaSourceFolders()) {
-// @Override
-// protected String transform(IPackageFragmentRoot pfr) {
-// try {
-// return this.transform_(pfr);
-// } catch (JavaModelException ex) {
-// return "Error: " + pfr.getPath(); //$NON-NLS-1$
-// }
-// }
-// private String transform_(IPackageFragmentRoot pfr) throws JavaModelException {
-// return pfr.getUnderlyingResource().getProjectRelativePath().toString();
-// }
-// };
-// }
-//
-// protected Iterable<IPackageFragmentRoot> getJavaSourceFolders() throws JavaModelException {
-// return new FilteringIterable<IPackageFragmentRoot>(
-// this.getPackageFragmentRoots(),
-// SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER
-// );
-// }
-//
-// protected static final Filter<IPackageFragmentRoot> SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER =
-// new Filter<IPackageFragmentRoot>() {
-// public boolean accept(IPackageFragmentRoot pfr) {
-// try {
-// return this.accept_(pfr);
-// } catch (JavaModelException ex) {
-// return false;
-// }
-// }
-// private boolean accept_(IPackageFragmentRoot pfr) throws JavaModelException {
-// return pfr.exists() && (pfr.getKind() == IPackageFragmentRoot.K_SOURCE);
-// }
-// };
-//
-// protected Iterable<IPackageFragmentRoot> getPackageFragmentRoots() throws JavaModelException {
-// return new ArrayIterable<IPackageFragmentRoot>(this.getJavaProject().getPackageFragmentRoots());
-// }
-
-
- // **************** jaxb.index resources **********************************
-
- public Iterable<JaxbIndexResource> getJaxbIndexResources() {
- return new TransformationIterable<JaxbFile, JaxbIndexResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE)) {
- @Override
- protected JaxbIndexResource transform(JaxbFile o) {
- return (JaxbIndexResource) o.getResourceModel();
- }
- };
- }
-
- public JaxbIndexResource getJaxbIndexResource(String packageName) {
- for (JaxbIndexResource jir : getJaxbIndexResources()) {
- if (packageName.equals(jir.getPackageName())) {
- return jir;
- }
- }
- return null;
- }
-
-
- // **************** jaxb.properties resources *****************************
-
- public Iterable<JaxbPropertiesResource> getJaxbPropertiesResources() {
- return new TransformationIterable<JaxbFile, JaxbPropertiesResource>(getJaxbFiles(JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE)) {
- @Override
- protected JaxbPropertiesResource transform(JaxbFile o) {
- return (JaxbPropertiesResource) o.getResourceModel();
- }
- };
- }
-
- public JaxbPropertiesResource getJaxbPropertiesResource(String packageName) {
- for (JaxbPropertiesResource jpr : getJaxbPropertiesResources()) {
- if (packageName.equals(jpr.getPackageName())) {
- return jpr;
- }
- }
- return null;
- }
-
-
- // ********** Java events **********
-
- // TODO handle changes to external projects
- public void javaElementChanged(ElementChangedEvent event) {
- this.processJavaDelta(event.getDelta());
- }
-
- /**
- * We recurse back here from {@link #processJavaDeltaChildren(IJavaElementDelta)}.
- */
- protected void processJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- this.processJavaModelDelta(delta);
- break;
- case IJavaElement.JAVA_PROJECT :
- this.processJavaProjectDelta(delta);
- break;
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- this.processJavaPackageFragmentRootDelta(delta);
- break;
- case IJavaElement.PACKAGE_FRAGMENT :
- this.processJavaPackageFragmentDelta(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.processJavaCompilationUnitDelta(delta);
- break;
- default :
- break; // ignore the elements inside a compilation unit
- }
- }
-
- protected void processJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.processJavaDelta(child); // recurse
- }
- }
-
- /**
- * Return whether the specified Java element delta is for a
- * {@link IJavaElementDelta#CHANGED CHANGED}
- * (as opposed to {@link IJavaElementDelta#ADDED ADDED} or
- * {@link IJavaElementDelta#REMOVED REMOVED}) Java element
- * and the specified flag is set.
- * (The delta flags are only significant if the delta
- * {@link IJavaElementDelta#getKind() kind} is
- * {@link IJavaElementDelta#CHANGED CHANGED}.)
- */
- protected boolean deltaFlagIsSet(IJavaElementDelta delta, int flag) {
- return (delta.getKind() == IJavaElementDelta.CHANGED) &&
- BitTools.flagIsSet(delta.getFlags(), flag);
- }
-
- // ***** model
- protected void processJavaModelDelta(IJavaElementDelta delta) {
- // process the Java model's projects
- this.processJavaDeltaChildren(delta);
- }
-
- // ***** project
- protected void processJavaProjectDelta(IJavaElementDelta delta) {
- // process the Java project's package fragment roots
- this.processJavaDeltaChildren(delta);
-
- // a classpath change can have pretty far-reaching effects...
- if (this.classpathHasChanged(delta)) {
- this.rebuild((IJavaProject) delta.getElement());
- }
- }
-
- /**
- * The specified Java project's classpath changed. Rebuild the JPA project
- * as appropriate.
- */
- protected void rebuild(IJavaProject javaProject) {
- // if the classpath has changed, we need to update everything since
- // class references could now be resolved (or not) etc.
- if (javaProject.equals(this.getJavaProject())) {
- this.removeDeadJpaFiles();
- this.synchronizeWithJavaSource(this.getInternalJavaResourceCompilationUnits());
- } else {
- // TODO see if changed project is on our classpath?
- //this.synchronizeWithJavaSource(this.getExternalJavaResourceCompilationUnits());
- }
- }
-
- /**
- * Loop through all our JPA files, remove any that are no longer on the
- * classpath.
- */
- protected void removeDeadJpaFiles() {
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- if (this.jaxbFileIsDead(jaxbFile)) {
- this.removeJaxbFile(jaxbFile);
- }
- }
- }
-
- protected boolean jaxbFileIsDead(JaxbFile jaxbFile) {
- return ! this.jaxbFileIsAlive(jaxbFile);
- }
-
- /**
- * Sometimes (e.g. during tests), when a project has been deleted, we get a
- * Java change event that indicates the Java project is CHANGED (as
- * opposed to REMOVED, which is what typically happens). The event's delta
- * indicates that everything in the Java project has been deleted and the
- * classpath has changed. All entries in the classpath have been removed;
- * but single entry for the Java project's root folder has been added. (!)
- * This means any file in the project is on the Java project's classpath.
- * This classpath change is what triggers us to rebuild the JPA project; so
- * we put an extra check here to make sure the JPA file's resource file is
- * still present.
- * <p>
- * This would not be a problem if Dali received the resource change event
- * <em>before</em> JDT and simply removed the JPA project; but JDT receives
- * the resource change event first and converts it into the problematic
- * Java change event....
- */
- protected boolean jaxbFileIsAlive(JaxbFile jaxbFile) {
- IFile file = jaxbFile.getFile();
- return this.getJavaProject().isOnClasspath(file) &&
- file.exists();
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.JAVA_PROJECT
- */
- protected boolean classpathHasChanged(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED);
- }
-
- protected void synchronizeWithJavaSource(Iterable<JavaResourceCompilationUnit> javaResourceCompilationUnits) {
- for (JavaResourceCompilationUnit javaResourceCompilationUnit : javaResourceCompilationUnits) {
- javaResourceCompilationUnit.synchronizeWithJavaSource();
- }
- }
-
-
- // ***** package fragment root
- protected void processJavaPackageFragmentRootDelta(IJavaElementDelta delta) {
- // process the Java package fragment root's package fragments
- this.processJavaDeltaChildren(delta);
-
- if (this.classpathEntryHasBeenAdded(delta)) {
- // TODO bug 277218
- } else if (this.classpathEntryHasBeenRemoved(delta)) { // should be mutually-exclusive w/added (?)
- // TODO bug 277218
- }
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
- */
- protected boolean classpathEntryHasBeenAdded(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_ADDED_TO_CLASSPATH);
- }
-
- /**
- * pre-condition:
- * delta.getElement().getElementType() == IJavaElement.PACKAGE_FRAGMENT_ROOT
- */
- protected boolean classpathEntryHasBeenRemoved(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_REMOVED_FROM_CLASSPATH);
- }
-
- // ***** package fragment
- protected void processJavaPackageFragmentDelta(IJavaElementDelta delta) {
- // process the java package fragment's compilation units
- this.processJavaDeltaChildren(delta);
- }
-
- // ***** compilation unit
- protected void processJavaCompilationUnitDelta(IJavaElementDelta delta) {
- if (this.javaCompilationUnitDeltaIsRelevant(delta)) {
- ICompilationUnit compilationUnit = (ICompilationUnit) delta.getElement();
- for (JavaResourceCompilationUnit jrcu : this.getCombinedJavaResourceCompilationUnits()) {
- if (jrcu.getCompilationUnit().equals(compilationUnit)) {
- jrcu.synchronizeWithJavaSource();
- // TODO ? this.resolveJavaTypes(); // might have new member types now...
- break; // there *shouldn't* be any more...
- }
- }
- }
- // ignore the java compilation unit's children
- }
-
- protected boolean javaCompilationUnitDeltaIsRelevant(IJavaElementDelta delta) {
- // ignore changes to/from primary working copy - no content has changed;
- // and make sure there are no other flags set that indicate *both* a
- // change to/from primary working copy *and* content has changed
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return false;
- }
-
- // ignore java notification for ADDED or REMOVED;
- // these are handled via resource notification
- return delta.getKind() == IJavaElementDelta.CHANGED;
- }
-
-
- // ********** validation **********
-
- public Iterable<IMessage> getValidationMessages(IReporter reporter) {
- List<IMessage> messages = new ArrayList<IMessage>();
- this.validate(messages, reporter);
- return new SnapshotCloneIterable<IMessage>(messages);
- }
-
- protected void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
-
- getSchemaLibrary().refreshAllSchemas();
-
- validateLibraryProvider(messages);
- validateSchemaLibrary(messages);
- this.contextRoot.validate(messages, reporter);
- }
-
- protected void validateLibraryProvider(List<IMessage> messages) {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(getProject());
- }
- catch (CoreException ce) {
- // fall through
- JptJaxbCorePlugin.log(ce);
- }
-
- IProjectFacetVersion facetVersion = facetedProject.getInstalledVersion(JaxbFacet.FACET);
- LibraryInstallDelegate lid = new LibraryInstallDelegate(facetedProject, facetVersion);
- ILibraryProvider lp = lid.getLibraryProvider();
- if (lid.getLibraryProviderOperationConfig() instanceof JaxbLibraryProviderInstallOperationConfig) {
- ((JaxbLibraryProviderInstallOperationConfig) lid.getLibraryProviderOperationConfig()).setJaxbPlatform(getPlatform().getDescription());
- }
- if (! lp.isEnabledFor(facetedProject, facetVersion) || ! lid.validate().isOK()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT_INVALID_LIBRARY_PROVIDER,
- this));
- }
- lid.dispose();
- }
-
- protected void validateSchemaLibrary(List<IMessage> messages) {
- this.schemaLibrary.validate(messages);
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.contextModelSynchronizer.stop();
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- this.schemaLibrary.dispose();
- // the XML resources are held indefinitely by the WTP translator framework,
- // so we better remove our listener or the JAXB project will not be GCed
- for (JaxbFile jaxbFile : this.getJaxbFiles()) {
- jaxbFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- }
- }
-
-
-
- // ********** resource model listener **********
-
- protected JptResourceModelListener buildResourceModelListener() {
- return new DefaultResourceModelListener();
- }
-
- protected class DefaultResourceModelListener
- implements JptResourceModelListener
- {
- protected DefaultResourceModelListener() {
- super();
- }
-
- public void resourceModelChanged(JptResourceModel jpaResourceModel) {
-// String msg = Thread.currentThread() + " resource model change: " + jpaResourceModel;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- AbstractJaxbProject.this.synchronizeContextModel(jpaResourceModel);
- }
-
- public void resourceModelReverted(JptResourceModel jpaResourceModel) {
-// IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
-// AbstractJaxbProject.this.removeJaxbFile(file);
-// AbstractJaxbProject.this.addJaxbFile(file);
- }
-
- public void resourceModelUnloaded(JptResourceModel jpaResourceModel) {
-// IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
-// AbstractJaxbProject.this.removeJaxbFile(file);
- }
- }
-
- protected void synchronizeContextModel(@SuppressWarnings("unused") JptResourceModel jpaResourceModel) {
- this.synchronizeContextModel();
- }
-
-
- // ********** resource events **********
-
- // TODO need to do the same thing for external projects and compilation units
- public void projectChanged(IResourceDelta delta) {
- if (delta.getResource().equals(this.getProject())) {
- this.internalProjectChanged(delta);
- } else {
-// this.externalProjectChanged(delta);
- }
- }
-
- protected void internalProjectChanged(IResourceDelta delta) {
- ResourceDeltaVisitor resourceDeltaVisitor = this.buildInternalResourceDeltaVisitor();
- resourceDeltaVisitor.visitDelta(delta);
- // at this point, if we have added and/or removed JpaFiles, an "update" will have been triggered;
- // any changes to the resource model during the "resolve" will trigger further "updates";
- // there should be no need to "resolve" external Java types (they can't have references to
- // the internal Java types)
- if (resourceDeltaVisitor.encounteredSignificantChange()) {
- this.resolveInternalJavaTypes();
- }
- }
-
- protected ResourceDeltaVisitor buildInternalResourceDeltaVisitor() {
- return new ResourceDeltaVisitor() {
- @Override
- public boolean fileChangeIsSignificant(IFile file, int deltaKind) {
- return AbstractJaxbProject.this.synchronizeJaxbFiles(file, deltaKind);
- }
- };
- }
-
- /**
- * Internal resource delta visitor callback.
- * Return true if a JaxbFile was either added or removed.
- */
- protected boolean synchronizeJaxbFiles(IFile file, int deltaKind) {
- switch (deltaKind) {
- case IResourceDelta.ADDED :
- return this.addJaxbFile(file);
- case IResourceDelta.REMOVED :
- return this.removeJaxbFile(file);
- case IResourceDelta.CHANGED :
- return this.checkForChangedFileContent(file);
- case IResourceDelta.ADDED_PHANTOM :
- break; // ignore
- case IResourceDelta.REMOVED_PHANTOM :
- break; // ignore
- default :
- break; // only worried about added/removed/changed files
- }
-
- return false;
- }
-
- protected boolean checkForChangedFileContent(IFile file) {
- JaxbFile jaxbFile = this.getJaxbFile(file);
- if (jaxbFile == null) {
- // the file might have changed its content to something that we are interested in
- return this.addJaxbFile(file);
- }
-
- if (jaxbFile.getContentType().equals(PlatformTools.getContentType(file))) {
- // content has not changed - ignore
- return false;
- }
-
- // the content type changed, we need to build a new JPA file
- // (e.g. the schema of an orm.xml file changed from JPA to EclipseLink)
- this.removeJaxbFile(jaxbFile);
- this.addJaxbFile(file);
- return true; // at the least, we have removed a JPA file
- }
-
- protected void resolveInternalJavaTypes() {
- for (JavaResourceCompilationUnit jrcu : this.getInternalJavaResourceCompilationUnits()) {
- jrcu.resolveTypes();
- }
- }
-
-// protected void externalProjectChanged(IResourceDelta delta) {
-// if (this.getJavaProject().isOnClasspath(delta.getResource())) {
-// ResourceDeltaVisitor resourceDeltaVisitor = this.buildExternalResourceDeltaVisitor();
-// resourceDeltaVisitor.visitDelta(delta);
-// // force an "update" here since adding and/or removing an external Java type
-// // will only trigger an "update" if the "resolve" causes something in the resource model to change
-// if (resourceDeltaVisitor.encounteredSignificantChange()) {
-// this.update();
-// this.resolveExternalJavaTypes();
-// this.resolveInternalJavaTypes();
-// }
-// }
-// }
-//
-// protected ResourceDeltaVisitor buildExternalResourceDeltaVisitor() {
-// return new ResourceDeltaVisitor() {
-// @Override
-// public boolean fileChangeIsSignificant(IFile file, int deltaKind) {
-// return AbstractJaxbProject.this.synchronizeExternalFiles(file, deltaKind);
-// }
-// };
-// }
-//
-// /**
-// * external resource delta visitor callback
-// * Return true if an "external" Java resource compilation unit
-// * was added or removed.
-// */
-// protected boolean synchronizeExternalFiles(IFile file, int deltaKind) {
-// switch (deltaKind) {
-// case IResourceDelta.ADDED :
-// return this.externalFileAdded(file);
-// case IResourceDelta.REMOVED :
-// return this.externalFileRemoved(file);
-// case IResourceDelta.CHANGED :
-// break; // ignore
-// case IResourceDelta.ADDED_PHANTOM :
-// break; // ignore
-// case IResourceDelta.REMOVED_PHANTOM :
-// break; // ignore
-// default :
-// break; // only worried about added/removed/changed files
-// }
-//
-// return false;
-// }
-//
-// protected boolean externalFileAdded(IFile file) {
-// IContentType contentType = PlatformTools.getContentType(file);
-// if (contentType == null) {
-// return false;
-// }
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return true;
-// }
-// if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return true;
-// }
-// return false;
-// }
-//
-// protected boolean externalFileRemoved(IFile file) {
-// IContentType contentType = PlatformTools.getContentType(file);
-// if (contentType == null) {
-// return false;
-// }
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return this.removeExternalJavaResourceCompilationUnit(file);
-// }
-// if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return this.externalJavaResourcePersistentTypeCache.removePersistentTypes(file);
-// }
-// return false;
-// }
-//
-// protected void resolveExternalJavaTypes() {
-// for (JavaResourceCompilationUnit jrcu : this.getExternalJavaResourceCompilationUnits()) {
-// jrcu.resolveTypes();
-// }
-// }
-
- // ***** resource delta visitors
- /**
- * add or remove a JPA file for every [appropriate] file encountered by the visitor
- */
- protected abstract class ResourceDeltaVisitor implements IResourceDeltaVisitor {
- protected boolean encounteredSignificantChange = false;
-
- protected ResourceDeltaVisitor() {
- super();
- }
-
- protected void visitDelta(IResourceDelta delta) {
- try {
- delta.accept(this);
- } catch (CoreException ex) {
- // shouldn't happen - we don't throw any CoreExceptions
- throw new RuntimeException(ex);
- }
- }
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- this.fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (this.fileChangeIsSignificant(file, deltaKind)) {
- this.encounteredSignificantChange = true;
- }
- }
-
- protected abstract boolean fileChangeIsSignificant(IFile file, int deltaKind);
-
- /**
- * Return whether the visitor encountered some sort of "significant"
- * change while traversing the IResourceDelta
- * (e.g. a JPA file was added or removed).
- */
- protected boolean encounteredSignificantChange() {
- return this.encounteredSignificantChange;
- }
-
- }
-
-
- // ********** support for modifying documents shared with the UI **********
-
- public void setThreadLocalModifySharedDocumentCommandExecutor(ExtendedCommandExecutor commandExecutor) {
- this.modifySharedDocumentCommandExecutor.set(commandExecutor);
- }
-
- public ExtendedCommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
-
- // ********** synchronize context model with resource model **********
-
- public Synchronizer getContextModelSynchronizer() {
- return this.contextModelSynchronizer;
- }
-
- public void setContextModelSynchronizer(Synchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.contextModelSynchronizer.stop();
- this.setContextModelSynchronizer_(synchronizer);
- }
-
- protected void setContextModelSynchronizer_(Synchronizer synchronizer) {
- this.contextModelSynchronizer = synchronizer;
- this.contextModelSynchronizer.start();
- }
-
- /**
- * Delegate to the context model synchronizer so clients can configure how
- * synchronizations occur.
- */
- public void synchronizeContextModel() {
- this.synchronizingContextModel = true;
- this.contextModelSynchronizer.synchronize();
- this.synchronizingContextModel = false;
-
- // There are some changes to the resource model that will not change
- // the existing context model and trigger an update (e.g. adding an
- // @Entity annotation when the the JPA project is automatically
- // discovering annotated classes); so we explicitly execute an update
- // here to discover those changes.
- this.update();
- }
-
- /**
- * Called by the context model synchronizer.
- */
- public IStatus synchronizeContextModel(IProgressMonitor monitor) {
- this.contextRoot.synchronizeWithResourceModel();
- return Status.OK_STATUS;
- }
-
- public void synchronizeContextModelAndWait() {
- Synchronizer temp = this.contextModelSynchronizer;
- this.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
- this.synchronizeContextModel();
- this.setContextModelSynchronizer(temp);
- }
-
-
- // ********** default context model synchronizer (synchronous) **********
-
- protected Synchronizer buildSynchronousContextModelSynchronizer() {
- return new SynchronousSynchronizer(this.buildSynchronousContextModelSynchronizerCommand());
- }
-
- protected Command buildSynchronousContextModelSynchronizerCommand() {
- return new SynchronousContextModelSynchronizerCommand();
- }
-
- protected class SynchronousContextModelSynchronizerCommand
- implements Command
- {
- public void execute() {
- AbstractJaxbProject.this.synchronizeContextModel(new NullProgressMonitor());
- }
- }
-
-
- // ********** project "update" **********
-
- public CallbackSynchronizer getUpdateSynchronizer() {
- return this.updateSynchronizer;
- }
-
- public void setUpdateSynchronizer(CallbackSynchronizer synchronizer) {
- if (synchronizer == null) {
- throw new NullPointerException();
- }
- this.updateSynchronizer.stop();
- this.updateSynchronizer.removeListener(this.updateSynchronizerListener);
- this.setUpdateSynchronizer_(synchronizer);
- }
-
- protected void setUpdateSynchronizer_(CallbackSynchronizer synchronizer) {
- this.updateSynchronizer = synchronizer;
- this.updateSynchronizer.addListener(this.updateSynchronizerListener);
- this.updateSynchronizer.start();
- }
-
- @Override
- public void stateChanged() {
- super.stateChanged();
- this.update();
- }
-
- /**
- * The JAXB project's state has changed, "update" those parts of the
- * JAXB project that are dependent on other parts of the JAXB project.
- * <p>
- * Delegate to the update synchronizer so clients can configure how
- * updates occur.
- * <p>
- * Ignore any <em>updates</em> that occur while we are synchronizing
- * the context model with the resource model because we will <em>update</em>
- * the context model at the completion of the <em>sync</em>. This is really
- * only useful for synchronous <em>syncs</em> and <em>updates</em>; since
- * the job scheduling rules will prevent the <em>sync</em> and
- * <em>update</em> jobs from running concurrently.
- *
- * @see #updateAndWait()
- */
- protected void update() {
- if ( ! this.synchronizingContextModel) {
- this.updateSynchronizer.synchronize();
- }
- }
-
- /**
- * Called by the update synchronizer.
- */
- public IStatus update(IProgressMonitor monitor) {
- this.contextRoot.update();
- return Status.OK_STATUS;
- }
-
- /**
- * This is the callback used by the update synchronizer to notify the JAXB
- * project that the "update" has quiesced (i.e. the "update" has completed
- * and there are no outstanding requests for further "updates").
- */
- public void updateQuiesced() {
- //nothing yet
- }
-
- public void updateAndWait() {
- CallbackSynchronizer temp = this.updateSynchronizer;
- this.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
- this.update();
- this.setUpdateSynchronizer(temp);
- }
-
-
- // ********** default update synchronizer (synchronous) **********
-
- protected CallbackSynchronizer buildSynchronousUpdateSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildSynchronousUpdateSynchronizerCommand());
- }
-
- protected Command buildSynchronousUpdateSynchronizerCommand() {
- return new SynchronousUpdateSynchronizerCommand();
- }
-
- protected class SynchronousUpdateSynchronizerCommand
- implements Command
- {
- public void execute() {
- AbstractJaxbProject.this.update(new NullProgressMonitor());
- }
- }
-
-
- // ********** update synchronizer listener **********
-
- protected CallbackSynchronizer.Listener buildUpdateSynchronizerListener() {
- return new UpdateSynchronizerListener();
- }
-
- protected class UpdateSynchronizerListener
- implements CallbackSynchronizer.Listener
- {
- public void synchronizationQuiesced(CallbackSynchronizer synchronizer) {
- AbstractJaxbProject.this.updateQuiesced();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java
deleted file mode 100644
index 574ad14301..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbFile.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-/**
- * The transition between a JAXB project and the resource model associated
- * with a file.
- * Hold the associated root structure nodes, which are hooks to the
- * context model.
- */
-public class GenericJaxbFile
- extends AbstractJaxbNode
- implements JaxbFile
-{
- /**
- * typically a .java or .xml file.
- */
- protected final IFile file;
-
- /**
- * cache the content type - if the content type changes, the JAXB project
- * will throw out the JAXB file and build a new one
- */
- protected final IContentType contentType;
-
- /**
- * the resource model corresponding to the file
- */
- protected final JptResourceModel resourceModel;
-
-// /**
-// * the root structure (context model) nodes corresponding to the resource
-// * model
-// */
-// protected final Hashtable<Object, JpaStructureNode> rootStructureNodes;
-
-
- // ********** construction **********
-
- public GenericJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel) {
- super(jaxbProject);
- this.file = file;
- this.contentType = contentType;
- this.resourceModel = resourceModel;
-// this.rootStructureNodes = new Hashtable<Object, JpaStructureNode>();
- }
-//
-// /**
-// * Changes to ROOT_STRUCTURE_NODES_COLLECTION do not need to trigger a
-// * project update. Only the UI cares about the root structure nodes.
-// * If a project update is allowed to happen, an infinite loop will result
-// * if any java class is specified in more than one location in the
-// * persistence unit.
-// */
-// @Override
-// protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
-// super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
-// nonUpdateAspectNames.add(ROOT_STRUCTURE_NODES_COLLECTION);
-// }
-
-
- // ********** file **********
-
- public IFile getFile() {
- return this.file;
- }
-
- public IContentType getContentType() {
- return this.contentType;
- }
-
- public JptResourceModel getResourceModel() {
- return this.resourceModel;
- }
-
- public JptResourceModel getResourceModel(IContentType ct) {
- return this.contentType.isKindOf(ct) ? this.resourceModel : null;
- }
-
-
-// // ********** root structure nodes **********
-//
-// public Iterator<JpaStructureNode> rootStructureNodes() {
-// return this.getRootStructureNodes().iterator();
-// }
-//
-// protected Iterable<JpaStructureNode> getRootStructureNodes() {
-// return new LiveCloneIterable<JpaStructureNode>(this.rootStructureNodes.values());
-// }
-//
-// public int rootStructureNodesSize() {
-// return this.rootStructureNodes.size();
-// }
-//
-// public void addRootStructureNode(Object key, JpaStructureNode rootStructureNode) {
-// JpaStructureNode old = this.rootStructureNodes.put(key, rootStructureNode);
-// if (rootStructureNode != old) {
-// if (old != null) {
-// this.fireItemRemoved(ROOT_STRUCTURE_NODES_COLLECTION, old);
-// }
-// this.fireItemAdded(ROOT_STRUCTURE_NODES_COLLECTION, rootStructureNode);
-// }
-// }
-//
-// public void removeRootStructureNode(Object key) {
-// this.fireItemRemoved(ROOT_STRUCTURE_NODES_COLLECTION, this.rootStructureNodes.remove(key));
-// }
-//
-// public JpaStructureNode getStructureNode(int textOffset) {
-// for (JpaStructureNode rootNode : this.getRootStructureNodes()) {
-// JpaStructureNode node = rootNode.getStructureNode(textOffset);
-// if (node != null) {
-// return node;
-// }
-// }
-// return null;
-// }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.file);
- sb.append('[');
- sb.append(this.contentType.getName());
- sb.append(']');
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java
deleted file mode 100644
index 1b81017142..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbProject.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-/**
- * Not much different from the abstract JAXB project.
- */
-public class GenericJaxbProject
- extends AbstractJaxbProject
-{
-
- // ********** constructor/initialization **********
-
- public GenericJaxbProject(JaxbProject.Config config) {
- super(config);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
deleted file mode 100644
index df776cf336..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaElementAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-/**
- * Factory to build Dali adapters for an {@link IJavaElement}:<ul>
- * <li>{@link JaxbPlatformDescription}
- * </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
- */
-public class JavaElementAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JaxbPlatformDescription.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IJavaElement) {
- return this.getAdapter((IJavaElement) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IJavaElement javaElement, Class<?> adapterType) {
- if (adapterType == JaxbPlatformDescription.class) {
- return javaElement.getResource().getAdapter(JaxbPlatformDescription.class);
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
deleted file mode 100644
index 82ca5ea88d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-/**
- * Java package-info.java source code
- */
-public class JavaPackageInfoResourceModelProvider
- implements JaxbResourceModelProvider
-{
- // singleton
- private static final JaxbResourceModelProvider INSTANCE = new JavaPackageInfoResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaPackageInfoResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
- ICompilationUnit compilationUnit = JavaCore.createCompilationUnitFrom(file);
- try {
- if (compilationUnit.getPackageDeclarations().length > 0){
- return new SourcePackageInfoCompilationUnit(
- compilationUnit,
- jaxbProject.getPlatform().getAnnotationProvider(),
- jaxbProject.getPlatform().getAnnotationEditFormatter(),
- jaxbProject.getModifySharedDocumentCommandExecutor());
- }
- //ignore package-info placed in default package as
- //it doesn't have package declaration and can't hold annotations
- return null;
- } catch (JavaModelException e) {
- JptJaxbCorePlugin.log(e);
- // Ignore -- project is in a bad state. This will get recalled if necessary
- return null;
- }
- }
-
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
deleted file mode 100644
index 4066f112c8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-
-/**
- * Java source code
- */
-public class JavaResourceModelProvider
- implements JaxbResourceModelProvider
-{
- // singleton
- private static final JaxbResourceModelProvider INSTANCE = new JavaResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return new SourceTypeCompilationUnit(
- JavaCore.createCompilationUnitFrom(file),
- jaxbProject.getPlatform().getAnnotationProvider(),
- jaxbProject.getPlatform().getAnnotationEditFormatter(),
- jaxbProject.getModifySharedDocumentCommandExecutor()
- );
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
deleted file mode 100644
index 1ddbcdc20f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JptJaxbCoreMessages.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali JAXB Core.
- */
-public class JptJaxbCoreMessages {
-
- public static String CONTEXT_MODEL_SYNC_JOB_NAME;
- public static String UPDATE_JOB_NAME;
- public static String PREFERENCES_FLUSH_JOB_NAME;
-
- public static String ClassesGenerator_generatingClasses;
- public static String ClassesGenerator_generatingClassesTask;
-
- public static String JaxbFacetConfig_validatePlatformNotSpecified;
- public static String JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion;
-
- public static String JreLibraryValidator_invalidPlatform;
- public static String JreLibraryValidator_invalidJavaFacet;
- public static String JreLibraryValidator_invalidJavaLibrary;
-
- public static String UserLibraryValidator_incompatibleJavaFacet;
- public static String UserLibraryValidator_incompatibleJavaLibrary;
-
- public static String SchemaGenerator_creatingJAXBPropertiesFileTask;
-
- public static String XML_ATTRIBUTE_DESC;
- public static String XML_ELEMENT_DESC;
- public static String XML_TYPE_DESC;
- public static String SUBSTITUTION_HEAD_DESC;
-
- public static String XML_ELEMENT_DECL__SCOPE;
-
-
- private static final String BUNDLE_NAME = "jpt_jaxb_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJaxbCoreMessages.class;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
-
- private JptJaxbCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
deleted file mode 100644
index 85857f5824..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/ResourceAdapterFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-/**
- * Factory to build Dali adapters for an {@link IResource}:<ul>
- * <li>{@link JaxbPlatformDescription}
- * </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
- */
-public class ResourceAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JaxbPlatformDescription.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IResource) {
- return this.getAdapter((IResource) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IResource resource, Class<?> adapterType) {
- if (adapterType == JaxbPlatformDescription.class) {
- return this.getJaxbPlatformDescription(resource);
- }
- return null;
- }
-
- private JaxbPlatformDescription getJaxbPlatformDescription(IResource resource) {
- return JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform(JptJaxbCorePlugin.getJaxbPlatformId(resource.getProject()));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java
deleted file mode 100644
index a60839602d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaEntryImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
-
-
-public class SchemaEntryImpl
- implements SchemaEntry {
-
- private final String location;
-
- private String namespace;
-
- private XSDResourceImpl schemaResource;
-
- private boolean unloaded = false;
-
- private SchemaResourceAdapter schemaResourceAdapter;
-
-
- SchemaEntryImpl(String location) {
- this.location = location;
- this.schemaResourceAdapter = new SchemaResourceAdapter();
- refresh();
- }
-
-
- public String getLocation() {
- return this.location;
- }
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public boolean isLoaded() {
- return this.schemaResource != null;
- }
-
- public XsdSchema getXsdSchema(String namespace) {
- if (this.unloaded) {
- refresh();
- this.unloaded = false;
- }
-
- if (! StringTools.stringsAreEqual(this.namespace, namespace)) {
- return null;
- }
-
- if (this.schemaResource != null) {
- return XsdUtil.getSchema(this.schemaResource.getSchema());
- }
-
- return null;
- }
-
- public void refresh() {
- unload();
-
- String resolvedUri = XsdUtil.getResolvedUri(this.location);
- if (resolvedUri == null) {
- return;
- }
-
- XSDSchema schema = XsdUtil.buildXSDModel(resolvedUri);
- XSDResourceImpl schemaResource = (schema == null) ? null : (XSDResourceImpl) schema.eResource();
-
- if (schemaResource != null) {
- schemaResource.eAdapters().add(this.schemaResourceAdapter);
- this.schemaResource = schemaResource;
- String namespace = schema.getTargetNamespace();
- this.namespace = (namespace == null) ? "" : namespace;
- }
- }
-
- void unload() {
- if (this.schemaResource != null) {
- this.schemaResource.eAdapters().remove(this.schemaResourceAdapter);
- }
- this.unloaded = true;
- this.schemaResource = null;
- }
-
- void dispose() {
- if (this.schemaResource != null) {
- this.schemaResource.eAdapters().remove(this.schemaResourceAdapter);
- }
- }
-
-
-
- private class SchemaResourceAdapter
- extends AdapterImpl {
-
- @Override
- public void notifyChanged(Notification msg) {
- if (msg.getFeatureID(Resource.class) == Resource.RESOURCE__IS_LOADED
- && msg.getNewBooleanValue() == false) {
- SchemaEntryImpl.this.unload();
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
deleted file mode 100644
index 66c88c7232..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SchemaLibraryImpl.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.SchemaLibrary;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class SchemaLibraryImpl
- implements SchemaLibrary {
-
- private JaxbProject project;
-
- private final List<SchemaEntryImpl> schemaEntries;
-
- private final Map<String, SchemaEntryImpl> impliedEntries;
-
-
- SchemaLibraryImpl(JaxbProject project) {
- this.project = project;
- this.schemaEntries = new Vector<SchemaEntryImpl>();
- this.impliedEntries = new Hashtable<String, SchemaEntryImpl>();
- readProjectPreferences();
- }
-
-
- public List<SchemaEntry> getSchemaEntries() {
- return Collections.<SchemaEntry>unmodifiableList(this.schemaEntries);
- }
-
- public List<String> getSchemaLocations() {
- return Collections.unmodifiableList(
- CollectionTools.list(
- new TransformationIterable<SchemaEntry, String>(this.schemaEntries) {
- @Override
- protected String transform(SchemaEntry o) {
- return o.getLocation();
- }
- }));
- }
-
- public void setSchemaLocations(List<String> schemaLocations) {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- entry.dispose();
- }
- this.schemaEntries.clear();
- JptJaxbCorePlugin.setSchemaLocations(this.project.getProject(), schemaLocations);
- readProjectPreferences();
- }
-
- public XsdSchema getSchema(String namespace) {
- for (SchemaEntry entry : this.schemaEntries) {
- if (StringTools.stringsAreEqual(namespace, entry.getNamespace())) {
- return entry.getXsdSchema(namespace);
- }
- }
-
- if (! this.impliedEntries.containsKey(namespace)) {
- if (! StringTools.stringsAreEqual(XsdUtil.getResolvedUri(namespace), namespace)) {
- // the namespace itself resolves to a location. add it as an implied entry
- this.impliedEntries.put(namespace, new SchemaEntryImpl(namespace));
- }
- else {
- return null;
- }
- }
-
- return this.impliedEntries.get(namespace).getXsdSchema(namespace);
- }
-
- protected void readProjectPreferences() {
- List<String> schemas = JptJaxbCorePlugin.getSchemaLocations(this.project.getProject());
- for (String schemaLocation : schemas) {
- SchemaEntryImpl entry = new SchemaEntryImpl(schemaLocation);
- this.schemaEntries.add(entry);
- }
- }
-
- public void refreshSchema(String namespace) {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- if (StringTools.stringsAreEqual(namespace, entry.getNamespace())) {
- entry.refresh();
- }
- }
- }
-
- public void refreshAllSchemas() {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- entry.refresh();
- }
- }
-
- void dispose() {
- for (SchemaEntryImpl entry : this.schemaEntries) {
- entry.dispose();
- }
- for (SchemaEntryImpl entry : this.impliedEntries.values()) {
- entry.dispose();
- }
-
- this.schemaEntries.clear();
- this.impliedEntries.clear();
- }
-
- public void validate(List<IMessage> messages) {
- Bag<String> namespaces = new HashBag<String>();
-
- for (SchemaEntry entry : this.schemaEntries) {
- namespaces.add(entry.getNamespace());
-
- if (! entry.isLoaded()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT__UNRESOLVED_SCHEMA,
- new String[] { entry.getLocation() },
- this.project));
- }
- }
-
- for (Iterator<String> stream = namespaces.uniqueIterator(); stream.hasNext(); ) {
- String namespace = stream.next();
- if (namespaces.count(namespace) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PROJECT__DUPLICATE_NAMESPACE,
- new String[] { namespace },
- this.project));
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java
deleted file mode 100644
index f159ded880..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/SimpleJaxbProjectConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-/**
- * Straightforward implementation of the JAXB project config.
- */
-public class SimpleJaxbProjectConfig
- implements JaxbProject.Config {
-
- private IProject project;
-
- private JaxbPlatformDefinition platformDefinition;
-
-
- public SimpleJaxbProjectConfig() {
- super();
- }
-
-
- public IProject getProject() {
- return this.project;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
- public JaxbPlatformDefinition getPlatformDefinition() {
- return this.platformDefinition;
- }
-
- public void setPlatformDefinition(JaxbPlatformDefinition platformDefinition) {
- this.platformDefinition = platformDefinition;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.project.getName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
deleted file mode 100644
index 5e270b27f4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextNode.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbNode;
-
-public abstract class AbstractJaxbContextNode
- extends AbstractJaxbNode
- implements JaxbContextNode
-{
-
- // ********** constructor **********
-
- protected AbstractJaxbContextNode(JaxbNode parent) {
- super(parent);
- }
-
-
- // ********** synchronize/update **********
-
- public void synchronizeWithResourceModel() {
- // NOP
- }
-
- /**
- * convenience method
- */
- protected void synchronizeNodesWithResourceModel(Iterable<? extends JaxbContextNode> nodes) {
- for (JaxbContextNode node : nodes) {
- node.synchronizeWithResourceModel();
- }
- }
-
- public void update() {
- // NOP
- }
-
- /**
- * convenience method
- */
- protected void updateNodes(Iterable<? extends JaxbContextNode> nodes) {
- for (JaxbContextNode node : nodes) {
- node.update();
- }
- }
-
- // ********** containment hierarchy **********
-
- /**
- * covariant override
- */
- @Override
- public JaxbContextNode getParent() {
- return (JaxbContextNode) super.getParent();
- }
-
- /**
- * Overridden in:<ul>
- * <li>{@link org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode#getResourceType() AbstractJavaContextNode}
- * </ul>
- */
- public JptResourceType getResourceType() {
- return getParent().getResourceType();
- }
-
- /**
- * Overridden in:<ul>
- * <li>{@link org.eclipse.jpt.jaxb.core.internal.context.GenericContextRoot#getContextRoot() GenericContextRoot}
- * to return itself>
- * </ul>
- */
- public JaxbContextRoot getContextRoot() {
- return getParent().getContextRoot();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java
deleted file mode 100644
index 373f603335..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/AbstractJaxbContextRoot.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * the context model root
- */
-public abstract class AbstractJaxbContextRoot
- extends AbstractJaxbContextNode
- implements JaxbContextRoot {
-
- /* This object has no parent, so it must point to the JAXB project explicitly. */
- protected final JaxbProject jaxbProject;
-
- /* The map of package name to JaxbPackage objects */
- protected final Map<String, JaxbPackage> packages;
-
- /* The map of class name to JaxbType objects */
- protected final Map<String, JaxbType> types;
-
-
- public AbstractJaxbContextRoot(JaxbProject jaxbProject) {
- super(null); // the JAXB project is not really a "parent"...
- if (jaxbProject == null) {
- throw new NullPointerException();
- }
- this.jaxbProject = jaxbProject;
- this.packages = new Hashtable<String, JaxbPackage>();
- this.types = new Hashtable<String, JaxbType>();
- initialize();
- }
-
-
- @Override
- public JaxbContextRoot getContextRoot() {
- return this;
- }
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- protected void initialize() {
-
- // process packages with annotations first
- for (String pkg : calculateInitialPackageNames()) {
- this.packages.put(pkg, buildPackage(pkg));
- }
-
- // keep set of total types for remaining package initialization
- Set<String> totalTypeNames = new HashSet<String>();
-
- // process types with annotations and in jaxb.index files
- for (JavaResourceAbstractType resourceType : calculateInitialTypes()) {
- totalTypeNames.add(resourceType.getQualifiedName());
- addType_(buildType(resourceType));
- }
-
- // once all classes have been processed, add packages
- for (String pkg : calculatePackageNames(totalTypeNames)) {
- if (! this.packages.containsKey(pkg)) {
- this.packages.put(pkg, buildPackage(pkg));
- }
- }
-
-// // keep a master list of all types that we've processed so we don't process them again
-// final Set<String> totalTypes = CollectionTools.<String>set();
-//
-// // keep an running list of types that we need to scan for further referenced types
-// final Set<String> typesToScan = CollectionTools.<String>set();
-//
-// // process packages with annotations first
-// for (String pkg : calculateInitialPackageNames()) {
-// this.packages.put(pkg, buildPackage(pkg));
-// }
-//
-// // calculate initial types (annotated or listed in jaxb.index files)
-// final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialTypes();
-//
-// // while there are resource types to process or types to scan, continue to do so
-// while (! resourceTypesToProcess.isEmpty() || ! typesToScan.isEmpty()) {
-// for (JavaResourceAbstractType resourceType : new SnapshotCloneIterable<JavaResourceAbstractType>(resourceTypesToProcess)) {
-// String className = resourceType.getQualifiedName();
-// totalTypes.add(className);
-// typesToScan.add(className);
-// addType_(buildType(resourceType));
-// resourceTypesToProcess.remove(resourceType);
-// }
-//
-// for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
-// JaxbType jaxbType = getType(typeToScan);
-// if (jaxbType != null) {
-// for (String referencedTypeName : jaxbType.getReferencedXmlTypeNames()) {
-// if (! totalTypes.contains(referencedTypeName)) {
-// JavaResourceAbstractType referencedType = getJaxbProject().getJavaResourceType(referencedTypeName);
-// if (referencedType != null) {
-// resourceTypesToProcess.add(referencedType);
-// }
-// }
-// }
-// }
-// typesToScan.remove(typeToScan);
-// }
-// }
-//
-// // once all classes have been processed, add packages
-// for (String pkg : calculatePackageNames(totalTypes)) {
-// if (! this.packages.containsKey(pkg)) {
-// this.packages.put(pkg, buildPackage(pkg));
-// }
-// }
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- for (JaxbPackage each : getPackages()) {
- each.synchronizeWithResourceModel();
- }
- for (JaxbType each : getTypes()) {
- each.synchronizeWithResourceModel();
- }
- }
-
- @Override
- public void update() {
- super.update();
-
- // keep a master list of these so that objects are updated only once
- final Set<String> packagesToUpdate = CollectionTools.<String>set();
- final Set<String> typesToUpdate = CollectionTools.<String>set();
-
- // keep a (shrinking) running list of these so that we know which ones we do eventually need to remove
- final Set<String> packagesToRemove = CollectionTools.set(this.packages.keySet());
- final Set<String> typesToRemove = CollectionTools.set(this.types.keySet());
-
- // keep a master list of all types that we've processed so we don't process them again
- final Set<String> totalTypes = CollectionTools.<String>set();
-
- // keep an running list of types that we need to scan for further referenced types
- final Set<String> typesToScan = CollectionTools.<String>set();
-
- // process packages with annotations first
- for (String pkg : calculateInitialPackageNames()) {
- if (this.packages.containsKey(pkg)) {
- packagesToUpdate.add(pkg);
- packagesToRemove.remove(pkg);
- }
- else {
- this.addPackage(this.buildPackage(pkg));
- }
- }
-
- // calculate initial types (annotated or listed in jaxb.index files)
- final Set<JavaResourceAbstractType> resourceTypesToProcess = calculateInitialTypes();
-
- // store set of types that are referenced (and should therefore be default mapped)
- final Set<JavaResourceAbstractType> referencedTypes = new HashSet<JavaResourceAbstractType>();
-
- // while there are resource types to process or types to scan, continue to do so
- while (! resourceTypesToProcess.isEmpty() || ! typesToScan.isEmpty()) {
- for (JavaResourceAbstractType resourceType : new SnapshotCloneIterable<JavaResourceAbstractType>(resourceTypesToProcess)) {
- String className = resourceType.getQualifiedName();
- typesToRemove.remove(className);
- totalTypes.add(className);
- typesToScan.add(className);
- processType(resourceType, typesToUpdate, referencedTypes.contains(resourceType));
- resourceTypesToProcess.remove(resourceType);
- }
-
- for (String typeToScan : new SnapshotCloneIterable<String>(typesToScan)) {
- JaxbType jaxbType = getType(typeToScan);
- if (jaxbType != null) {
- for (String referencedTypeName : jaxbType.getReferencedXmlTypeNames()) {
- if (! StringTools.stringIsEmpty(referencedTypeName) && ! totalTypes.contains(referencedTypeName)) {
- JavaResourceAbstractType referencedType = getJaxbProject().getJavaResourceType(referencedTypeName);
- if (referencedType != null) {
- resourceTypesToProcess.add(referencedType);
- referencedTypes.add(referencedType);
- }
- }
- }
- }
- typesToScan.remove(typeToScan);
- }
- }
-
- // once all classes have been processed, add packages
- for (String pkg : calculatePackageNames(totalTypes)) {
- if (this.packages.containsKey(pkg)) {
- packagesToUpdate.add(pkg);
- packagesToRemove.remove(pkg);
- }
- else {
- this.addPackage(this.buildPackage(pkg));
- }
- }
-
- for (String packageToUpdate : packagesToUpdate) {
- this.packages.get(packageToUpdate).update();
- }
-
- for (String typeToUpdate : typesToUpdate) {
- this.types.get(typeToUpdate).update();
- }
-
- for (String packageToRemove : packagesToRemove) {
- removePackage(packageToRemove);
- }
-
- for (String typeToRemove : typesToRemove) {
- removeType(typeToRemove);
- }
- }
-
- /**
- * calculate set of packages that can be determined purely by presence of package annotations
- */
- protected Set<String> calculateInitialPackageNames() {
- return CollectionTools.set(
- new TransformationIterable<JavaResourcePackage, String>(
- getJaxbProject().getAnnotatedJavaResourcePackages()) {
- @Override
- protected String transform(JavaResourcePackage o) {
- return o.getName();
- }
- });
- }
-
- /**
- * calculate set of packages that can be determined from type names
- */
- protected Set<String> calculatePackageNames(Set<String> typeNames) {
- Set<String> packageNames = CollectionTools.<String>set();
- for (String typeName : typeNames) {
- JaxbType jaxbType = this.types.get(typeName);
- if (jaxbType != null) {
- packageNames.add(jaxbType.getPackageName());
- }
- }
- return packageNames;
- }
-
- /*
- * Calculate set of initial types
- * This should be:
- * - all resource types with @XmlType, @XmlRootElement, or @XmlJavaTypeAdapter
- * - all resource classes with @XmlRegistry
- * - all resource enums with @XmlEnum
- * - all types listed in jaxb.index files.
- */
- protected Set<JavaResourceAbstractType> calculateInitialTypes() {
- Set<JavaResourceAbstractType> set = CollectionTools.set(
- new FilteringIterable<JavaResourceAbstractType>(
- getJaxbProject().getJavaSourceResourceTypes()) {
- @Override
- protected boolean accept(JavaResourceAbstractType o) {
- if (o.getKind() == JavaResourceAbstractType.Kind.TYPE) {
- if (o.getAnnotation(JAXB.XML_REGISTRY) != null) {
- return true;
- }
- }
- if (o.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- if (o.getAnnotation(JAXB.XML_ENUM) != null) {
- return true;
- }
- }
- return o.getAnnotation(JAXB.XML_TYPE) != null
- || o.getAnnotation(JAXB.XML_ROOT_ELEMENT) != null
- || o.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER) > 0;
- }
- });
- CollectionTools.addAll(
- set,
- new FilteringIterable<JavaResourceAbstractType>(
- new TransformationIterable<String, JavaResourceAbstractType>(
- new CompositeIterable<String>(
- new TransformationIterable<JaxbIndexResource, Iterable<String>>(getJaxbProject().getJaxbIndexResources()) {
- @Override
- protected Iterable<String>transform(JaxbIndexResource o) {
- return o.getFullyQualifiedClassNames();
- }
- })) {
- @Override
- protected JavaResourceAbstractType transform(String o) {
- return getJaxbProject().getJavaResourceType(o);
- }
- },
- NotNullFilter.<JavaResourceAbstractType>instance()));
- return set;
- }
-
- protected void processType(JavaResourceAbstractType resourceType, Set<String> typesToUpdate, boolean defaultMapped) {
- JaxbType.Kind jaxbTypeKind = calculateJaxbTypeKind(resourceType);
- String className = resourceType.getQualifiedName();
-
- if (this.types.containsKey(className)) {
- JaxbType type = this.types.get(className);
- if (type.getKind() == jaxbTypeKind) {
- typesToUpdate.add(className);
- type.setDefaultMapped(defaultMapped);
- return;
- }
- else {
- this.removeType(className); // this will remove a type of another kind
- }
- }
-
- JaxbType type = buildType(resourceType);
- type.setDefaultMapped(defaultMapped);
- this.addType(type);
- }
-
- protected JaxbType.Kind calculateJaxbTypeKind(JavaResourceAbstractType resourceType) {
- if (resourceType.getKind() == JavaResourceAbstractType.Kind.ENUM) {
- return JaxbType.Kind.ENUM;
- }
- // else is of kind TYPE
- else {
- return JaxbType.Kind.CLASS;
- }
- }
-
- protected JaxbType buildType(JavaResourceAbstractType resourceType) {
- JaxbType.Kind kind = calculateJaxbTypeKind(resourceType);
- if (kind == JaxbType.Kind.ENUM) {
- return buildJaxbEnum((JavaResourceEnum) resourceType);
- }
- else {
- return buildJaxbClass((JavaResourceType) resourceType);
- }
- }
-
-
- // ***** AbstractJaxbNode overrides *****
-
- @Override
- public JaxbProject getJaxbProject() {
- return this.jaxbProject;
- }
-
- @Override
- public IResource getResource() {
- return this.getProject();
- }
-
- protected IProject getProject() {
- return this.jaxbProject.getProject();
- }
-
-
- // ***** packages *****
-
- public Iterable<JaxbPackage> getPackages() {
- return new LiveCloneIterable<JaxbPackage>(this.packages.values());
- }
-
- public int getPackagesSize() {
- return this.packages.size();
- }
-
- public JaxbPackage getPackage(String packageName) {
- for (JaxbPackage jaxbPackage : this.getPackages()) {
- if (StringTools.stringsAreEqual(jaxbPackage.getName(), packageName)) {
- return jaxbPackage;
- }
- }
- return null;
- }
-
- protected JaxbPackage addPackage(JaxbPackage contextPackage) {
- if (this.packages.containsKey(contextPackage.getName())) {
- throw new IllegalArgumentException("Package with that name already exists."); //$NON-NLS-1$
- }
- this.packages.put(contextPackage.getName(), contextPackage);
- fireItemAdded(PACKAGES_COLLECTION, contextPackage);
- return contextPackage;
- }
-
- protected void removePackage(JaxbPackage contextPackage) {
- this.removePackage(contextPackage.getName());
- }
-
- protected void removePackage(String packageName) {
- if (! this.packages.containsKey(packageName)) {
- throw new IllegalArgumentException("No package with that name exists."); //$NON-NLS-1$
- }
- JaxbPackage removedPackage = this.packages.remove(packageName);
- fireItemRemoved(PACKAGES_COLLECTION, removedPackage);
- }
-
- protected JaxbPackage buildPackage(String packageName) {
- return this.getFactory().buildPackage(this, packageName);
- }
-
- protected boolean isEmpty(JaxbPackage jaxbPackage) {
- return jaxbPackage.isEmpty();
- }
-
-
- // ***** types *****
-
- public Iterable<JaxbType> getTypes() {
- return new LiveCloneIterable<JaxbType>(this.types.values());
- }
-
- public int getTypesSize() {
- return this.types.size();
- }
-
- public JaxbType getType(String typeName) {
- return typeName == null ? null : this.types.get(typeName);
- }
-
- protected void addType_(JaxbType type) {
- this.types.put(type.getFullyQualifiedName(), type);
- }
-
- protected void addType(JaxbType type) {
- if (this.types.containsKey(type.getFullyQualifiedName())) {
- throw new IllegalArgumentException("Type with that name already exists."); //$NON-NLS-1$
- }
- addType_(type);
- fireItemAdded(TYPES_COLLECTION, type);
- }
-
- protected void removeType(JaxbType type) {
- removeType(type.getFullyQualifiedName());
- }
-
- protected void removeType(String typeName) {
- if (! this.types.containsKey(typeName)) {
- throw new IllegalArgumentException("No type with that name exists."); //$NON-NLS-1$
- }
- JaxbType removedType = this.types.remove(typeName);
- fireItemRemoved(TYPES_COLLECTION, removedType);
- }
-
- public Iterable<JaxbType> getTypes(final JaxbPackage jaxbPackage) {
- return new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getPackageName().equals(jaxbPackage.getName());
- }
- };
- }
-
- public Iterable<JaxbClass> getClasses() {
- return new SubIterableWrapper<JaxbType, JaxbClass>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.CLASS;
- }
- });
- }
-
- public Iterable<JaxbClass> getClasses(JaxbPackage jaxbPackage) {
- return new SubIterableWrapper<JaxbType, JaxbClass>(
- new FilteringIterable<JaxbType>(getTypes(jaxbPackage)) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.CLASS;
- }
- });
- }
-
- public Iterable<JaxbEnum> getEnums() {
- return new SubIterableWrapper<JaxbType, JaxbEnum>(
- new FilteringIterable<JaxbType>(getTypes()) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.ENUM;
- }
- });
- }
-
- public Iterable<JaxbEnum> getEnums(JaxbPackage jaxbPackage) {
- return new SubIterableWrapper<JaxbType, JaxbEnum>(
- new FilteringIterable<JaxbType>(getTypes(jaxbPackage)) {
- @Override
- protected boolean accept(JaxbType o) {
- return o.getKind() == JaxbType.Kind.ENUM;
- }
- });
- }
-
-
- protected JaxbClass buildJaxbClass(JavaResourceType resourceType) {
- return this.getFactory().buildJaxbClass(this, resourceType);
- }
-
- protected JaxbEnum buildJaxbEnum(JavaResourceEnum resourceEnum) {
- return this.getFactory().buildJaxbEnum(this, resourceEnum);
- }
-
- public Iterable<XmlRegistry> getXmlRegistries(JaxbPackage jaxbPackage) {
- return new FilteringIterable<XmlRegistry>(
- new TransformationIterable<JaxbClass, XmlRegistry>(getClasses(jaxbPackage)) {
- @Override
- protected XmlRegistry transform(JaxbClass o) {
- return o.getXmlRegistry();
- }
- },
- NotNullFilter.INSTANCE);
- }
-
- public JaxbTypeMapping getTypeMapping(String typeName) {
- JaxbType type = getType(typeName);
- return (type == null) ? null : type.getMapping();
- }
-
- public JaxbClassMapping getClassMapping(String typeName) {
- JaxbType type = getType(typeName);
- return (type == null || (type.getKind() != JaxbType.Kind.CLASS)) ?
- null : ((JaxbClass) type).getMapping();
- }
-
-
- @Override
- public void stateChanged() {
- super.stateChanged();
- // forward to JAXB project
- this.jaxbProject.stateChanged();
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- for (JaxbPackage pkg : this.packages.values()) {
- pkg.validate(messages, reporter);
- }
- for (JaxbType type : this.types.values()) {
- type.validate(messages, reporter);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
deleted file mode 100644
index fe52fc03e0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericContextRoot.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-
-
-public class GenericContextRoot
- extends AbstractJaxbContextRoot {
-
- public GenericContextRoot(JaxbProject jaxbProject) {
- super(jaxbProject);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
deleted file mode 100644
index 5869fee34f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericPackage
- extends AbstractJaxbContextNode
- implements JaxbPackage {
-
- protected final String name;
-
- protected JaxbPackageInfo packageInfo;
-
-
- public GenericPackage(JaxbContextRoot parent, String name) {
- super(parent);
- this.name = name;
- JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
- if (jrp != null) {
- this.packageInfo = buildPackageInfo(jrp);
- }
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- if (this.packageInfo != null) {
- this.packageInfo.synchronizeWithResourceModel();
- }
- }
-
- //Building/removing of the packageInfo is in the update because this is dependent
- //on a JaxbFile being added/removed which only causes an update of the model.
- @Override
- public void update() {
- super.update();
- JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
- if (jrp == null) {
- this.setPackageInfo_(null);
- }
- else {
- if (this.packageInfo == null) {
- this.setPackageInfo_(this.buildPackageInfo(jrp));
- }
- else {
- this.packageInfo.update();
- }
- }
- }
-
-
- // **************** name **************************************************
-
- public String getName() {
- return this.name;
- }
-
-
- // **************** package info ******************************************
-
- public JaxbPackageInfo getPackageInfo() {
- return this.packageInfo;
- }
-
- protected void setPackageInfo_(JaxbPackageInfo packageInfo) {
- JaxbPackageInfo old = this.packageInfo;
- this.packageInfo = packageInfo;
- firePropertyChanged(PACKAGE_INFO_PROPERTY, old, this.packageInfo);
- }
-
- protected JaxbPackageInfo buildPackageInfo(JavaResourcePackage resourcePackage) {
- return getFactory().buildJavaPackageInfo(this, resourcePackage);
- }
-
- public boolean isEmpty() {
- return getPackageInfo() == null && getRegistry() == null;
- }
-
- public XmlRegistry getRegistry() {
- Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(this);
- if (CollectionTools.isEmpty(registries)) {
- return null;
- }
- return CollectionTools.get(registries, 0);
- }
-
-
- // **************** misc **************************************************
-
- public String getNamespace() {
- return (getPackageInfo() == null) ? "" : getPackageInfo().getXmlSchema().getNamespace();
- }
-
- public XmlNsForm getAttributeFormDefault() {
- return (getPackageInfo() == null) ? XmlNsForm.UNSET : getPackageInfo().getXmlSchema().getAttributeFormDefault();
- }
-
- public XmlNsForm getElementFormDefault() {
- return (getPackageInfo() == null) ? XmlNsForm.UNSET : getPackageInfo().getXmlSchema().getElementFormDefault();
- }
-
- public XsdSchema getXsdSchema() {
- return getJaxbProject().getSchemaLibrary().getSchema(getNamespace());
- }
-
-
- // **************** validation ********************************************
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
-
- if (getJaxbProject().getSchemaLibrary().getSchema(getNamespace()) == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.PACKAGE_NO_SCHEMA_FOR_NAMESPACE,
- new String[] {getNamespace(), this.name},
- this));
- }
-
- if (this.packageInfo != null) {
- this.packageInfo.validate(messages, reporter);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
deleted file mode 100644
index c918a9e0ad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageAdapterFactory.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class JaxbPackageAdapterFactory
- implements IAdapterFactory {
-
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JaxbPackage.class };
-
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IPackageFragment) {
- return getAdapter((IPackageFragment) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IPackageFragment packageFragment, Class<?> adapterType) {
- if (adapterType == JaxbPackage.class) {
- return getJaxbPackage(packageFragment);
- }
- return null;
- }
-
- private JaxbPackage getJaxbPackage(IPackageFragment packageFragment) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(packageFragment.getJavaProject().getProject());
- if (jaxbProject == null) {
- return null;
- }
- return jaxbProject.getContextRoot().getPackage(packageFragment.getElementName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java
deleted file mode 100644
index 348517bbb1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/JaxbPackageTester.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-
-public class JaxbPackageTester
- extends PropertyTester {
-
- public static final String HAS_PACKAGE_INFO = "hasPackageInfo"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof JaxbPackage) {
- return test((JaxbPackage) receiver, property, expectedValue);
- }
- return false;
- }
-
- private boolean test(JaxbPackage jaxbPackage, String property, Object expectedValue) {
- if (property.equals(HAS_PACKAGE_INFO)) {
- boolean hasPackageInfo = jaxbPackage.getJaxbProject().getJavaResourcePackage(jaxbPackage.getName()) != null;
- return Tools.valuesAreEqual(hasPackageInfo, expectedValue);
- }
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java
deleted file mode 100644
index 690bd62843..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAdaptableAttributeMapping.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlAdaptableMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaAdaptableAttributeMapping<A extends Annotation>
- extends AbstractJavaAttributeMapping<A>
- implements XmlAdaptableMapping {
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
-
- public AbstractJavaAdaptableAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlJavaTypeAdapter();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlJavaTypeAdapter();
- }
-
-
- // ***** XmlJavaTypeAdapter *****
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) getJavaResourceAttribute().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- XmlJavaTypeAdapter xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- setXmlJavaTypeAdapter_(null);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaAttributeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER) > 0) {
- return (XmlJavaTypeAdapterAnnotation) getJavaResourceAttribute().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- return null;
- }
-
- protected void initializeXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.synchronizeWithResourceModel();
- }
- else {
- setXmlJavaTypeAdapter_(buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.update();
- }
- }
-
-
- // ***** XmlAdapter *****
-
- public XmlAdapter getXmlAdapter() {
- // see if there is an xml adapter specified on this attribute
- if (this.xmlJavaTypeAdapter != null) {
- return this.xmlJavaTypeAdapter.getXmlAdapter();
- }
-
- String boundTypeName = getBoundTypeName();
-
- // see if there is an xml adapter specified on the type
- JaxbType boundType = getContextRoot().getType(boundTypeName);
- if (boundType != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = boundType.getXmlJavaTypeAdapter();
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
-
- // see if there is an xml adapter on the package
- JaxbPackage pkg = getJaxbClassMapping().getJaxbType().getJaxbPackage();
- JaxbPackageInfo pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = pkgInfo.getXmlJavaTypeAdapter(boundTypeName);
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
-
- // see if there is an xml adapter on the *type's* package
- JavaResourceAbstractType resourceType = getJaxbProject().getJavaResourceType(boundTypeName);
- if (resourceType != null) {
- pkg = getContextRoot().getPackage(resourceType.getPackageName());
- pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- XmlJavaTypeAdapter xmlJavaTypeAdapter = pkgInfo.getXmlJavaTypeAdapter(boundTypeName);
- if (xmlJavaTypeAdapter != null) {
- return xmlJavaTypeAdapter.getXmlAdapter();
- }
- }
- }
-
- return null;
- }
-
-
- // ***** misc *****
-
- @Override
- public String getValueTypeName() {
- XmlAdapter xmlAdapter = getXmlAdapter();
- return (xmlAdapter == null) ? super.getValueTypeName() : xmlAdapter.getValueType();
- }
-
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java
deleted file mode 100644
index 1539aec6dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-
-public abstract class AbstractJavaAttributeMapping<A extends Annotation>
- extends AbstractJavaContextNode
- implements JaxbAttributeMapping {
-
- protected boolean default_;
-
- protected AbstractJavaAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.default_ = this.buildDefault();
- }
-
-
- public JaxbClassMapping getClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncDefault();
- }
-
-
- // ********** annotation **********
-
- @SuppressWarnings("unchecked")
- public A getAnnotation() {
- return (A) getJavaResourceAttribute().getAnnotation(getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- /**
- * This method should only be called when an annotation *must* be present (such as when setting fields on it).
- * For most mappings, this is equivalent to #getAnnotation(), but for default mappings (such as @XmlElement)
- * an annotation will be added if none currently exists.
- */
- public A getOrCreateAnnotation() {
- A annotation = getAnnotation();
- if (annotation == null) {
- getPersistentAttribute().setMappingKey(getKey());
- annotation = getAnnotation();
- if (annotation == null) {
- throw new IllegalStateException("missing annotation: " + this); //$NON-NLS-1$
- }
- }
- return annotation;
- }
-
-
- // ********** default **********
-
- public boolean isDefault() {
- return this.default_;
- }
-
- protected void setDefault(boolean default_) {
- boolean old = this.default_;
- this.default_ = default_;
- this.firePropertyChanged(DEFAULT_PROPERTY, old, default_);
- }
-
- public void syncDefault() {
- this.setDefault(this.buildDefault());
- }
-
- protected boolean buildDefault() {
- return this.getAnnotation() == null;
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation() == null ? getJavaResourceAttribute().getNameTextRange(astRoot) : getAnnotation().getTextRange(astRoot);
- }
-
-
- // ********** misc **********
-
- public JaxbPersistentAttribute getPersistentAttribute() {
- return (JaxbPersistentAttribute) super.getParent();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getPersistentAttribute().getJavaResourceAttribute();
- }
-
- public String getBoundTypeName() {
- return getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public String getValueTypeName() {
- return getBoundTypeName();
- }
-
- public String getDataTypeName() {
- return getValueTypeName();
- }
-
- /**
- * Return the expected schema type associated with the data type
- */
- public XsdTypeDefinition getDataTypeXsdTypeDefinition() {
- String dataType = getDataTypeName();
- if (StringTools.stringIsEmpty(dataType)) {
- return null;
- }
-
- JaxbPackage pkg = getJaxbPackage();
- JaxbPackageInfo pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- for (XmlSchemaType schemaType : pkgInfo.getXmlSchemaTypes()) {
- if (dataType.equals(schemaType.getFullyQualifiedType())) {
- return schemaType.getXsdTypeDefinition();
- }
- }
- }
-
- JaxbTypeMapping jaxbTypeMapping = getContextRoot().getTypeMapping(dataType);
- if (jaxbTypeMapping != null) {
- return jaxbTypeMapping.getXsdTypeDefinition();
- }
-
- String builtInType = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(dataType);
- if (builtInType != null) {
- return XsdUtil.getSchemaForSchema().getTypeDefinition(builtInType);
- }
-
- return null;
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return new SingleElementIterable<String>(getValueTypeName());
- }
-
- /* default impl */
- public boolean isParticleMapping() {
- return false;
- }
-
- /* default impl */
- public boolean isTransient() {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
deleted file mode 100644
index 135d71ba06..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-
-public abstract class AbstractJavaAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- protected AbstractJavaAttributeMappingDefinition() {
- super();
- }
-
- /**
- * Default implementation. Override if the mapping definition needs to do more analysis.
- */
- public boolean isSpecified(JaxbPersistentAttribute persistentAttribute) {
- return persistentAttribute.getJavaResourceAttribute().getAnnotation(getAnnotationName())
- != null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
deleted file mode 100644
index bcf8327607..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaContextNode.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaContextNode
- extends AbstractJaxbContextNode
- implements JavaContextNode {
-
- // **************** constructor *******************************************
-
- protected AbstractJavaContextNode(JaxbNode parent) {
- super(parent);
- }
-
-
- @Override
- public JptResourceType getResourceType() {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
- // **************** content assist ****************************************
-
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- public abstract TextRange getValidationTextRange(CompilationUnit astRoot);
-
- /**
- * All subclass implementations {@link #validate(List, CompilationUnit))}
- * should be preceded by a "super" call to this method
- */
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java
deleted file mode 100644
index d3edefc11d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaElementQName.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaElementQName
- extends AbstractJavaQName {
-
- public AbstractJavaElementQName(JavaContextNode parent, AbstractJavaQName.AnnotationProxy proxy) {
- super(parent, proxy);
- }
-
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- protected abstract JaxbPersistentAttribute getPersistentAttribute();
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- protected abstract XmlElementWrapper getElementWrapper();
-
- @Override
- public String getDefaultName() {
- return getPersistentAttribute().getJavaResourceAttribute().getName();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType == null) {
- return EmptyIterable.instance();
- }
-
- XmlElementWrapper elementWrapper = getElementWrapper();
-
- if (elementWrapper == null) {
- return xsdType.getElementNameProposals(getNamespace(), filter);
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement != null) {
- return xsdWrapperElement.getElementNameProposals(getNamespace(), filter);
- }
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage != null && jaxbPackage.getElementFormDefault() == XmlNsForm.QUALIFIED) ?
- getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType == null) {
- return;
- }
-
- XsdElementDeclaration resolvedXsdElement = null;
-
- XmlElementWrapper elementWrapper = getElementWrapper();
-
- if (elementWrapper == null) {
- resolvedXsdElement = xsdType.getElement(getNamespace(), getName());
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement == null) {
- // there will be a separate message for unresolved wrapper element
- // no need to also have a message for the nested element
- return;
- }
- resolvedXsdElement = xsdWrapperElement.getElement(getNamespace(), getName());
- }
-
- if (resolvedXsdElement == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
deleted file mode 100644
index 3412c96970..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaQName
- extends AbstractJavaContextNode
- implements JaxbQName {
-
- protected final AnnotationProxy proxy;
-
- protected String specifiedNamespace;
-
- protected String specifiedName;
-
-
- public AbstractJavaQName(JavaContextNode parent, AnnotationProxy proxy) {
- super(parent);
- this.proxy = proxy;
- this.specifiedNamespace = getAnnotationNamespace();
- this.specifiedName = getAnnotationName();
- }
-
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedNamespace_(getAnnotationNamespace());
- setSpecifiedName_(getAnnotationName());
- }
-
-
- protected abstract JaxbPackage getJaxbPackage();
-
- protected final XsdSchema getXsdSchema() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getXsdSchema();
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- if (StringTools.stringIsEmpty(getSpecifiedNamespace()) // namespace="" is actually interpreted as unspecified by JAXB tools
- || StringTools.stringsAreEqual(getSpecifiedNamespace(), JAXB.DEFAULT_STRING)) {
- return getDefaultNamespace();
- }
- return getSpecifiedNamespace();
- }
-
- public abstract String getDefaultNamespace();
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String newSpecifiedNamespace) {
- setAnnotationNamespace(newSpecifiedNamespace);
- setSpecifiedNamespace_(newSpecifiedNamespace);
- }
-
- protected void setSpecifiedNamespace_(String newSpecifiedNamespace) {
- String oldNamespace = this.specifiedNamespace;
- this.specifiedNamespace = newSpecifiedNamespace;
- firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, oldNamespace, newSpecifiedNamespace);
- }
-
- protected void setAnnotationNamespace(String newNamespace) {
- this.proxy.setNamespace(newNamespace);
- }
-
- protected String getAnnotationNamespace() {
- return this.proxy.getNamespace();
- }
-
-
- // ***** name *****
-
- public String getName() {
- if (getSpecifiedName() == null
- || StringTools.stringsAreEqual(getSpecifiedName(), JAXB.DEFAULT_STRING)) {
- return getDefaultName();
- }
- return getSpecifiedName();
- }
-
- public abstract String getDefaultName();
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- setAnnotationName(newSpecifiedName);
- setSpecifiedName_(newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String old = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, newSpecifiedName);
- }
-
- protected void setAnnotationName(String newName) {
- this.proxy.setName(newName);
- }
-
- protected String getAnnotationName() {
- return this.proxy.getName();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.proxy.namespaceTouches(pos, astRoot)) {
- return getNamespaceProposals(filter);
- }
-
- if (this.proxy.nameTouches(pos, astRoot)) {
- return getNameProposals(filter);
- }
-
- return EmptyIterable.instance();
- }
-
- protected abstract Iterable<String> getNamespaceProposals(Filter<String> filter);
-
- protected abstract Iterable<String> getNameProposals(Filter<String> filter);
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getParent().getValidationTextRange(astRoot);
- }
-
- protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) {
- return (textRange != null) ? textRange : getParent().getValidationTextRange(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNamespaceTextRange(astRoot), astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getTextRange(this.proxy.getNameTextRange(astRoot), astRoot);
- }
-
- /**
- * e.g. "XML element"
- */
- protected String getReferencedComponentTypeDescription() {
- // default impl
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateName(messages, reporter, astRoot);
-
- if (! StringTools.stringIsEmpty(getName())) {
- validateReference(messages, reporter, astRoot);
- }
- }
-
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__MISSING_NAME,
- new String[] { getReferencedComponentTypeDescription() },
- this,
- getNameTextRange(astRoot)));
- }
- }
-
- protected abstract void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- protected IMessage getUnresolveSchemaComponentMessage(CompilationUnit astRoot) {
- return DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__UNRESOLVED_COMPONENT,
- new String[] { getReferencedComponentTypeDescription(), getNamespace(), getName() },
- this,
- getNameTextRange(astRoot));
- }
-
-
- public interface AnnotationProxy {
-
- String getNamespace();
-
- void setNamespace(String namespace);
-
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- String getName();
-
- void setName(String name);
-
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
- TextRange getNameTextRange(CompilationUnit astRoot);
- }
-
-
- /**
- * represents a {@link QNameAnnotation}
- */
- public static abstract class AbstractQNameAnnotationProxy
- implements AnnotationProxy {
-
- protected abstract QNameAnnotation getAnnotation(boolean createIfNull);
-
- public String getNamespace() {
- QNameAnnotation annotation = getAnnotation(false);
- return annotation == null ? null : annotation.getNamespace();
- }
-
- public void setNamespace(String newSpecifiedNamespace) {
- getAnnotation(true).setNamespace(newSpecifiedNamespace);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.namespaceTouches(pos, astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNamespaceTextRange(astRoot);
- }
-
- public String getName() {
- QNameAnnotation annotation = getAnnotation(false);
- return annotation == null ? null : annotation.getName();
- }
-
- public void setName(String newSpecifiedName) {
- getAnnotation(true).setName(newSpecifiedName);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? false : annotation.nameTouches(pos, astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- QNameAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNameTextRange(astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java
deleted file mode 100644
index 2b702eea08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaType.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaType
- extends AbstractJavaContextNode
- implements JaxbType {
-
- protected final JavaResourceAbstractType resourceType;
-
- protected JaxbTypeMapping mapping;
-
- protected boolean defaultMapped = false;
-
- protected XmlJavaTypeAdapter xmlJavaTypeAdapter;
-
-
- protected AbstractJavaType(JaxbContextNode parent, JavaResourceAbstractType resourceType) {
- super(parent);
- this.resourceType = resourceType;
- initMapping();
- initXmlJavaTypeAdapter();
- }
-
-
- // ***** overrides *****
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncMapping();
- syncXmlJavaTypeAdapter();
- }
-
- @Override
- public void update() {
- super.update();
- updateMapping();
- updateXmlJavaTypeAdapter();
- }
-
-
- // ***** mapping *****
-
- public JaxbTypeMapping getMapping() {
- return this.mapping;
- }
-
- protected void setMapping_(JaxbTypeMapping newMapping) {
- JaxbTypeMapping old = this.mapping;
- this.mapping = newMapping;
- firePropertyChanged(MAPPING_PROPERTY, old, newMapping);
- }
-
- protected abstract JaxbTypeMapping buildMapping();
-
- protected void initMapping() {
- if (isDefaultMapped() || isSpecifiedMapped()) {
- this.mapping = buildMapping();
- }
- }
-
- protected void syncMapping() {
- if (this.mapping != null) {
- this.mapping.synchronizeWithResourceModel();
- }
- }
-
- protected void updateMapping() {
- boolean isMapped = isDefaultMapped() || isSpecifiedMapped();
- if (isMapped) {
- if (this.mapping != null) {
- this.mapping.update();
- }
- else {
- setMapping_(buildMapping());
- }
- }
- else if (this.mapping != null) {
- setMapping_(null);
- }
- }
-
- /*
- * Return true if the annotations on this type indicate it should have a mapping
- */
- protected boolean isSpecifiedMapped() {
- return getXmlTypeAnnotation() != null
- || getXmlRootElementAnnotation() != null
- || getXmlTransientAnnotation() != null;
- }
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TYPE);
- }
-
- protected XmlRootElementAnnotation getXmlRootElementAnnotation() {
- return (XmlRootElementAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT);
- }
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TRANSIENT);
- }
-
-
- // ***** default mapped *****
-
- public boolean isDefaultMapped() {
- return this.defaultMapped;
- }
-
- public void setDefaultMapped(boolean newValue) {
- boolean old = this.defaultMapped;
- this.defaultMapped = newValue;
- firePropertyChanged(DEFAULT_MAPPED_PROPERTY, old, newValue);
- }
-
-
- // ***** XmlJavaTypeAdapter *****
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter() {
- return this.xmlJavaTypeAdapter;
- }
-
- protected void setXmlJavaTypeAdapter_(XmlJavaTypeAdapter xmlJavaTypeAdapter) {
- XmlJavaTypeAdapter oldXmlJavaTypeAdapter = this.xmlJavaTypeAdapter;
- this.xmlJavaTypeAdapter = xmlJavaTypeAdapter;
- firePropertyChanged(XML_JAVA_TYPE_ADAPTER_PROPERTY, oldXmlJavaTypeAdapter, xmlJavaTypeAdapter);
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- throw new IllegalStateException();
- }
- XmlJavaTypeAdapterAnnotation annotation
- = (XmlJavaTypeAdapterAnnotation) getJavaResourceType().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- XmlJavaTypeAdapter xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- setXmlJavaTypeAdapter_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- setXmlJavaTypeAdapter_(null);
- }
-
- protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() {
- if (getJavaResourceType().getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER) > 0) {
- return (XmlJavaTypeAdapterAnnotation) getJavaResourceType().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- return null;
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaTypeXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void initXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- this.xmlJavaTypeAdapter = buildXmlJavaTypeAdapter(annotation);
- }
- }
-
- protected void syncXmlJavaTypeAdapter() {
- XmlJavaTypeAdapterAnnotation annotation = getXmlJavaTypeAdapterAnnotation();
- if (annotation != null) {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.synchronizeWithResourceModel();
- }
- else {
- setXmlJavaTypeAdapter_(buildXmlJavaTypeAdapter(annotation));
- }
- }
- else {
- setXmlJavaTypeAdapter_(null);
- }
- }
-
- protected void updateXmlJavaTypeAdapter() {
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.update();
- }
- }
-
-
- // ***** JaxbType misc *****
-
- public JavaResourceAbstractType getJavaResourceType() {
- return this.resourceType;
- }
-
- public String getSimpleName() {
- return this.resourceType.getName();
- }
-
- public String getTypeQualifiedName() {
- String packageName = getPackageName();
- return (packageName.length() == 0) ? getFullyQualifiedName() : getFullyQualifiedName().substring(packageName.length() + 1);
- }
-
- public String getFullyQualifiedName() {
- return this.resourceType.getQualifiedName();
- }
-
- public String getPackageName() {
- return this.resourceType.getPackageName();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getContextRoot().getPackage(getPackageName());
- }
-
- public JaxbPackageInfo getJaxbPackageInfo() {
- JaxbPackage pkg = getJaxbPackage();
- return (pkg == null) ? null : pkg.getPackageInfo();
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- if (this.mapping != null) {
- return this.mapping.getReferencedXmlTypeNames();
- }
- return EmptyIterable.instance();
- }
-
-
- // ***** misc *****
-
- protected CompilationUnit buildASTRoot() {
- return this.resourceType.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.mapping != null) {
- result = this.mapping.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- if (this.xmlJavaTypeAdapter != null) {
- result = this.xmlJavaTypeAdapter.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- /**
- * Override as needed
- */
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJavaResourceType().getNameTextRange(astRoot);
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- // TODO temporary hack since we don't know yet where to put
- // any messages for types in another project
- IFile file = this.resourceType.getFile();
- // 'file' will be null if the type is "external" and binary;
- // the file will be in a different project if the type is "external" and source;
- // the type will be binary if it is in a JAR in the current project
- if ((file != null)
- && file.getProject().equals(getJaxbProject().getProject())
- && (this.resourceType instanceof SourceNode)) {
- // build the AST root here to pass down
- this.validate(messages, reporter, this.buildASTRoot());
- }
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.mapping != null) {
- this.mapping.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlJavaTypeAdapter != null) {
- this.xmlJavaTypeAdapter.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
deleted file mode 100644
index 37e03e20aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaTypeMapping.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaTypeMapping
- extends AbstractJavaContextNode
- implements JaxbTypeMapping {
-
- protected boolean xmlTransient;
-
- protected final JaxbQName qName;
-
- protected XmlRootElement xmlRootElement;
-
- protected XmlSeeAlso xmlSeeAlso;
-
-
- protected AbstractJavaTypeMapping(JaxbType parent) {
- super(parent);
- initXmlTransient();
- this.qName = buildQName();
- initXmlRootElement();
- initializeXmlSeeAlso();
- }
-
-
- public JaxbType getJaxbType() {
- return (JaxbType) getParent();
- }
-
- protected JavaResourceAbstractType getJavaResourceType() {
- return getJaxbType().getJavaResourceType();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbType().getJaxbPackage();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlTransient();
- this.qName.synchronizeWithResourceModel();
- syncXmlRootElement();
- syncXmlSeeAlso();
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- updateXmlRootElement();
- updateXmlSeeAlso();
- }
-
-
- // ***** XmlTransient *****
-
- public boolean isXmlTransient() {
- return this.xmlTransient;
- }
-
- public void setXmlTransient(boolean newValue) {
- getJavaResourceType().addAnnotation(JAXB.XML_TRANSIENT);
- setXmlTransient_(newValue);
- }
-
- protected void setXmlTransient_(boolean newValue) {
- boolean old = this.xmlTransient;
- this.xmlTransient = newValue;
- firePropertyChanged(XML_TRANSIENT_PROPERTY, old, newValue);
- }
-
- protected XmlTransientAnnotation getXmlTransientAnnotation() {
- return (XmlTransientAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_TRANSIENT);
- }
-
- protected void initXmlTransient() {
- this.xmlTransient = getXmlTransientAnnotation() != null;
- }
-
- protected void syncXmlTransient() {
- setXmlTransient_(getXmlTransientAnnotation() != null);
- }
-
-
- // ***** XmlType.name and namespace *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlTypeQName(this);
- }
-
- protected XmlTypeAnnotation getXmlTypeAnnotation() {
- return (XmlTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_TYPE);
- }
-
-
- // ***** XmlRootElement *****
-
- public XmlRootElement getXmlRootElement() {
- return this.xmlRootElement;
- }
-
- protected void setXmlRootElement_(XmlRootElement rootElement) {
- XmlRootElement old = this.xmlRootElement;
- this.xmlRootElement = rootElement;
- this.firePropertyChanged(XML_ROOT_ELEMENT_PROPERTY, old, rootElement);
- }
-
- public XmlRootElement addXmlRootElement() {
- if (this.xmlRootElement != null) {
- throw new IllegalStateException();
- }
-
- XmlRootElementAnnotation annotation
- = (XmlRootElementAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_ROOT_ELEMENT);
-
- XmlRootElement xmlRootElement = buildXmlRootElement(annotation);
- setXmlRootElement_(xmlRootElement);
- return xmlRootElement;
- }
-
- public void removeXmlRootElement() {
- if (this.xmlRootElement == null) {
- throw new IllegalStateException();
- }
-
- getJavaResourceType().removeAnnotation(JAXB.XML_ROOT_ELEMENT);
- setXmlRootElement_(null);
- }
-
- protected XmlRootElementAnnotation getXmlRootElementAnnotation() {
- return (XmlRootElementAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT);
- }
-
- protected XmlRootElement buildXmlRootElement() {
- XmlRootElementAnnotation annotation = getXmlRootElementAnnotation();
- return annotation == null ? null : buildXmlRootElement(annotation);
- }
-
- protected XmlRootElement buildXmlRootElement(XmlRootElementAnnotation resourceRootElement) {
- return getFactory().buildJavaXmlRootElement(this, resourceRootElement);
- }
-
- protected void initXmlRootElement() {
- this.xmlRootElement = this.buildXmlRootElement();
- }
-
- protected void syncXmlRootElement() {
- XmlRootElementAnnotation annotation = getXmlRootElementAnnotation();
- if (annotation != null) {
- if (this.xmlRootElement != null) {
- this.xmlRootElement.synchronizeWithResourceModel();
- }
- else {
- setXmlRootElement_(buildXmlRootElement(annotation));
- }
- }
- else if (this.xmlRootElement != null) {
- setXmlRootElement_(null);
- }
- }
-
- protected void updateXmlRootElement() {
- if (this.xmlRootElement != null) {
- this.xmlRootElement.update();
- }
- }
-
-
- // ***** XmlSeeAlso *****
-
- public XmlSeeAlso getXmlSeeAlso() {
- return this.xmlSeeAlso;
- }
-
- protected void setXmlSeeAlso_(XmlSeeAlso xmlSeeAlso) {
- XmlSeeAlso old = this.xmlSeeAlso;
- this.xmlSeeAlso = xmlSeeAlso;
- firePropertyChanged(XML_SEE_ALSO_PROPERTY, old, xmlSeeAlso);
- }
-
- public XmlSeeAlso addXmlSeeAlso() {
- if (this.xmlSeeAlso != null) {
- throw new IllegalStateException();
- }
- XmlSeeAlsoAnnotation annotation
- = (XmlSeeAlsoAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_SEE_ALSO);
-
- XmlSeeAlso xmlSeeAlso = buildXmlSeeAlso(annotation);
- setXmlSeeAlso_(xmlSeeAlso);
- return xmlSeeAlso;
- }
-
- public void removeXmlSeeAlso() {
- if (this.xmlSeeAlso == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(JAXB.XML_SEE_ALSO);
- setXmlSeeAlso_(null);
- }
-
- protected XmlSeeAlsoAnnotation getXmlSeeAlsoAnnotation() {
- return (XmlSeeAlsoAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_SEE_ALSO);
- }
-
- protected XmlSeeAlso buildXmlSeeAlso(XmlSeeAlsoAnnotation annotation) {
- return new GenericJavaXmlSeeAlso(this, annotation);
- }
-
- protected void initializeXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- this.xmlSeeAlso = (annotation == null) ?
- null
- : buildXmlSeeAlso(annotation);
- }
-
- protected void syncXmlSeeAlso() {
- XmlSeeAlsoAnnotation annotation = getXmlSeeAlsoAnnotation();
- if (annotation != null) {
- if (this.xmlSeeAlso != null) {
- this.xmlSeeAlso.synchronizeWithResourceModel();
- }
- else {
- setXmlSeeAlso_(buildXmlSeeAlso(annotation));
- }
- }
- else {
- setXmlSeeAlso_(null);
- }
- }
-
- protected void updateXmlSeeAlso() {
- if (this.xmlSeeAlso != null) {
- this.xmlSeeAlso.update();
- }
- }
-
-
- // ***** misc *****
-
- public final Iterable<String> getReferencedXmlTypeNames() {
- return (this.xmlTransient) ?
- getTransientReferencedXmlTypeNames()
- : getNonTransientReferencedXmlTypeNames();
- }
-
- protected Iterable<String> getTransientReferencedXmlTypeNames() {
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- if (this.xmlSeeAlso != null) {
- return this.xmlSeeAlso.getReferencedXmlTypeNames();
- }
- return EmptyIterable.instance();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- JaxbPackage jaxbPackage = getJaxbPackage();
- if (jaxbPackage != null) {
- getJaxbProject().getSchemaLibrary().refreshSchema(jaxbPackage.getNamespace());
- }
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlRootElement != null) {
- result = this.xmlRootElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getXmlTypeAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : getJaxbType().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! this.xmlTransient) {
- this.qName.validate(messages, reporter, astRoot);
-
- if (this.xmlRootElement != null) {
- this.xmlRootElement.validate(messages, reporter, astRoot);
- }
- }
- }
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition() {
- JaxbPackage jaxbPackage = getJaxbPackage();
- XsdSchema xsdSchema = (jaxbPackage == null) ? null : jaxbPackage.getXsdSchema();
- if (xsdSchema == null) {
- return null;
- }
-
- if (! StringTools.stringIsEmpty(this.qName.getName())) {
- return xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName());
- }
-
- if (this.xmlRootElement != null) {
- XsdElementDeclaration xsdElement
- = xsdSchema.getElementDeclaration(
- this.xmlRootElement.getQName().getNamespace(),
- this.xmlRootElement.getQName().getName());
- if (xsdElement != null) {
- return xsdElement.getType();
- }
- }
-
- return null;
- }
-
- public boolean hasRootElementInHierarchy() {
- return this.xmlRootElement != null;
- }
-
-
- protected class XmlTypeQName
- extends AbstractJavaQName {
-
- protected XmlTypeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage();
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = AbstractJavaTypeMapping.this.getJaxbType().getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public String getDefaultName() {
- return Introspector.decapitalize(AbstractJavaTypeMapping.this.getJaxbType().getSimpleName());
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getTypeNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_TYPE_DESC;
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // do not call super... - it is not an error if the name is ""
- // if name is absent (""), namespace cannot be different from package namespace
- if ("".equals(getName())
- && ! StringTools.stringsAreEqual(
- getNamespace(),
- getDefaultNamespace())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE,
- this,
- getXmlTypeAnnotation().getNamespaceTextRange(astRoot)));
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // if name is not absent (""), type must be from schema associated with this package
- String name = getName();
- String namespace = getNamespace();
-
- if (! StringTools.stringIsEmpty(name)) {
- XsdSchema schema = this.getXsdSchema();
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return AbstractJavaTypeMapping.this.getXmlTypeAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
deleted file mode 100644
index f2c8bb9d3a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public abstract class AbstractJavaXmlJavaTypeAdapter
- extends AbstractJavaContextNode
- implements XmlJavaTypeAdapter {
-
- protected final XmlJavaTypeAdapterAnnotation annotation;
-
- protected String value;
-
- protected XmlAdapter xmlAdapter;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- protected AbstractJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.value = getResourceValue();
- initializeXmlAdapter();
- this.specifiedType = getResourceTypeString();
- this.defaultType = buildDefaultType();
- }
-
-
- public XmlJavaTypeAdapterAnnotation getAnnotation() {
- return this.annotation;
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setValue_(getResourceValue());
- syncXmlAdapter();
- setSpecifiedType_(getResourceTypeString());
- setDefaultType(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlAdapter();
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- this.annotation.setValue(value);
- this.setValue_(value);
- }
-
- protected void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- protected String getResourceValue() {
- return this.annotation.getValue();
- }
-
- public String getFullyQualifiedValue() {
- return this.annotation.getFullyQualifiedValue();
- }
-
-
- // ***** xmlAdapter *****
-
- public XmlAdapter getXmlAdapter() {
- return this.xmlAdapter;
- }
-
- protected void setXmlAdapter_(XmlAdapter xmlAdapter) {
- XmlAdapter old = this.xmlAdapter;
- this.xmlAdapter = xmlAdapter;
- firePropertyChanged(XML_ADAPTER_PROPERTY, old, xmlAdapter);
- }
-
- protected JavaResourceType getXmlAdapterResourceType() {
- String xmlAdapterName = getFullyQualifiedValue();
- return (JavaResourceType) getJaxbProject().getJavaResourceType(xmlAdapterName, JavaResourceAbstractType.Kind.TYPE);
- }
-
- protected XmlAdapter buildXmlAdapter(JavaResourceType xmlAdapterResourceType) {
- return new GenericJavaXmlAdapter(this, xmlAdapterResourceType);
- }
-
- protected void initializeXmlAdapter() {
- JavaResourceType xmlAdapterResourceType = getXmlAdapterResourceType();
- if (xmlAdapterResourceType != null) {
- this.xmlAdapter = buildXmlAdapter(xmlAdapterResourceType);
- }
- }
-
- protected void syncXmlAdapter() {
- if (this.xmlAdapter != null) {
- this.xmlAdapter.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlAdapter() {
- JavaResourceType newResourceType = getXmlAdapterResourceType();
- if (newResourceType == null) {
- setXmlAdapter_(null);
- }
- else {
- if (this.xmlAdapter == null) {
- setXmlAdapter_(buildXmlAdapter(newResourceType));
- }
- else {
- JavaResourceType currentResourceType = this.xmlAdapter.getJavaResourceType();
- if (currentResourceType == null || ! currentResourceType.equals(newResourceType)) {
- setXmlAdapter_(buildXmlAdapter(newResourceType));
- }
- else {
- this.xmlAdapter.update();
- }
- }
- }
- }
-
-
- // ***** type *****
-
- public String getType() {
- return this.specifiedTypeNotSet() ? this.getDefaultType() : this.getSpecifiedType();
- }
-
- /**
- * @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT
- */
- protected boolean specifiedTypeNotSet() {
- return getSpecifiedType() == null || this.annotation.getFullyQualifiedType().equals(DEFAULT_TYPE);
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(String defaultType) {
- String oldDefaultType = this.defaultType;
- this.defaultType = defaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, defaultType);
- }
-
- protected abstract String buildDefaultType();
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String location) {
- this.annotation.setType(location);
- this.setSpecifiedType_(location);
- }
-
- protected void setSpecifiedType_(String type) {
- String old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected String getResourceTypeString() {
- return this.annotation.getType();
- }
-
- public String getFullyQualifiedType() {
- return specifiedTypeNotSet() ? getDefaultType() : this.annotation.getFullyQualifiedType();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java
deleted file mode 100644
index 57c51ad727..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNamedNodeMapping.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttachmentRef;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.JaxbBasicSchemaComponentAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaXmlNamedNodeMapping<A extends JaxbBasicSchemaComponentAnnotation>
- extends AbstractJavaXmlNodeMapping<A>
- implements XmlNamedNodeMapping {
-
- protected XmlID xmlID;
-
- protected XmlIDREF xmlIDREF;
-
- protected XmlAttachmentRef xmlAttachmentRef;
-
-
- public AbstractJavaXmlNamedNodeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlID();
- initializeXmlIDREF();
- initializeXmlAttachmentRef();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlID();
- syncXmlIDREF();
- syncXmlAttachmentRef();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlID();
- updateXmlIDREF();
- updateXmlAttachmentRef();
- }
-
-
- // ***** XmlID *****
-
- public XmlID getXmlID() {
- return this.xmlID;
- }
-
- public XmlID addXmlID() {
- if (this.xmlID != null) {
- throw new IllegalStateException();
- }
- XmlIDAnnotation annotation = (XmlIDAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ID);
-
- XmlID xmlID = this.buildXmlID(annotation);
- this.setXmlID_(xmlID);
- return xmlID;
- }
-
- protected XmlID buildXmlID(XmlIDAnnotation xmlIDAnnotation) {
- return new GenericJavaXmlID(this, xmlIDAnnotation);
- }
-
- public void removeXmlID() {
- if (this.xmlID == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ID);
- this.setXmlID_(null);
- }
-
- protected void initializeXmlID() {
- XmlIDAnnotation annotation = this.getXmlIDAnnotation();
- if (annotation != null) {
- this.xmlID = this.buildXmlID(annotation);
- }
- }
-
- protected XmlIDAnnotation getXmlIDAnnotation() {
- return (XmlIDAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ID);
- }
-
- protected void syncXmlID() {
- XmlIDAnnotation annotation = this.getXmlIDAnnotation();
- if (annotation != null) {
- if (this.getXmlID() != null) {
- this.getXmlID().synchronizeWithResourceModel();
- }
- else {
- this.setXmlID_(this.buildXmlID(annotation));
- }
- }
- else {
- this.setXmlID_(null);
- }
- }
-
- protected void updateXmlID() {
- if (this.getXmlID() != null) {
- this.getXmlID().update();
- }
- }
-
- protected void setXmlID_(XmlID xmlID) {
- XmlID oldXmlID = this.xmlID;
- this.xmlID = xmlID;
- firePropertyChanged(XML_ID_PROPERTY, oldXmlID, xmlID);
- }
-
-
- //************ XmlIDREF ***************
-
- public XmlIDREF getXmlIDREF() {
- return this.xmlIDREF;
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
-
- getJavaResourceAttribute().addAnnotation(JAXB.XML_IDREF);
-
- XmlIDREF xmlIDREF = buildXmlIDREF();
- setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_IDREF);
- setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- if (getXmlIDREFAnnotation() != null) {
- this.xmlIDREF = buildXmlIDREF();
- }
- }
-
- protected void syncXmlIDREF() {
- if (getXmlIDREFAnnotation() == null) {
- setXmlIDREF_(null);
- }
- else if (this.xmlIDREF == null) {
- setXmlIDREF_(buildXmlIDREF());
- }
- else {
- this.xmlIDREF.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.xmlIDREF != null) {
- this.xmlIDREF.update();
- }
- }
-
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_IDREF);
- }
-
- protected XmlIDREF buildXmlIDREF() {
- return new GenericJavaXmlIDREF(this, buildXmlIDREFContext());
- }
-
- protected abstract GenericJavaXmlIDREF.Context buildXmlIDREFContext();
-
-
- //************ XmlAttachmentRef ***************
-
- public XmlAttachmentRef getXmlAttachmentRef() {
- return this.xmlAttachmentRef;
- }
-
- public XmlAttachmentRef addXmlAttachmentRef() {
- if (this.xmlAttachmentRef != null) {
- throw new IllegalStateException();
- }
- XmlAttachmentRefAnnotation annotation = (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ATTACHMENT_REF);
-
- XmlAttachmentRef xmlAttachmentRef = this.buildXmlAttachmentRef(annotation);
- this.setXmlAttachmentRef_(xmlAttachmentRef);
- return xmlAttachmentRef;
- }
-
- protected XmlAttachmentRef buildXmlAttachmentRef(XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation) {
- return new GenericJavaXmlAttachmentRef(this, xmlAttachmentRefAnnotation);
- }
-
- public void removeXmlAttachmentRef() {
- if (this.xmlAttachmentRef == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ATTACHMENT_REF);
- this.setXmlAttachmentRef_(null);
- }
-
- protected void initializeXmlAttachmentRef() {
- XmlAttachmentRefAnnotation annotation = this.getXmlAttachmentRefAnnotation();
- if (annotation != null) {
- this.xmlAttachmentRef = this.buildXmlAttachmentRef(annotation);
- }
- }
-
- protected XmlAttachmentRefAnnotation getXmlAttachmentRefAnnotation() {
- return (XmlAttachmentRefAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- protected void syncXmlAttachmentRef() {
- XmlAttachmentRefAnnotation annotation = this.getXmlAttachmentRefAnnotation();
- if (annotation != null) {
- if (this.getXmlAttachmentRef() != null) {
- this.getXmlAttachmentRef().synchronizeWithResourceModel();
- }
- else {
- this.setXmlAttachmentRef_(this.buildXmlAttachmentRef(annotation));
- }
- }
- else {
- this.setXmlAttachmentRef_(null);
- }
- }
-
- protected void updateXmlAttachmentRef() {
- if (this.getXmlAttachmentRef() != null) {
- this.getXmlAttachmentRef().update();
- }
- }
-
- protected void setXmlAttachmentRef_(XmlAttachmentRef xmlAttachmentRef) {
- XmlAttachmentRef oldXmlAttachmentRef = this.xmlAttachmentRef;
- this.xmlAttachmentRef = xmlAttachmentRef;
- firePropertyChanged(XML_ATTACHMENT_REF_PROPERTY, oldXmlAttachmentRef, xmlAttachmentRef);
- }
-
-
- // ***** misc *****
-
- @Override
- public String getDataTypeName() {
- if (this.xmlIDREF != null) {
- JaxbClassMapping referenceMapping = getContextRoot().getClassMapping(getValueTypeName());
- if (referenceMapping != null) {
- JaxbAttributeMapping idMapping = referenceMapping.getXmlIdMapping();
- if (idMapping != null) {
- return idMapping.getValueTypeName();
- }
- }
- return String.class.getName();
- }
- return getValueTypeName();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlID != null) {
- this.xmlID.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlIDREF != null) {
- this.xmlIDREF.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlAttachmentRef != null) {
- this.xmlAttachmentRef.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected abstract class XmlIDREFContext
- implements GenericJavaXmlIDREF.Context {
-
- public XmlIDREFAnnotation getAnnotation() {
- return AbstractJavaXmlNamedNodeMapping.this.getXmlIDREFAnnotation();
- }
-
- public boolean isList() {
- return AbstractJavaXmlNamedNodeMapping.this.isXmlList();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java
deleted file mode 100644
index 8f5f0ca876..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaXmlNodeMapping.java
+++ /dev/null
@@ -1,268 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlNodeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.XSDVariety;
-
-
-public abstract class AbstractJavaXmlNodeMapping<A extends Annotation>
- extends AbstractJavaAdaptableAttributeMapping<A>
- implements XmlNodeMapping {
-
- protected XmlSchemaType xmlSchemaType;
-
- protected boolean specifiedXmlList;
-
- protected boolean defaultXmlList;
-
-
- public AbstractJavaXmlNodeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlSchemaType();
- initializeXmlList();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlSchemaType();
- syncXmlList();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlSchemaType();
- }
-
-
- // ***** XmlSchemaType *****
-
- public XmlSchemaType getXmlSchemaType() {
- return this.xmlSchemaType;
- }
-
- protected void setXmlSchemaType_(XmlSchemaType xmlSchemaType) {
- XmlSchemaType oldXmlSchemaType = this.xmlSchemaType;
- this.xmlSchemaType = xmlSchemaType;
- this.firePropertyChanged(XML_SCHEMA_TYPE_PROPERTY, oldXmlSchemaType, xmlSchemaType);
- }
-
- public boolean hasXmlSchemaType() {
- return this.xmlSchemaType != null;
- }
-
- public XmlSchemaType addXmlSchemaType() {
- if (this.xmlSchemaType != null) {
- throw new IllegalStateException();
- }
- XmlSchemaTypeAnnotation annotation = (XmlSchemaTypeAnnotation) this.getJavaResourceAttribute().addAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- XmlSchemaType xmlJavaTypeAdapter = this.buildXmlSchemaType(annotation);
- this.setXmlSchemaType_(xmlJavaTypeAdapter);
- return xmlJavaTypeAdapter;
- }
-
- public void removeXmlSchemaType() {
- if (this.xmlSchemaType == null) {
- throw new IllegalStateException();
- }
- this.getJavaResourceAttribute().removeAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- this.setXmlSchemaType_(null);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation annotation) {
- return new GenericJavaAttributeMappingXmlSchemaType(this, annotation);
- }
-
- protected XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(JAXB.XML_SCHEMA_TYPE) > 0) {
- return (XmlSchemaTypeAnnotation) getJavaResourceAttribute().getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- }
- return null;
- }
-
- protected void initializeXmlSchemaType() {
- XmlSchemaTypeAnnotation annotation = this.getXmlSchemaTypeAnnotation();
- if (annotation != null) {
- this.xmlSchemaType = this.buildXmlSchemaType(annotation);
- }
- }
-
- protected void updateXmlSchemaType() {
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.update();
- }
- }
-
- protected void syncXmlSchemaType() {
- XmlSchemaTypeAnnotation annotation = this.getXmlSchemaTypeAnnotation();
- if (annotation != null) {
- if (this.getXmlSchemaType() != null) {
- this.getXmlSchemaType().synchronizeWithResourceModel();
- }
- else {
- this.setXmlSchemaType_(this.buildXmlSchemaType(annotation));
- }
- }
- else {
- this.setXmlSchemaType_(null);
- }
- }
-
-
- // ***** XmlList *****
-
- public boolean isXmlList() {
- return isSpecifiedXmlList() || isDefaultXmlList();
- }
-
- public boolean isSpecifiedXmlList() {
- return this.specifiedXmlList;
- }
-
- public void setSpecifiedXmlList(boolean newValue) {
- if (this.specifiedXmlList == newValue) {
- throw new IllegalStateException();
- }
-
- if (newValue) {
- getJavaResourceAttribute().addAnnotation(JAXB.XML_LIST);
- }
- else {
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_LIST);
- }
-
- setSpecifiedXmlList_(newValue);
- }
-
- protected void setSpecifiedXmlList_(boolean newValue) {
- boolean oldValue = this.specifiedXmlList;
- this.specifiedXmlList = newValue;
- firePropertyChanged(SPECIFIED_XML_LIST_PROPERTY, oldValue, newValue);
- }
-
- public boolean isDefaultXmlList() {
- return this.defaultXmlList;
- }
-
- protected void setDefaultXmlList_(boolean newValue) {
- boolean oldValue = this.defaultXmlList;
- this.defaultXmlList = newValue;
- firePropertyChanged(DEFAULT_XML_LIST_PROPERTY, oldValue, newValue);
- }
-
- protected void initializeXmlList() {
- this.specifiedXmlList = getXmlListAnnotation() != null;
- this.defaultXmlList = calculateDefaultXmlList();
- }
-
- protected void syncXmlList() {
- setSpecifiedXmlList_(getXmlListAnnotation() != null);
- setDefaultXmlList_(calculateDefaultXmlList());
- }
-
- protected XmlListAnnotation getXmlListAnnotation() {
- return (XmlListAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_LIST);
- }
-
- protected abstract boolean calculateDefaultXmlList();
-
-
- // ***** misc *****
-
- @Override
- public XsdTypeDefinition getDataTypeXsdTypeDefinition() {
- if (this.xmlSchemaType != null) {
- return this.xmlSchemaType.getXsdTypeDefinition();
- }
- return super.getDataTypeXsdTypeDefinition();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlSchemaType != null) {
- result = this.xmlSchemaType.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlSchemaType != null) {
- this.xmlSchemaType.validate(messages, reporter, astRoot);
- }
-
- if (isXmlList()) {
- validateXmlList(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlList(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE,
- this,
- getXmlListValidationTextRange(astRoot)));
- }
- else {
- XsdTypeDefinition xsdType = getDataTypeXsdTypeDefinition();
- if (xsdType != null
- && (xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE
- || ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().getVariety() == XSDVariety.LIST_LITERAL)) {
-
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE,
- new String[] { getValueTypeName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected TextRange getXmlListValidationTextRange(CompilationUnit astRoot) {
- XmlListAnnotation annotation = getXmlListAnnotation();
- return (annotation == null) ? getValidationTextRange(astRoot) : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java
deleted file mode 100644
index d351834091..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/FieldAccessor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-public class FieldAccessor
- extends AbstractJavaContextNode
- implements Accessor {
-
- protected final JavaResourceField resourceField;
-
-
- public FieldAccessor(JaxbClassMapping parent, JavaResourceField resourceField) {
- super(parent);
- this.resourceField = resourceField;
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.getResourceField();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- return AccessorTools.getBaseTypeName(this.getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- return AccessorTools.isCollectionType(getJavaResourceAttribute());
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return this.getJavaResourceAttribute().typeIsSubTypeOf(typeName);
- }
-
- public JavaResourceField getResourceField() {
- return this.resourceField;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return this.resourceField == resourceField;
- }
-
- public boolean isFor(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- return false;
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
deleted file mode 100644
index 8d98ffa589..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeMappingXmlSchemaType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeMappingXmlSchemaType
- extends GenericJavaXmlSchemaType {
-
- public GenericJavaAttributeMappingXmlSchemaType(JaxbAttributeMapping parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return this.getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String fqType = getFullyQualifiedType();
- if (fqType != null && ! XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE,
- this,
- getTypeTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
deleted file mode 100644
index 8b1dd7cb09..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaAttributeXmlJavaTypeAdapter(JaxbAttributeMapping parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- // ********** type **********
-
- @Override
- protected String buildDefaultType() {
- return this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED,
- this,
- getAnnotation().getTypeTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
deleted file mode 100644
index 4d970adc56..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaAttributesContainer.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.lang.reflect.Modifier;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributesContainer
- extends AbstractJavaContextNode
- implements JaxbAttributesContainer {
-
- protected JavaResourceType javaResourceType;
-
- protected Owner owner;
-
- protected final Vector<JaxbPersistentAttribute> attributes = new Vector<JaxbPersistentAttribute>();
-
- public GenericJavaAttributesContainer(JaxbClassMapping parent, Owner owner, JavaResourceType resourceType) {
- super(parent);
- this.javaResourceType = resourceType;
- this.owner = owner;
- this.initializeAttributes();
- }
-
-
- public JaxbClassMapping getJaxbClassMapping() {
- return (JaxbClassMapping) getParent();
- }
-
- public boolean isFor(JavaResourceType javaResourceType) {
- return this.javaResourceType == javaResourceType;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.synchronizeNodesWithResourceModel(this.getAttributes());
- }
-
- @Override
- public void update() {
- super.update();
- this.updateAttributes();
- }
-
- // ********** access type **********
-
- protected XmlAccessType getAccessType() {
- return this.owner.getAccessType();
- }
-
-
- // ********** attributes **********
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return new LiveCloneIterable<JaxbPersistentAttribute>(this.attributes);
- }
-
- public int getAttributesSize() {
- return this.attributes.size();
- }
-
- protected void addAttribute(JaxbPersistentAttribute attribute) {
- if (this.attributes.add(attribute)) {
- this.owner.fireAttributeAdded(attribute);
- }
- }
-
- protected void removeAttribute(JaxbPersistentAttribute attribute) {
- if (this.attributes.remove(attribute)) {
- this.owner.fireAttributeRemoved(attribute);
- }
- }
-
- protected JaxbPersistentAttribute buildField(JavaResourceField resourceField) {
- return getFactory().buildJavaPersistentField(getJaxbClassMapping(), resourceField);
- }
-
- protected JaxbPersistentAttribute buildProperty(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return getFactory().buildJavaPersistentProperty(getJaxbClassMapping(), resourceGetter, resourceSetter);
- }
-
- protected void initializeAttributes() {
- if (getJaxbClassMapping().isXmlTransient()) {
- return;
- }
- if (getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
- this.initializePublicMemberAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.FIELD) {
- this.intializeFieldAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.PROPERTY) {
- this.intializePropertyAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.NONE) {
- this.intializeNoneAccessAttributes();
- }
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PUBLIC_MEMBER
- * 1. all public, non-static, non-transient fields (transient modifier, @XmlTransient is brought to the context model)
- * 2. all annotated fields that aren't public
- * 3. all public getter/setter javabeans pairs
- * 4. all annotated methods (some will have a matching getter/setter, some will be standalone)
- */
- private void initializePublicMemberAccessAttributes() {
- this.initializeFieldAttributes(PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER);
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all persistable resource method getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistablePublicMemberAccess(getterMethod, setterMethod)) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.FIELD
- * 1. all non-transient fields
- * 2. all annotated methods getters/setters
- */
- private void intializeFieldAccessAttributes() {
- this.initializeFieldAttributes(this.buildNonTransientNonStaticResourceFieldsFilter());
- this.initializeAnnotatedPropertyAttributes();
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PROPERTY
- * 1. all getter/setter javabeans pairs
- * 2. all annotated fields
- * 3. all annotated methods getters/setters that don't have a matching pair
- */
- private void intializePropertyAccessAttributes() {
- this.initializeFieldAttributes(ANNOTATED_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistableProperties(getterMethod, setterMethod)) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.NONE
- * 1. all annotated fields
- * 2. all annotated methods getters/setters (some will have a matching getter/setter, some will be standalone)
- */
- private void intializeNoneAccessAttributes() {
- this.initializeFieldAttributes(ANNOTATED_RESOURCE_FIELDS_FILTER);
- this.initializeAnnotatedPropertyAttributes();
- }
-
- private void initializeFieldAttributes(Filter<JavaResourceField> filter) {
- for (JavaResourceField resourceField : this.getResourceFields(filter)) {
- this.attributes.add(this.buildField(resourceField));
- }
- }
-
- private void initializeRemainingResourceMethodAttributes(Collection<JavaResourceMethod> resourceMethods) {
- //iterate through remaining resource methods and search for those that are annotated.
- //all getter methods will already be used.
- for (JavaResourceMethod resourceMethod : resourceMethods) {
- if (resourceMethod.isAnnotated()) {
- //annotated setter(or other random method) with no corresponding getter, bring into context model for validation purposes
- this.attributes.add(this.buildProperty(null, resourceMethod));
- }
- }
- }
-
- private static boolean methodsArePersistableProperties(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- if (setterMethod != null) {
- return true;
- }
- //Lists do not have to have a corresponding setter method
- else if (getterMethod.getTypeName().equals("java.util.List")) { //$NON-NLS-1$
- return true;
- }
- else if (getterMethod.isAnnotated()) {
- //annotated getter with no corresponding setter, bring into context model for validation purposes
- return true;
- }
- return false;
- }
-
- private static boolean methodsArePersistablePublicMemberAccess(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- if (getterMethod.isPublic()) {
- if (setterMethod != null) {
- if (setterMethod.isPublic()) {
- return true;
- }
- }
- //Lists do not have to have a corresponding setter method
- else if (getterMethod.getTypeName().equals("java.util.List")) { //$NON-NLS-1$
- return true;
- }
- else if (getterMethod.isAnnotated()) {
- //annotated getter with no corresponding setter, bring into context model for validation purposes
- return true;
- }
- }
- else if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- return true;
- }
- return false;
- }
-
- private void initializeAnnotatedPropertyAttributes() {
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- this.attributes.add(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.initializeRemainingResourceMethodAttributes(resourceMethods);
- }
-
- protected Iterable<JavaResourceField> getResourceFields() {
- return this.javaResourceType.getFields();
- }
-
- protected Iterable<JavaResourceMethod> getResourceMethods() {
- return this.javaResourceType.getMethods();
- }
-
- protected Iterable<JavaResourceField> getResourceFields(Filter<JavaResourceField> filter) {
- return new FilteringIterable<JavaResourceField>(getResourceFields(), filter);
- }
-
- protected Iterable<JavaResourceMethod> getResourceMethods(Filter<JavaResourceMethod> filter) {
- return new FilteringIterable<JavaResourceMethod>(getResourceMethods(), filter);
- }
-
- protected Filter<JavaResourceField> buildNonTransientNonStaticResourceFieldsFilter() {
- return new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return memberIsNonTransientNonStatic(resourceField) || resourceField.isAnnotated();
- }
- };
- }
-
- protected static Filter<JavaResourceField> PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER = new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return memberIsPublicNonTransientNonStatic(resourceField) || resourceField.isAnnotated();
- }
- };
-
- protected Filter<JavaResourceMethod> buildPersistablePropertyGetterMethodsFilter() {
- return new Filter<JavaResourceMethod>() {
- public boolean accept(JavaResourceMethod resourceMethod) {
- return methodIsPersistablePropertyGetter(resourceMethod, getResourceMethods());
- }
- };
- }
-
- protected static boolean memberIsPublicNonTransientNonStatic(JavaResourceMember resourceMember) {
- return resourceMember.isPublic() && memberIsNonTransientNonStatic(resourceMember);
- }
-
- protected static boolean memberIsNonTransientNonStatic(JavaResourceMember resourceMember) {
- return !resourceMember.isTransient() && !resourceMember.isStatic();
- }
-
- protected static Filter<JavaResourceField> ANNOTATED_RESOURCE_FIELDS_FILTER =
- new Filter<JavaResourceField>() {
- public boolean accept(JavaResourceField resourceField) {
- return resourceField.isAnnotated();
- }
- };
-
- /**
- * The attributes are synchronized during the <em>update</em> because
- * the list of resource attributes is determined by the access type
- * which can be controlled in a number of different places....
- */
- protected void updateAttributes() {
- if (getJaxbClassMapping().isXmlTransient()) {
- for (JaxbPersistentAttribute contextAttribute : getAttributes()) {
- this.removeAttribute(contextAttribute);
- }
- return;
- }
- if (getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
- this.syncPublicMemberAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.FIELD) {
- this.syncFieldAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.PROPERTY) {
- this.syncPropertyAccessAttributes();
- }
- else if (getAccessType() == XmlAccessType.NONE) {
- this.syncNoneAccessAttributes();
- }
- }
-
- /**
- * Sync the attributes for XmlAccessType.PUBLIC_MEMBER
- * 1. all public, non-static, non-transient fields (transient modifier, @XmlTransient is brought to the context model)
- * 2. all annotated fields that aren't public
- * 3. all public getter/setter javabeans pairs
- * 4. all annotated methods (some will have a matching getter/setter, some will be standalone)
- */
- private void syncPublicMemberAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, PUBLIC_MEMBER_ACCESS_TYPE_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all persistable resource method getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistablePublicMemberAccess(getterMethod, setterMethod)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.FIELD
- * 1. all non-transient fields
- * 2. all annotated methods getters/setters
- */
- private void syncFieldAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, this.buildNonTransientNonStaticResourceFieldsFilter());
- this.syncAnnotatedPropertyAttributes(contextAttributes);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.PROPERTY
- * 1. all getter/setter javabeans pairs
- * 2. all annotated fields
- * 3. all annotated methods getters/setters that don't have a matching pair
- */
- private void syncPropertyAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, ANNOTATED_RESOURCE_FIELDS_FILTER);
-
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(this.buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (methodsArePersistableProperties(getterMethod, setterMethod)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- /**
- * Initialize the attributes for XmlAccessType.NONE
- * 1. all annotated fields
- * 2. all annotated methods getters/setters (some will have a matching getter/setter, some will be standalone)
- */
- private void syncNoneAccessAttributes() {
- HashSet<JaxbPersistentAttribute> contextAttributes = CollectionTools.set(this.getAttributes());
-
- this.syncFieldAttributes(contextAttributes, ANNOTATED_RESOURCE_FIELDS_FILTER);
- this.syncAnnotatedPropertyAttributes(contextAttributes);
- }
-
- private void syncAnnotatedPropertyAttributes(HashSet<JaxbPersistentAttribute> contextAttributes) {
- Collection<JavaResourceMethod> resourceMethods = CollectionTools.collection(this.getResourceMethods());
- //iterate through all resource methods searching for persistable getters
- for (JavaResourceMethod getterMethod : this.getResourceMethods(buildPersistablePropertyGetterMethodsFilter())) {
- JavaResourceMethod setterMethod = getValidSiblingSetMethod(getterMethod, resourceMethods);
- if (getterMethod.isAnnotated() || (setterMethod != null && setterMethod.isAnnotated())) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(getterMethod, setterMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(getterMethod, setterMethod));
- }
- }
- resourceMethods.remove(getterMethod);
- resourceMethods.remove(setterMethod);
- }
- this.syncRemainingResourceMethods(contextAttributes, resourceMethods);
- }
-
- private void syncFieldAttributes(HashSet<JaxbPersistentAttribute> contextAttributes, Filter<JavaResourceField> filter) {
- for (JavaResourceField resourceField : this.getResourceFields(filter)) {
- boolean match = false;
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext(); ) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(resourceField)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- // added elements are sync'ed during construction or will be
- // updated during the next "update" (which is triggered by
- // their addition to the model)
- this.addAttribute(this.buildField(resourceField));
- }
- }
- }
-
- private void syncRemainingResourceMethods(HashSet<JaxbPersistentAttribute> contextAttributes, Collection<JavaResourceMethod> resourceMethods) {
- //iterate through remaining resource methods and search for those that are annotated.
- //all getter methods will already be used.
- for (JavaResourceMethod resourceMethod : resourceMethods) {
- if (resourceMethod.isAnnotated()) {
- boolean match = false;
- //annotated setter(or other random method) with no corresponding getter, bring into context model for validation purposes
- for (Iterator<JaxbPersistentAttribute> stream = contextAttributes.iterator(); stream.hasNext();) {
- JaxbPersistentAttribute contextAttribute = stream.next();
- if (contextAttribute.isFor(null, resourceMethod)) {
- match = true;
- contextAttribute.update();
- stream.remove();
- break;
- }
- }
- if (!match) {
- this.addAttribute(this.buildProperty(null, resourceMethod));
- }
- }
- }
-
- // remove any leftover context attributes
- for (JaxbPersistentAttribute contextAttribute : contextAttributes) {
- this.removeAttribute(contextAttribute);
- }
- }
-
- /**
- * Return whether the specified method is a "getter" method that
- * represents a property that may be "persisted".
- */
- protected static boolean methodIsPersistablePropertyGetter(JavaResourceMethod resourceMethod, Iterable<JavaResourceMethod> allMethods) {
- if (methodHasInvalidModifiers(resourceMethod)) {
- return false;
- }
- if (resourceMethod.isConstructor()) {
- return false;
- }
-
- String returnTypeName = resourceMethod.getTypeName();
- if (returnTypeName == null) {
- return false; // DOM method bindings can have a null name
- }
- if (returnTypeName.equals("void")) { //$NON-NLS-1$
- return false;
- }
- if (methodHasParameters(resourceMethod)) {
- return false;
- }
-
- boolean booleanGetter = methodIsBooleanGetter(resourceMethod);
-
- // if the type has both methods:
- // boolean isProperty()
- // boolean getProperty()
- // then #isProperty() takes precedence and we ignore #getProperty();
- // but only having #getProperty() is OK too
- // (see the JavaBeans spec 1.01)
- if (booleanGetter && methodHasValidSiblingIsMethod(resourceMethod, allMethods)) {
- return false; // since the type also defines #isProperty(), ignore #getProperty()
- }
- return true;
- }
-
- private static boolean methodIsBooleanGetter(JavaResourceMethod resourceMethod) {
- String returnTypeName = resourceMethod.getTypeName();
- String name = resourceMethod.getMethodName();
- boolean booleanGetter = false;
- if (name.startsWith("is")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- } else {
- return false;
- }
- } else if (name.startsWith("get")) { //$NON-NLS-1$
- if (returnTypeName.equals("boolean")) { //$NON-NLS-1$
- booleanGetter = true;
- }
- } else {
- return false;
- }
- return booleanGetter;
- }
-
- /**
- * Return whether the method's modifiers prevent it
- * from being a getter or setter for a "persistent" property.
- */
- private static boolean methodHasInvalidModifiers(JavaResourceMethod resourceMethod) {
- int modifiers = resourceMethod.getModifiers();
- if (Modifier.isStatic(modifiers)) {
- return true;
- }
- return false;
- }
-
- private static boolean methodHasParameters(JavaResourceMethod resourceMethod) {
- return resourceMethod.getParametersSize() != 0;
- }
-
- /**
- * Return whether the method has a sibling "is" method for the specified
- * property and that method is valid for a "persistable" property.
- * Pre-condition: the method is a "boolean getter" (e.g. 'public boolean getProperty()');
- * this prevents us from returning true when the method itself is an
- * "is" method.
- */
- private static boolean methodHasValidSiblingIsMethod(JavaResourceMethod getMethod, Iterable<JavaResourceMethod> resourceMethods) {
- String capitalizedAttributeName = StringTools.capitalize(getMethod.getName());
- for (JavaResourceMethod sibling : resourceMethods) {
- if ((sibling.getParametersSize() == 0)
- && sibling.getMethodName().equals("is" + capitalizedAttributeName)) { //$NON-NLS-1$
- return methodIsValidSibling(sibling, "boolean"); //$NON-NLS-1$
- }
- }
- return false;
- }
-
- /**
- * Return whether the method has a sibling "set" method
- * and that method is valid for a "persistable" property.
- */
- private static JavaResourceMethod getValidSiblingSetMethod(JavaResourceMethod getMethod, Collection<JavaResourceMethod> resourceMethods) {
- String capitalizedSetAttributeName = "set" + StringTools.capitalize(getMethod.getName());//$NON-NLS-1$
- String parameterTypeErasureName = getMethod.getTypeName();
- for (JavaResourceMethod sibling : resourceMethods) {
- if ((sibling.getParametersSize() == 1)
- && sibling.getMethodName().equals(capitalizedSetAttributeName)
- && sibling.getParameterTypeName(0).equals(parameterTypeErasureName)) {
- return methodIsValidSibling(sibling, "void") ? sibling : null; //$NON-NLS-1$
- }
- }
- return null;
- }
-
- /**
- * Return whether the specified method is a valid sibling with the
- * specified return type.
- */
- private static boolean methodIsValidSibling(JavaResourceMethod resourceMethod, String returnTypeName) {
- if (resourceMethod == null) {
- return false;
- }
- if (methodHasInvalidModifiers(resourceMethod)) {
- return false;
- }
- if (resourceMethod.isConstructor()) {
- return false;
- }
- String rtName = resourceMethod.getTypeName();
- if (rtName == null) {
- return false; // DOM method bindings can have a null name
- }
- return rtName.equals(returnTypeName);
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJaxbClassMapping().getValidationTextRange(astRoot);
- }
-
-
- interface Owner {
-
- /**
- * Return the access type of the owner, to be used in determining which attributes to build
- */
- XmlAccessType getAccessType();
-
- /**
- * fire property change event for the added attribute
- */
- void fireAttributeAdded(JaxbPersistentAttribute attribute);
-
- /**
- * fire property change event for the removed attribute
- */
- void fireAttributeRemoved(JaxbPersistentAttribute attribute);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
deleted file mode 100644
index f846e4d692..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaClassMapping.java
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributesContainer;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.omg.CORBA.PUBLIC_MEMBER;
-
-
-public class GenericJavaClassMapping
- extends AbstractJavaTypeMapping
- implements JaxbClassMapping {
-
- protected String specifiedFactoryClass;
-
- protected String factoryMethod;
-
- protected final PropOrderContainer propOrderContainer;
-
- protected JaxbClassMapping superclass;
-
- protected XmlAccessType defaultAccessType;
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder defaultAccessOrder;
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected boolean hasRootElementInHierarchy_loaded = false;
- protected boolean hasRootElementInHierarchy = false;
-
- protected final JaxbAttributesContainer attributesContainer;
-
- protected final Map<JaxbClassMapping, JaxbAttributesContainer> includedAttributesContainers;
-
- public GenericJavaClassMapping(JaxbClass parent) {
- super(parent);
- this.includedAttributesContainers = new Hashtable<JaxbClassMapping, JaxbAttributesContainer>();
- this.propOrderContainer = new PropOrderContainer();
-
- initFactoryClass();
- initFactoryMethod();
- initPropOrder();
- initSpecifiedAccessType();
- initDefaultAccessType();
- initSpecifiedAccessOrder();
- initDefaultAccessOrder();
- this.attributesContainer = new GenericJavaAttributesContainer(this, buildAttributesContainerOwner(), getJavaResourceType());
- initIncludedAttributes();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- @Override
- public JaxbClass getJaxbType() {
- return (JaxbClass) super.getJaxbType();
- }
-
- public JaxbPackageInfo getPackageInfo() {
- JaxbPackage jaxbPackage = getJaxbPackage();
- // jaxb package may be null during initialization/update
- return (jaxbPackage == null) ? null : jaxbPackage.getPackageInfo();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncFactoryClass();
- syncFactoryMethod();
- syncPropOrder();
- syncSpecifiedAccessType();
- syncSpecifiedAccessOrder();
- this.attributesContainer.synchronizeWithResourceModel();
- syncIncludedAttributes();
- }
-
- @Override
- public void update() {
- super.update();
- updateSuperclass();
- updateDefaultAccessType();
- updateDefaultAccessOrder();
- this.hasRootElementInHierarchy_loaded = false; // triggers that the value must be recalculated on next request
- this.attributesContainer.update();
- updateIncludedAttributes();
- }
-
-
- // ***** factory class *****
-
- public String getFactoryClass() {
- return (this.specifiedFactoryClass != null) ? this.specifiedFactoryClass : JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS;
- }
-
- public String getSpecifiedFactoryClass() {
- return this.specifiedFactoryClass;
- }
-
- public void setSpecifiedFactoryClass(String factoryClass) {
- getXmlTypeAnnotation().setFactoryClass(factoryClass);
- setSpecifiedFactoryClass_(factoryClass);
- }
-
- protected void setSpecifiedFactoryClass_(String factoryClass) {
- String old = this.specifiedFactoryClass;
- this.specifiedFactoryClass = factoryClass;
- firePropertyChanged(SPECIFIED_FACTORY_CLASS_PROPERTY, old, factoryClass);
- }
-
- protected String getResourceFactoryClass() {
- return getXmlTypeAnnotation().getFactoryClass();
- }
-
- protected void initFactoryClass() {
- this.specifiedFactoryClass = getResourceFactoryClass();
- }
-
- protected void syncFactoryClass() {
- setSpecifiedFactoryClass_(getResourceFactoryClass());
- }
-
-
- // ***** factory method *****
-
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- getXmlTypeAnnotation().setFactoryMethod(factoryMethod);
- setFactoryMethod_(factoryMethod);
- }
-
- protected void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- protected String getResourceFactoryMethod() {
- return getXmlTypeAnnotation().getFactoryMethod();
- }
-
- protected void initFactoryMethod() {
- this.factoryMethod = getResourceFactoryMethod();
- }
-
- protected void syncFactoryMethod() {
- setFactoryMethod_(getResourceFactoryMethod());
- }
-
-
- // ***** prop order *****
-
- public ListIterable<String> getPropOrder() {
- return this.propOrderContainer.getContextElements();
- }
-
- public String getProp(int index) {
- return this.propOrderContainer.getContextElement(index);
- }
-
- public int getPropOrderSize() {
- return this.propOrderContainer.getContextElementsSize();
- }
-
- public void addProp(int index, String prop) {
- getXmlTypeAnnotation().addProp(index, prop);
- this.propOrderContainer.addContextElement(index, prop);
- }
-
- public void removeProp(String prop) {
- this.removeProp(this.propOrderContainer.indexOfContextElement(prop));
- }
-
- public void removeProp(int index) {
- this.getXmlTypeAnnotation().removeProp(index);
- this.propOrderContainer.removeContextElement(index);
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- this.getXmlTypeAnnotation().moveProp(targetIndex, sourceIndex);
- this.propOrderContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected void initPropOrder() {
- this.propOrderContainer.initialize();
- }
-
- protected void syncPropOrder() {
- this.propOrderContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<String> getResourcePropOrder() {
- ListIterable<String> result = getXmlTypeAnnotation().getPropOrder();
- if (CollectionTools.size(result) == 1 && StringTools.EMPTY_STRING.equals(CollectionTools.get(result, 0))) {
- return EmptyListIterable.instance();
- }
- return result;
- }
-
-
- // ***** XmlAccessorType *****
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.defaultAccessType;
- }
-
- public XmlAccessType getDefaultAccessType() {
- return this.defaultAccessType;
- }
-
- protected void setDefaultAccessType_(XmlAccessType access) {
- XmlAccessType old = this.defaultAccessType;
- this.defaultAccessType = access;
- firePropertyChanged(DEFAULT_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- public XmlAccessType getSpecifiedAccessType() {
- return this.specifiedAccessType;
- }
-
- public void setSpecifiedAccessType(XmlAccessType access) {
- getXmlAccessorTypeAnnotation().setValue(XmlAccessType.toJavaResourceModel(access));
- setSpecifiedAccessType_(access);
- }
-
- protected void setSpecifiedAccessType_(XmlAccessType access) {
- XmlAccessType old = this.specifiedAccessType;
- this.specifiedAccessType = access;
- firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- protected void initDefaultAccessType() {
- this.defaultAccessType = buildDefaultAccessType();
- }
-
- protected void updateDefaultAccessType() {
- setDefaultAccessType_(buildDefaultAccessType());
- }
-
- /**
- * Default access type is determined by the following, in order of precedence:
- * - @XmlAccessorType annotation on a mapped super class
- * - @XmlAccessorType annotation on the package
- * - default access type of {@link PUBLIC_MEMBER}
- */
- protected XmlAccessType buildDefaultAccessType() {
- XmlAccessType accessType = getSuperclassAccessType();
- if (accessType != null) {
- return accessType;
- }
- accessType = getPackageAccessType();
- if (accessType != null) {
- return accessType;
- }
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getSuperclassAccessType() {
- return this.superclass == null ? null : this.superclass.getSpecifiedAccessType();
- }
-
- protected XmlAccessType getPackageAccessType() {
- JaxbPackageInfo packageInfo = getPackageInfo();
- return (packageInfo == null) ? null : packageInfo.getAccessType();
- }
-
- protected XmlAccessorTypeAnnotation getXmlAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE);
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(getXmlAccessorTypeAnnotation().getValue());
- }
-
- protected void initSpecifiedAccessType() {
- this.specifiedAccessType = getResourceAccessType();
- }
-
- protected void syncSpecifiedAccessType() {
- setSpecifiedAccessType_(getResourceAccessType());
- }
-
-
- // ***** XmlAccessorOrder *****
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.defaultAccessOrder;
- }
-
- public XmlAccessOrder getDefaultAccessOrder() {
- return this.defaultAccessOrder;
- }
-
- protected void setDefaultAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.defaultAccessOrder;
- this.defaultAccessOrder = accessOrder;
- firePropertyChanged(DEFAULT_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- public XmlAccessOrder getSpecifiedAccessOrder() {
- return this.specifiedAccessOrder;
- }
-
- public void setSpecifiedAccessOrder(XmlAccessOrder accessOrder) {
- getXmlAccessorOrderAnnotation().setValue(XmlAccessOrder.toJavaResourceModel(accessOrder));
- setSpecifiedAccessOrder_(accessOrder);
- }
-
- protected void setSpecifiedAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.specifiedAccessOrder;
- this.specifiedAccessOrder = accessOrder;
- firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- protected void initDefaultAccessOrder() {
- this.defaultAccessOrder = buildDefaultAccessOrder();
- }
-
- protected void updateDefaultAccessOrder() {
- setDefaultAccessOrder_(buildDefaultAccessOrder());
- }
-
- /**
- * Default access order is determined by the following, in order of precedence:
- * - @XmlAccessorOrder annotation on a mapped super class
- * - @XmlAccessorOrder annotation on the package
- * - default access order of {@link UNDEFINED}
- */
- protected XmlAccessOrder buildDefaultAccessOrder() {
- XmlAccessOrder accessOrder = getSuperclassAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- accessOrder = getPackageAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getSuperclassAccessOrder() {
- JaxbClassMapping superclass = this.superclass;
- while (superclass != null) {
- XmlAccessOrder accessOrder = superclass.getSpecifiedAccessOrder();
- if (accessOrder != null) {
- return accessOrder;
- }
- superclass = superclass.getSuperclass();
- }
- return null;
- }
-
- protected XmlAccessOrder getPackageAccessOrder() {
- JaxbPackageInfo packageInfo = getPackageInfo();
- return packageInfo == null ? null : packageInfo.getAccessOrder();
- }
-
- protected XmlAccessorOrderAnnotation getXmlAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER);
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(getXmlAccessorOrderAnnotation().getValue());
- }
-
- protected void initSpecifiedAccessOrder() {
- this.specifiedAccessOrder = getResourceAccessOrder();
- }
-
- protected void syncSpecifiedAccessOrder() {
- setSpecifiedAccessOrder_(getResourceAccessOrder());
- }
-
-
- // ********** super class **********
-
- public JaxbClassMapping getSuperclass() {
- return this.superclass;
- }
-
- protected void setSuperclass_(JaxbClassMapping superclass) {
- JaxbClassMapping old = this.superclass;
- this.superclass = superclass;
- this.firePropertyChanged(SUPERCLASS_PROPERTY, old, superclass);
- }
-
- protected void updateSuperclass() {
- setSuperclass_(findSuperclass());
- }
-
- protected JaxbClassMapping findSuperclass() {
- JavaResourceType resourceType = getSuperclass(getJavaResourceType());
- while (resourceType != null && resourceType != this) {
- JaxbType jaxbType = getJaxbProject().getContextRoot().getType(resourceType.getQualifiedName());
-
- // if the superclass is not a class, return null
- if (jaxbType == null || jaxbType.getKind() != JaxbType.Kind.CLASS) {
- return null;
- }
-
- JaxbClassMapping jaxbClassMapping = ((JaxbClass) jaxbType).getMapping();
- // rare for a non-null superclass to not be mapped, but potentially possible mid-update
- if (jaxbClassMapping != null) {
- return jaxbClassMapping;
- }
- else {
- resourceType = getSuperclass(resourceType);
- }
- }
- return null;
- }
-
- protected JavaResourceType getSuperclass(JavaResourceType resourceType) {
- String superclassName = resourceType.getSuperclassQualifiedName();
- if (superclassName == null) {
- return null;
- }
-
- return (JavaResourceType) getJaxbProject().getJavaResourceType(
- superclassName, JavaResourceType.Kind.TYPE);
- }
-
-
- // ***** attributes *****
-
- public Iterable<JaxbPersistentAttribute> getAttributes() {
- return this.attributesContainer.getAttributes();
- }
-
- public int getAttributesSize() {
- return this.attributesContainer.getAttributesSize();
- }
-
- protected GenericJavaAttributesContainer.Owner buildAttributesContainerOwner() {
- return new GenericJavaAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaClassMapping.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemAdded(ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemRemoved(ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ***** included attributes *****
-
- public Iterable<JaxbPersistentAttribute> getIncludedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(getIncludedAttributeSets());
- }
-
- protected Iterable<Iterable<JaxbPersistentAttribute>> getIncludedAttributeSets() {
- return new TransformationIterable<JaxbAttributesContainer, Iterable<JaxbPersistentAttribute>>(
- getIncludedAttributesContainers()) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbAttributesContainer attributesContainer) {
- return attributesContainer.getAttributes();
- }
- };
- }
-
- protected Iterable<JaxbAttributesContainer> getIncludedAttributesContainers() {
- return new LiveCloneIterable<JaxbAttributesContainer>(this.includedAttributesContainers.values()); // read-only
- }
-
- public int getIncludedAttributesSize() {
- int size = 0;
- for (JaxbAttributesContainer attributesContainer : getIncludedAttributesContainers()) {
- size += attributesContainer.getAttributesSize();
- }
- return size;
- }
-
- protected void initIncludedAttributes() {
- // xml transient classes have no included attributes
- if (isXmlTransient()) {
- return;
- }
- JaxbClassMapping superclass = this.superclass;
- // only add inherited attributes for superclasses up until a mapped class is encountered
- while (superclass != null && superclass.isXmlTransient()) {
- this.includedAttributesContainers.put(superclass, buildIncludedAttributesContainer(superclass));
- superclass = superclass.getSuperclass();
- }
- }
-
- protected void syncIncludedAttributes() {
- for (JaxbAttributesContainer attributesContainer : this.includedAttributesContainers.values()) {
- attributesContainer.synchronizeWithResourceModel();
- }
- }
-
- protected void updateIncludedAttributes() {
- HashSet<JaxbClassMapping> oldSuperclasses
- = CollectionTools.set(this.includedAttributesContainers.keySet());
- Set<JaxbPersistentAttribute> oldAttributes = CollectionTools.set(getIncludedAttributes());
-
- if (! isXmlTransient()) {
- JaxbClassMapping superclass = this.superclass;
- // only add inherited attributes for superclasses up until a mapped class is encountered
- while (superclass != null && superclass.isXmlTransient()) {
- if (this.includedAttributesContainers.containsKey(superclass)) {
- this.includedAttributesContainers.get(superclass).update();
- oldSuperclasses.remove(superclass);
- }
- else {
- this.includedAttributesContainers.put(superclass, buildIncludedAttributesContainer(superclass));
- }
- superclass = superclass.getSuperclass();
- }
- }
-
- for (JaxbClassMapping oldSuperclass : oldSuperclasses) {
- this.includedAttributesContainers.remove(oldSuperclass);
- }
-
- Set<JaxbPersistentAttribute> newAttributes = CollectionTools.set(getIncludedAttributes());
- if (CollectionTools.elementsAreDifferent(oldAttributes, newAttributes)) {
- fireCollectionChanged(INCLUDED_ATTRIBUTES_COLLECTION, newAttributes);
- }
- }
-
- protected JaxbAttributesContainer buildIncludedAttributesContainer(JaxbClassMapping jaxbClassMapping) {
- return new GenericJavaAttributesContainer(this, buildIncludedAttributesContainerOwner(), jaxbClassMapping.getJaxbType().getJavaResourceType());
- }
-
- protected GenericJavaAttributesContainer.Owner buildIncludedAttributesContainerOwner() {
- return new GenericJavaAttributesContainer.Owner() {
- public XmlAccessType getAccessType() {
- return GenericJavaClassMapping.this.getAccessType();
- }
-
- public void fireAttributeAdded(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemAdded(INCLUDED_ATTRIBUTES_COLLECTION, attribute);
- }
-
- public void fireAttributeRemoved(JaxbPersistentAttribute attribute) {
- GenericJavaClassMapping.this.fireItemRemoved(INCLUDED_ATTRIBUTES_COLLECTION, attribute);
- }
- };
- }
-
-
- // ***** misc attributes *****
-
- public Iterable<JaxbPersistentAttribute> getAllLocallyDefinedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getAttributes(),
- getIncludedAttributes());
- }
-
- public Iterable<JaxbPersistentAttribute> getInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getIncludedAttributes(),
- getOtherInheritedAttributes());
- }
-
- public Iterable<JaxbPersistentAttribute> getAllAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- getAttributes(),
- getIncludedAttributes(),
- getOtherInheritedAttributes());
- }
-
- /**
- * return those inherited attributes that are not included
- */
- protected Iterable<JaxbPersistentAttribute> getOtherInheritedAttributes() {
- return new CompositeIterable<JaxbPersistentAttribute>(
- new TransformationIterable<JaxbClassMapping, Iterable<JaxbPersistentAttribute>>(
- new ChainIterable<JaxbClassMapping>(getSuperclass()) {
- @Override
- protected JaxbClassMapping nextLink(JaxbClassMapping currentLink) {
- return currentLink.getSuperclass();
- }
- }) {
- @Override
- protected Iterable<JaxbPersistentAttribute> transform(JaxbClassMapping o) {
- return o.getAttributes();
- }
- });
- }
-
-
- // ***** subClasses *****
-
- @Override
- public boolean hasRootElementInHierarchy() {
- if (! this.hasRootElementInHierarchy_loaded) {
- this.hasRootElementInHierarchy = calculateHasRootElementInHierarchy();
- this.hasRootElementInHierarchy_loaded = true;
- }
- return this.hasRootElementInHierarchy;
- }
-
- protected boolean calculateHasRootElementInHierarchy() {
- if (this.getXmlRootElement() != null) {
- return true;
- }
-
- for (JaxbType jaxbType : getJaxbProject().getContextRoot().getTypes()) {
- if (jaxbType.getMapping() != null
- && ! jaxbType.getMapping().isXmlTransient()
- && jaxbType.getMapping().getXmlRootElement() != null
- && JDTTools.typeIsSubType(
- getJaxbProject().getJavaProject(),
- jaxbType.getFullyQualifiedName(), getJaxbType().getFullyQualifiedName())) {
- return true;
- }
- }
-
- return false;
- }
-
-
- // ***** misc *****
-
- @Override
- protected Iterable<String> getTransientReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()));
- }
-
- @Override
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getNonTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getJavaResourceType().getSuperclassQualifiedName()),
- new CompositeIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, Iterable<String>>(getAttributes()) {
- @Override
- protected Iterable<String> transform(JaxbPersistentAttribute o) {
- return o.getMapping().getReferencedXmlTypeNames();
- }
- }));
- }
-
- public JaxbAttributeMapping getXmlIdMapping() {
- Iterator<XmlNamedNodeMapping> allXmlIdMappings =
- new FilteringIterable<XmlNamedNodeMapping>(
- new SubIterableWrapper<JaxbAttributeMapping, XmlNamedNodeMapping>(
- new FilteringIterable<JaxbAttributeMapping>(
- new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(getAllAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute o) {
- return o.getMapping();
- }
- }) {
- @Override
- protected boolean accept(JaxbAttributeMapping o) {
- return (o.getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY
- || o.getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- }
- })) {
- @Override
- protected boolean accept(XmlNamedNodeMapping o) {
- return o.getXmlID() != null;
- }
- }.iterator();
- return (allXmlIdMappings.hasNext()) ? allXmlIdMappings.next() : null;
- }
-
- protected Iterable<? extends JaxbAttributeMapping> getAttributeMappings() {
- return new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(getAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute attribute) {
- return attribute.getMapping();
- }
- };
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (propTouches(pos, astRoot)) {
- return getPropProposals(filter);
- }
-
- // TODO - factory methods?
-
- for (JaxbPersistentAttribute attribute : this.getAttributes()) {
- result = attribute.getJavaCompletionProposals(pos, filter, astRoot);
- if (!CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getPropProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<JaxbPersistentAttribute, String>(getAllLocallyDefinedAttributes()) {
- @Override
- protected String transform(JaxbPersistentAttribute o) {
- return o.getName();
- }
- },
- filter));
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateConstructor(messages, reporter, astRoot);
- validatePropOrder(messages, reporter, astRoot);
- validateXmlAnyAttributeMapping(messages, astRoot);
- validateXmlAnyElementMapping(messages, astRoot);
- validateXmlValueMapping(messages, astRoot);
- validateXmlIDs(messages, astRoot);
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- attribute.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateConstructor(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // TODO - factory class/method
-
- if (! JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS.equals(getFactoryClass())) {
- if (StringTools.stringIsEmpty(getFactoryMethod())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__UNSPECIFIED_FACTORY_METHOD,
- this,
- getFactoryClassTextRange(astRoot)));
- }
- }
- else {
- if (getFactoryMethod() == null
- && getJaxbType().getXmlJavaTypeAdapter() == null
- && ! getJavaResourceType().hasPublicOrProtectedNoArgConstructor()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- }
-
- protected void validatePropOrder(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (CollectionTools.isEmpty(getPropOrder())) {
- return;
- }
-
- // no duplicates
- // all attributes/included attributes with XmlElement/s/Ref/s must be listed
- // no nonexistent attributes (attributes mapped otherwise allowed) ...
- // *except* no transient attributes allowed
-
- Bag<String> props = CollectionTools.bag(getPropOrder());
- Set<String> allAttributes = new HashSet<String>();
- Set<String> requiredAttributes = new HashSet<String>();
- Set<String> transientAttributes = new HashSet<String>();
-
- for (JaxbPersistentAttribute attribute : getAllLocallyDefinedAttributes()) {
- allAttributes.add(attribute.getName());
- transientAttributes.add(attribute.getName());
- }
-
- for (JaxbPersistentAttribute attribute : getAllLocallyDefinedAttributes()) {
- if (attribute.getMapping().isParticleMapping()) {
- requiredAttributes.add(attribute.getName());
- }
-
- if (! attribute.getMapping().isTransient()) {
- // remove transients (rather than previous algorithm of adding them)
- // there may be two attributes of the same name (one field, one property) in
- // a class, which is a correct configuration. we want to know if *every* attribute
- // of a given name is transient (or if there's a single non-transient attribute)
- transientAttributes.remove(attribute.getName());
- }
- }
-
- Set<Integer> duplicateProps = new HashSet<Integer>();
- Set<String> missingProps = new HashSet<String>(requiredAttributes);
- Set<Integer> nonexistentProps = new HashSet<Integer>();
- Set<Integer> transientProps = new HashSet<Integer>();
-
- for (int i = 0; i < getPropOrderSize(); i ++ ) {
- String prop = getProp(i);
-
- if (props.count(prop) > 1) {
- duplicateProps.add(i);
- }
-
- if (missingProps.contains(prop)) {
- missingProps.remove(prop);
- }
-
- if (! allAttributes.contains(prop)) {
- nonexistentProps.add(i);
- }
-
- if (transientAttributes.contains(prop)) {
- transientProps.add(i);
- }
- }
-
- for (int i : duplicateProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__DUPLICATE_PROP,
- new String[] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
-
- for (String missingProp : missingProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__MISSING_PROP,
- new String[] { missingProp },
- this,
- getPropOrderTextRange(astRoot)));
- }
-
- for (int i : nonexistentProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__NONEXISTENT_PROP,
- new String[] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
-
- for (int i : transientProps) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_TYPE__TRANSIENT_PROP,
- new String [] { getProp(i) },
- this,
- getPropTextRange(i, astRoot)));
- }
- }
-
- protected void validateXmlAnyAttributeMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlAnyElementMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlValueMapping(List<IMessage> messages, CompilationUnit astRoot) {
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if (attribute.getMappingKey() == MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected void validateXmlIDs(List<IMessage> messages, CompilationUnit astRoot) {
-
- Set<JaxbPersistentAttribute> localAttributes = new HashSet<JaxbPersistentAttribute>();
- Set<JaxbPersistentAttribute> allAttributes = new HashSet<JaxbPersistentAttribute>();
-
- for (JaxbPersistentAttribute attribute : getAttributes()) {
- if ((attribute.getMappingKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- || attribute.getMappingKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY)
- && ((XmlNamedNodeMapping) attribute.getMapping()).getXmlID() != null) {
- localAttributes.add(attribute);
- allAttributes.add(attribute);
- }
- }
-
- for (JaxbPersistentAttribute attribute : getInheritedAttributes()) {
- if ((attribute.getMappingKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY
- || attribute.getMappingKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY)
- && ((XmlNamedNodeMapping) attribute.getMapping()).getXmlID() != null) {
- allAttributes.add(attribute);
- }
- }
-
- if (allAttributes.size() > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED,
- this,
- getValidationTextRange(astRoot)));
-
- for (JaxbPersistentAttribute anyAttribute : localAttributes) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__MULTIPLE_MAPPINGS_DEFINED,
- anyAttribute.getMapping(),
- anyAttribute.getMapping().getValidationTextRange(astRoot)));
- }
- }
- }
-
- protected TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getFactoryClassTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getFactoryMethodTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- TextRange result = getXmlTypeAnnotation().getPropOrderTextRange(astRoot);
- return (result != null) ? result : getValidationTextRange(astRoot);
- }
-
- protected TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getXmlTypeAnnotation().getPropTextRange(index, astRoot);
- }
-
- protected boolean propTouches(int pos, CompilationUnit astRoot) {
- if (getXmlTypeAnnotation().propOrderTouches(pos, astRoot)) {
- for (int i = 0; i < getXmlTypeAnnotation().getPropOrderSize(); i ++ ) {
- if (getXmlTypeAnnotation().propTouches(i, pos, astRoot)) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- /**
- * xml prop order container
- */
- protected class PropOrderContainer
- extends ListContainer<String, String> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return PROP_ORDER_LIST;
- }
-
- @Override
- protected String buildContextElement(String resourceElement) {
- return resourceElement;
- }
-
- @Override
- protected ListIterable<String> getResourceElements() {
- return GenericJavaClassMapping.this.getResourcePropOrder();
- }
-
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
deleted file mode 100644
index 61e1c75034..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaElementFactoryMethod.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaElementFactoryMethod
- extends AbstractJavaContextNode
- implements JaxbElementFactoryMethod {
-
- protected final JavaResourceMethod resourceMethod;
-
- protected String scope;
-
- protected JaxbQName qName;
-
- protected JaxbQName substitutionHeadQName;
-
- protected String defaultValue;
-
-
- public GenericJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- super(parent);
- this.resourceMethod = resourceMethod;
- this.scope = getResourceScope();
- this.qName = buildQName();
- this.substitutionHeadQName = buildSubstitutionHeadQName();
- this.defaultValue = this.getResourceDefaultValue();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlElementDeclQName(this);
- }
-
- protected JaxbQName buildSubstitutionHeadQName() {
- return new XmlElementDeclSubstitutionHeadQName(this);
- }
-
- protected XmlRegistry getRegistry() {
- return (XmlRegistry) getParent();
- }
-
- public JavaResourceMethod getResourceMethod() {
- return this.resourceMethod;
- }
-
- protected XmlElementDeclAnnotation getXmlElementDeclAnnotation() {
- return (XmlElementDeclAnnotation) getResourceMethod().getAnnotation(JAXB.XML_ELEMENT_DECL);
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setScope_(getResourceScope());
- this.qName.synchronizeWithResourceModel();
- this.substitutionHeadQName.synchronizeWithResourceModel();
- setDefaultValue_(getResourceDefaultValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- this.substitutionHeadQName.update();
- }
-
-
- // ***** JaxbElementFactoryMethod impl *****
-
- public String getName() {
- return this.resourceMethod.getName();
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- protected void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- firePropertyChanged(SCOPE_PROPERTY, old, scope);
- }
-
- public void setScope(String scope) {
- getXmlElementDeclAnnotation().setScope(scope);
- setScope_(scope);
- }
-
- protected String getResourceScope() {
- return getXmlElementDeclAnnotation().getScope();
- }
-
- public String getFullyQualifiedScope() {
- return (this.scope == null) ? DEFAULT_SCOPE_CLASS_NAME : getXmlElementDeclAnnotation().getFullyQualifiedScopeClassName();
- }
-
- public boolean isGlobalScope() {
- return DEFAULT_SCOPE_CLASS_NAME.equals(getFullyQualifiedScope());
- }
-
-
- // ***** qname *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- // ***** substitution head qname *****
-
- public JaxbQName getSubstitutionHeadQName() {
- return this.substitutionHeadQName;
- }
-
-
- // ***** default value *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- public void setDefaultValue(String defaultValue) {
- getXmlElementDeclAnnotation().setDefaultValue(defaultValue);
- setDefaultValue_(defaultValue);
- }
-
- protected String getResourceDefaultValue() {
- return getXmlElementDeclAnnotation().getDefaultValue();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.substitutionHeadQName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlElementDeclAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- this.substitutionHeadQName.validate(messages, reporter, astRoot);
-
- JavaResourceMethod resourceMethod = getResourceMethod();
- validateMethodReturnType(resourceMethod, messages, astRoot);
-
- if (resourceMethod.getParametersSize() != 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected void validateMethodReturnType(
- JavaResourceMethod resourceMethod, List<IMessage> messages, CompilationUnit astRoot) {
-
- if (! JAXB.JAXB_ELEMENT.equals(resourceMethod.getTypeName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
-
- protected class XmlElementDeclQName
- extends AbstractJavaQName {
-
- protected XmlElementDeclQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaElementFactoryMethod.this.getRegistry().getJaxbClass().getJaxbPackage();
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType != null) {
- return xsdType.getElementNameProposals(getNamespace(), filter, true);
- }
- }
- }
-
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- return xsdSchema.getElementNameProposals(getNamespace(), filter);
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema xsdSchema = this.getXsdSchema();
- return (xsdSchema == null) ? EmptyIterable.<String>instance() : xsdSchema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! GenericJavaElementFactoryMethod.this.isGlobalScope()) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType == null) {
- return;
- }
-
- if (xsdType.getElement(getNamespace(), getName(), true) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- else {
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaElementFactoryMethod.this.getXmlElementDeclAnnotation();
- }
- }
-
-
- protected class XmlElementDeclSubstitutionHeadQName
- extends AbstractJavaQName {
-
- protected XmlElementDeclSubstitutionHeadQName(JavaContextNode parent) {
- super(parent, new SubstitutionHeadQNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaElementFactoryMethod.this.getRegistry().getJaxbClass().getJaxbPackage();
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- String fqScope = GenericJavaElementFactoryMethod.this.getFullyQualifiedScope();
- JaxbTypeMapping scopeTypeMapping =
- GenericJavaElementFactoryMethod.this.getJaxbProject().getContextRoot().getTypeMapping(fqScope);
- if (scopeTypeMapping != null) {
- XsdTypeDefinition xsdType = scopeTypeMapping.getXsdTypeDefinition();
- if (xsdType != null) {
- return xsdType.getElementNameProposals(getNamespace(), filter);
- }
- }
-
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- return xsdSchema.getElementNameProposals(getNamespace(), filter);
- }
-
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema xsdSchema = this.getXsdSchema();
- return (xsdSchema == null) ? EmptyIterable.<String>instance() : xsdSchema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.SUBSTITUTION_HEAD_DESC;
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // need to ignore the unspecified (null) case
- if ("".equals(getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.QNAME__MISSING_NAME,
- new String[] { getReferencedComponentTypeDescription() },
- this,
- getNameTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(getName())) {
- if (Tools.valuesAreEqual(getName(), GenericJavaElementFactoryMethod.this.getQName().getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME,
- this,
- getNameTextRange(astRoot)));
- }
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdSchema xsdSchema = this.getXsdSchema();
- if (xsdSchema != null) {
- if (xsdSchema.getElementDeclaration(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
-
- for (JaxbElementFactoryMethod elementDecl : GenericJavaElementFactoryMethod.this.getRegistry().getElementFactoryMethods()) {
- if (Tools.valuesAreEqual(getName(), elementDecl.getSubstitutionHeadQName().getName())
- && Tools.valuesAreEqual(getNamespace(), elementDecl.getSubstitutionHeadQName().getNamespace())) {
- return;
- }
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL,
- new String[] { getNamespace(), getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
-
- protected class SubstitutionHeadQNameAnnotationProxy
- implements AbstractJavaQName.AnnotationProxy {
-
- protected XmlElementDeclAnnotation getAnnotation() {
- return GenericJavaElementFactoryMethod.this.getXmlElementDeclAnnotation();
- }
-
- public String getNamespace() {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return annotation == null ? null : annotation.getSubstitutionHeadNamespace();
- }
-
- public void setNamespace(String newSpecifiedNamespace) {
- getAnnotation().setSubstitutionHeadNamespace(newSpecifiedNamespace);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNamespaceTouches(pos, astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNamespaceTextRange(astRoot);
- }
-
- public String getName() {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return annotation == null ? null : annotation.getSubstitutionHeadName();
- }
-
- public void setName(String newSpecifiedName) {
- getAnnotation().setSubstitutionHeadName(newSpecifiedName);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? false : annotation.substitutionHeadNameTouches(pos, astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- XmlElementDeclAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getSubstitutionHeadNameTextRange(astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
deleted file mode 100644
index 479ee45894..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaEnumConstant
- extends AbstractJavaContextNode
- implements JaxbEnumConstant {
-
- final protected JavaResourceEnumConstant resourceEnumConstant;
-
- protected String specifiedValue;
-
- public GenericJavaEnumConstant(JaxbEnumMapping parent, JavaResourceEnumConstant resourceEnumConstant) {
- super(parent);
- this.resourceEnumConstant = resourceEnumConstant;
- this.specifiedValue = this.getResourceEnumValue();
- }
-
-
- protected JaxbEnumMapping getEnumMapping() {
- return (JaxbEnumMapping) getParent();
- }
-
- public JavaResourceEnumConstant getResourceEnumConstant() {
- return this.resourceEnumConstant;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedValue_(this.getResourceEnumValue());
- }
-
-
- // ********** xml enum value annotation **********
-
- protected XmlEnumValueAnnotation getXmlEnumValueAnnotation() {
- return (XmlEnumValueAnnotation) this.getResourceEnumConstant().getNonNullAnnotation(JAXB.XML_ENUM_VALUE);
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.resourceEnumConstant.getName();
- }
-
- // ********** value **********
-
- public String getValue() {
- return this.getSpecifiedValue() != null ? this.getSpecifiedValue() : this.getDefaultValue();
- }
-
- public String getDefaultValue() {
- return this.getName();
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String value) {
- this.getXmlEnumValueAnnotation().setValue(value);
- this.setSpecifiedValue_(value);
- }
-
- protected void setSpecifiedValue_(String value) {
- String old = this.specifiedValue;
- this.specifiedValue = value;
- this.firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, value);
- }
-
- protected String getResourceEnumValue() {
- return this.getXmlEnumValueAnnotation().getValue();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (valueTouches(pos, astRoot)) {
- XsdTypeDefinition<?> xsdType = getEnumMapping().getXsdTypeDefinition();
- if (xsdType != null && xsdType.getKind() == XsdTypeDefinition.Kind.SIMPLE) {
- XsdSimpleTypeDefinition xsdSimpleType = (XsdSimpleTypeDefinition) xsdType;
- return xsdSimpleType.getEnumValueProposals(filter);
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean valueTouches(int pos, CompilationUnit astRoot) {
- return getXmlEnumValueAnnotation().valueTouches(pos, astRoot);
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String value = getValue();
- XsdTypeDefinition<?> xsdType = getEnumMapping().getXsdTypeDefinition();
-
- if (xsdType == null || xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- return;
- }
-
- if (! ((XsdSimpleTypeDefinition) xsdType).getXSDComponent().isValidLiteral(value)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ENUM_VALUE__INVALID_LEXICAL_VALUE,
- new String[] { value, xsdType.getName() },
- this,
- getValueTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceEnumConstant().getTextRange(astRoot);
- }
-
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
- TextRange enumValueTextRange = getXmlEnumValueAnnotation().getValueTextRange(astRoot);
- return enumValueTextRange != null ? enumValueTextRange : getValidationTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
deleted file mode 100644
index e664e53b6e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumMapping.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaEnumMapping
- extends AbstractJavaTypeMapping
- implements JaxbEnumMapping {
-
- protected String specifiedXmlEnumValue;
-
- protected final EnumConstantContainer enumConstantContainer;
-
-
- public GenericJavaEnumMapping(JaxbEnum parent) {
- super(parent);
- this.enumConstantContainer = new EnumConstantContainer();
-
- initXmlEnumValue();
- initEnumConstants();
- }
-
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
-
- // ********** sync/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlEnumValue();
- syncEnumConstants();
- }
-
- @Override
- public void update() {
- super.update();
- updateEnumConstants();
- }
-
-
- // ***** XmlEnum.value *****
-
- public String getXmlEnumValue() {
- return (this.specifiedXmlEnumValue != null) ? this.specifiedXmlEnumValue : DEFAULT_XML_ENUM_VALUE;
- }
-
- public String getSpecifiedXmlEnumValue() {
- return this.specifiedXmlEnumValue;
- }
-
- public void setSpecifiedXmlEnumValue(String xmlEnumValue) {
- getXmlEnumAnnotation().setValue(xmlEnumValue);
- setSpecifiedXmlEnumValue_(xmlEnumValue);
- }
-
- protected void setSpecifiedXmlEnumValue_(String xmlEnumValue) {
- String old = this.specifiedXmlEnumValue;
- this.specifiedXmlEnumValue = xmlEnumValue;
- firePropertyChanged(SPECIFIED_XML_ENUM_VALUE_PROPERTY, old, xmlEnumValue);
- }
-
- public String getFullyQualifiedXmlEnumValue() {
- return (this.specifiedXmlEnumValue != null) ?
- getXmlEnumAnnotation().getFullyQualifiedValueClassName()
- : DEFAULT_XML_ENUM_VALUE;
- }
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ENUM);
- }
-
- protected String getResourceXmlEnumValue() {
- return getXmlEnumAnnotation().getValue();
- }
-
- protected void initXmlEnumValue() {
- this.specifiedXmlEnumValue = getResourceXmlEnumValue();
- }
-
- protected void syncXmlEnumValue() {
- setSpecifiedXmlEnumValue_(getResourceXmlEnumValue());
- }
-
-
- // ***** enum constants *****
-
- public Iterable<JaxbEnumConstant> getEnumConstants() {
- return this.enumConstantContainer.getContextElements();
- }
-
- public int getEnumConstantsSize() {
- return this.enumConstantContainer.getContextElementsSize();
- }
-
- protected void initEnumConstants() {
- this.enumConstantContainer.initialize();
- }
-
- protected void syncEnumConstants() {
- this.enumConstantContainer.synchronizeWithResourceModel();
- }
-
- protected void updateEnumConstants() {
- this.enumConstantContainer.update();
- }
-
- protected Iterable<JavaResourceEnumConstant> getResourceEnumConstants() {
- return getJavaResourceType().getEnumConstants();
- }
-
- private JaxbEnumConstant buildEnumConstant(JavaResourceEnumConstant resourceEnumConstant) {
- return getFactory().buildJavaEnumConstant(this, resourceEnumConstant);
- }
-
-
- // ***** misc *****
-
- @Override
- protected Iterable<String> getNonTransientReferencedXmlTypeNames() {
- if (this.specifiedXmlEnumValue != null) {
- return new CompositeIterable<String>(
- super.getNonTransientReferencedXmlTypeNames(),
- new SingleElementIterable(getFullyQualifiedXmlEnumValue()));
- }
- return super.getNonTransientReferencedXmlTypeNames();
- }
-
- public XsdSimpleTypeDefinition getValueXsdTypeDefinition() {
- XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
- if (xsdType == null || xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- return null;
- }
- return (XsdSimpleTypeDefinition) xsdType;
- }
-
- protected XsdTypeDefinition getValueXsdTypeDefinition_() {
- String fqXmlEnumValue = getFullyQualifiedXmlEnumValue();
-
- JaxbType jaxbType = getContextRoot().getType(fqXmlEnumValue);
- if (jaxbType != null) {
- JaxbTypeMapping typeMapping = jaxbType.getMapping();
- if (typeMapping != null) {
- return typeMapping.getXsdTypeDefinition();
- }
- }
- else {
- String typeMapping = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(fqXmlEnumValue);
- if (typeMapping != null) {
- XsdSchema xsdSchema = XsdUtil.getSchemaForSchema();
- return xsdSchema.getTypeDefinition(typeMapping);
- }
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (JaxbEnumConstant constant : getEnumConstants()) {
- result = constant.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateXmlType(messages, reporter, astRoot);
- validateXmlEnum(messages, reporter, astRoot);
-
- for (JaxbEnumConstant constant : getEnumConstants()) {
- constant.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XmlTypeAnnotation annotation = getXmlTypeAnnotation();
-
- if (annotation.getFactoryClass() != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM,
- this,
- annotation.getFactoryClassTextRange(astRoot)));
- }
-
- if (annotation.getFactoryMethod() != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM,
- this,
- annotation.getFactoryMethodTextRange(astRoot)));
- }
-
- if (! CollectionTools.isEmpty(annotation.getPropOrder())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JaxbValidationMessages.XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM,
- this,
- annotation.getPropOrderTextRange(astRoot)));
- }
- }
-
- protected void validateXmlEnum(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdSchema xsdSchema = getJaxbPackage().getXsdSchema();
- XsdTypeDefinition xsdType = getValueXsdTypeDefinition_();
-
- if ((xsdSchema != null && xsdType == null)
- || (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ENUM__NON_SIMPLE_SCHEMA_TYPE,
- new String[] { getFullyQualifiedXmlEnumValue() },
- this,
- getXmlEnumValueTextRange(astRoot)));
- }
- }
-
- protected TextRange getXmlEnumValueTextRange(CompilationUnit astRoot) {
- return getXmlEnumAnnotation().getValueTextRange(astRoot);
- }
-
-
- /**
- * enum constant container adapter
- */
- protected class EnumConstantContainer
- extends ContextCollectionContainer<JaxbEnumConstant, JavaResourceEnumConstant> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return ENUM_CONSTANTS_COLLECTION;
- }
-
- @Override
- protected JaxbEnumConstant buildContextElement(JavaResourceEnumConstant resourceElement) {
- return GenericJavaEnumMapping.this.buildEnumConstant(resourceElement);
- }
-
- @Override
- protected Iterable<JavaResourceEnumConstant> getResourceElements() {
- return GenericJavaEnumMapping.this.getResourceEnumConstants();
- }
-
- @Override
- protected JavaResourceEnumConstant getResourceElement(JaxbEnumConstant contextElement) {
- return contextElement.getResourceEnumConstant();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java
deleted file mode 100644
index 05a0a9d496..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbClass.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaJaxbClass
- extends AbstractJavaType
- implements JaxbClass {
-
- protected XmlRegistry xmlRegistry;
-
-
- public GenericJavaJaxbClass(JaxbContextNode parent, JavaResourceType resourceType) {
- super(parent, resourceType);
- initXmlRegistry();
- }
-
-
- @Override
- public JavaResourceType getJavaResourceType() {
- return (JavaResourceType) super.getJavaResourceType();
- }
-
- public Kind getKind() {
- return JaxbType.Kind.CLASS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlRegistry();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlRegistry();
- }
-
-
- // ***** mapping *****
-
- @Override
- public JaxbClassMapping getMapping() {
- return (JaxbClassMapping) super.getMapping();
- }
-
- @Override
- protected JaxbClassMapping buildMapping() {
- return getFactory().buildJaxbClassMapping(this);
- }
-
- @Override
- protected boolean isSpecifiedMapped() {
- return getXmlTypeAnnotation() != null
- || getXmlRootElementAnnotation() != null
- || getXmlTransientAnnotation() != null;
- }
-
-
- // ***** XmlRegistry *****
-
- public XmlRegistry getXmlRegistry() {
- return this.xmlRegistry;
- }
-
- protected void setXmlRegistry_(XmlRegistry xmlRegistry) {
- XmlRegistry old = this.xmlRegistry;
- this.xmlRegistry = xmlRegistry;
- firePropertyChanged(XML_REGISTRY_PROPERTY, old, xmlRegistry);
- }
-
- protected XmlRegistryAnnotation getXmlRegistryAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_REGISTRY);
- }
-
- protected XmlRegistry buildXmlRegistry() {
- return getFactory().buildXmlRegistry(this);
- }
-
- protected void initXmlRegistry() {
- if (getXmlRegistryAnnotation() != null) {
- this.xmlRegistry = buildXmlRegistry();
- }
- }
-
- protected void syncXmlRegistry() {
- XmlRegistryAnnotation annotation = getXmlRegistryAnnotation();
- if (annotation != null) {
- if (this.xmlRegistry != null) {
- this.xmlRegistry.synchronizeWithResourceModel();
- }
- else {
- setXmlRegistry_(buildXmlRegistry());
- }
- }
- else if (this.xmlRegistry != null) {
- setXmlRegistry_(null);
- }
- }
-
- protected void updateXmlRegistry() {
- if (this.xmlRegistry != null) {
- this.xmlRegistry.update();
- }
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlRegistry != null) {
- this.xmlRegistry.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java
deleted file mode 100644
index 3cf53874dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaJaxbEnum.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-
-public class GenericJavaJaxbEnum
- extends AbstractJavaType
- implements JaxbEnum {
-
- public GenericJavaJaxbEnum(JaxbContextNode parent, JavaResourceEnum resourceType) {
- super(parent, resourceType);
- }
-
-
- @Override
- public JavaResourceEnum getJavaResourceType() {
- return (JavaResourceEnum) super.getJavaResourceType();
- }
-
- public Kind getKind() {
- return JaxbType.Kind.ENUM;
- }
-
-
- // ***** mapping *****
-
- @Override
- public JaxbEnumMapping getMapping() {
- return (JaxbEnumMapping) super.getMapping();
- }
-
- @Override
- protected JaxbEnumMapping buildMapping() {
- return getFactory().buildJaxbEnumMapping(this);
- }
-
- @Override
- protected boolean isSpecifiedMapped() {
- return super.isSpecifiedMapped()
- || getXmlEnumAnnotation() != null;
- }
-
- protected XmlEnumAnnotation getXmlEnumAnnotation() {
- return (XmlEnumAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_ENUM);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
deleted file mode 100644
index 3d278192ee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaNullAttributeMapping.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-public class GenericJavaNullAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation> {
-
- public GenericJavaNullAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public Annotation getAnnotation() {
- return null;
- }
-
- @Override
- public String getAnnotationName() {
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
deleted file mode 100644
index df21aa2d69..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java
+++ /dev/null
@@ -1,444 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageInfo
- extends AbstractJavaContextNode
- implements JaxbPackageInfo {
-
- protected final JavaResourcePackage resourcePackage;
-
- protected final XmlSchema xmlSchema;
-
- protected XmlAccessType specifiedAccessType;
-
- protected XmlAccessOrder specifiedAccessOrder;
-
- protected final ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation> xmlSchemaTypeContainer;
-
- protected final ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapterContainer;
-
- public GenericJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage) {
- super(parent);
- this.resourcePackage = resourcePackage;
- this.xmlSchema = getFactory().buildJavaXmlSchema(this);
- this.specifiedAccessType = getResourceAccessType();
- this.specifiedAccessOrder = getResourceAccessOrder();
- this.xmlSchemaTypeContainer = this.buildXmlSchemaTypeContainer();
- this.xmlJavaTypeAdapterContainer = this.buildXmlJavaTypeAdapterContainer();
- }
-
-
- public JaxbPackage getJaxbPackage() {
- return (JaxbPackage) getParent();
- }
-
-
- // **************** AbstractJaxbNode impl *********************************
-
- @Override
- public IResource getResource() {
- return this.resourcePackage.getFile();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlSchema.synchronizeWithResourceModel();
- this.setSpecifiedAccessType_(this.getResourceAccessType());
- this.setSpecifiedAccessOrder_(this.getResourceAccessOrder());
- this.syncXmlSchemaTypes();
- this.syncXmlJavaTypeAdapters();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlSchema.update();
- this.updateXmlSchemaTypes();
- this.updateXmlJavaTypeAdapters();
- }
-
-
- // ********** JaxbPackageInfo implementation **********
-
- public JavaResourcePackage getResourcePackage() {
- return this.resourcePackage;
- }
-
- // ********** xml schema **********
-
- public XmlSchema getXmlSchema() {
- return this.xmlSchema;
- }
-
- // ********** access type **********
-
- public XmlAccessType getAccessType() {
- return (this.specifiedAccessType != null) ? this.specifiedAccessType : this.getDefaultAccessType();
- }
-
- public XmlAccessType getSpecifiedAccessType() {
- return this.specifiedAccessType;
- }
-
- public void setSpecifiedAccessType(XmlAccessType access) {
- this.getAccessorTypeAnnotation().setValue(XmlAccessType.toJavaResourceModel(access));
- this.setSpecifiedAccessType_(access);
- }
-
- protected void setSpecifiedAccessType_(XmlAccessType access) {
- XmlAccessType old = this.specifiedAccessType;
- this.specifiedAccessType = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, old, access);
- }
-
- public XmlAccessType getDefaultAccessType() {
- return XmlAccessType.PUBLIC_MEMBER;
- }
-
- protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(this.getAccessorTypeAnnotation().getValue());
- }
-
- protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() {
- return (XmlAccessorTypeAnnotation) this.resourcePackage.getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE);
- }
-
-
- // ********** access order **********
-
- public XmlAccessOrder getAccessOrder() {
- return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : this.getDefaultAccessOrder();
- }
-
- public XmlAccessOrder getSpecifiedAccessOrder() {
- return this.specifiedAccessOrder;
- }
-
- public void setSpecifiedAccessOrder(XmlAccessOrder accessOrder) {
- this.getAccessorOrderAnnotation().setValue(XmlAccessOrder.toJavaResourceModel(accessOrder));
- this.setSpecifiedAccessOrder_(accessOrder);
- }
-
- protected void setSpecifiedAccessOrder_(XmlAccessOrder accessOrder) {
- XmlAccessOrder old = this.specifiedAccessOrder;
- this.specifiedAccessOrder = accessOrder;
- this.firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, old, accessOrder);
- }
-
- public XmlAccessOrder getDefaultAccessOrder() {
- return XmlAccessOrder.UNDEFINED;
- }
-
- protected XmlAccessOrder getResourceAccessOrder() {
- return XmlAccessOrder.fromJavaResourceModel(this.getAccessorOrderAnnotation().getValue());
- }
-
- protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() {
- return (XmlAccessorOrderAnnotation) this.resourcePackage.getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER);
- }
-
-
- // ********** xml schema types **********
-
- public ListIterable<XmlSchemaType> getXmlSchemaTypes() {
- return this.xmlSchemaTypeContainer.getContextElements();
- }
-
- public int getXmlSchemaTypesSize() {
- return this.xmlSchemaTypeContainer.getContextElementsSize();
- }
-
- public XmlSchemaType addXmlSchemaType(int index) {
- XmlSchemaTypeAnnotation annotation = (XmlSchemaTypeAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_SCHEMA_TYPE);
- return this.xmlSchemaTypeContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlSchemaType(XmlSchemaType xmlSchemaType) {
- this.removeXmlSchemaType(this.xmlSchemaTypeContainer.indexOfContextElement(xmlSchemaType));
- }
-
- public void removeXmlSchemaType(int index) {
- this.resourcePackage.removeAnnotation(index, JAXB.XML_SCHEMA_TYPE);
- this.xmlSchemaTypeContainer.removeContextElement(index);
- }
-
- public void moveXmlSchemaType(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_SCHEMA_TYPE);
- this.xmlSchemaTypeContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlSchemaType buildXmlSchemaType(XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- return new GenericJavaPackageXmlSchemaType(this, xmlSchemaTypeAnnotation);
- }
-
- protected void syncXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.synchronizeWithResourceModel();
- }
-
- protected void updateXmlSchemaTypes() {
- this.xmlSchemaTypeContainer.update();
- }
-
- protected ListIterable<XmlSchemaTypeAnnotation> getXmlSchemaTypeAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlSchemaTypeAnnotation>(
- this.resourcePackage.getAnnotations(JAXB.XML_SCHEMA_TYPE));
- }
-
- protected ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation> buildXmlSchemaTypeContainer() {
- XmlSchemaTypeContainer container = new XmlSchemaTypeContainer();
- container.initialize();
- return container;
- }
-
-
- // ********** xml java type adapters **********
-
- public ListIterable<XmlJavaTypeAdapter> getXmlJavaTypeAdapters() {
- return this.xmlJavaTypeAdapterContainer.getContextElements();
- }
-
- public int getXmlJavaTypeAdaptersSize() {
- return this.xmlJavaTypeAdapterContainer.getContextElementsSize();
- }
-
- public XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index) {
- XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER);
- return this.xmlJavaTypeAdapterContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlJavaTypeAdapter(XmlJavaTypeAdapter xmlSchemaType) {
- this.removeXmlJavaTypeAdapter(this.xmlJavaTypeAdapterContainer.indexOfContextElement(xmlSchemaType));
- }
-
- public void removeXmlJavaTypeAdapter(int index) {
- this.resourcePackage.removeAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.xmlJavaTypeAdapterContainer.removeContextElement(index);
- }
-
- public void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex) {
- this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.xmlJavaTypeAdapterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlJavaTypeAdapter buildXmlJavaTypeAdapter(XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation) {
- return new GenericJavaPackageXmlJavaTypeAdapter(this, xmlJavaTypeAdapterAnnotation);
- }
-
- protected void updateXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.update();
- }
-
- protected void syncXmlJavaTypeAdapters() {
- this.xmlJavaTypeAdapterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getXmlJavaTypeAdapterAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlJavaTypeAdapterAnnotation>(
- this.resourcePackage.getAnnotations(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- protected ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> buildXmlJavaTypeAdapterContainer() {
- XmlJavaTypeAdapterContainer container = new XmlJavaTypeAdapterContainer();
- container.initialize();
- return container;
- }
-
- public XmlJavaTypeAdapter getXmlJavaTypeAdapter(String boundTypeName) {
- for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) {
- if (boundTypeName.equals(adapter.getFullyQualifiedType())) {
- return adapter;
- }
- }
- return null;
- }
-
-
- // ***** misc *****
-
- protected CompilationUnit buildASTRoot() {
- return this.resourcePackage.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- public String getNamespaceForPrefix(String prefix) {
- if (this.xmlSchema != null) {
- for (XmlNs xmlns : this.xmlSchema.getXmlNsPrefixes()) {
- if (StringTools.stringsAreEqual(xmlns.getPrefix(), prefix)) {
- return xmlns.getNamespaceURI();
- }
- }
- }
- return null;
- }
-
- public String getPrefixForNamespace(String namespace) {
- if (this.xmlSchema != null) {
- for (XmlNs xmlns : this.xmlSchema.getXmlNsPrefixes()) {
- if (StringTools.stringsAreEqual(xmlns.getNamespaceURI(), namespace)) {
- return xmlns.getPrefix();
- }
- }
- }
- return null;
- }
-
-
- // ***** content assist ******
-
- //This doesn't actually work yet because of JDT bug (bugs.eclipse.org/326610)
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- getJaxbProject().getSchemaLibrary().refreshSchema(getJaxbPackage().getNamespace());
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlSchema.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- for (XmlSchemaType xmlSchemaType : this.getXmlSchemaTypes()) {
- result = xmlSchemaType.getJavaCompletionProposals(pos, filter, astRoot);
- if (!CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourcePackage.getNameTextRange(astRoot);
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- IFile file = this.resourcePackage.getFile();
- // 'file' will be null if the type is "external" and binary;
- // the file will be in a different project if the type is "external" and source;
- // the type will be binary if it is in a JAR in the current project
- if ((file != null)
- && file.getProject().equals(getJaxbProject().getProject())
- && (this.resourcePackage instanceof SourceNode)) {
- // build the AST root here to pass down
- this.validate(messages, reporter, this.buildASTRoot());
- }
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlSchema.validate(messages, reporter, astRoot);
-
- for (XmlSchemaType schemaType : getXmlSchemaTypes()) {
- schemaType.validate(messages, reporter, astRoot);
- }
-
- for (XmlJavaTypeAdapter adapter : getXmlJavaTypeAdapters()) {
- adapter.validate(messages, reporter, astRoot);
- }
- }
-
-
- /**
- * xml schema type container
- */
- protected class XmlSchemaTypeContainer
- extends ContextListContainer<XmlSchemaType, XmlSchemaTypeAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return XML_SCHEMA_TYPES_LIST;
- }
- @Override
- protected XmlSchemaType buildContextElement(XmlSchemaTypeAnnotation resourceElement) {
- return GenericJavaPackageInfo.this.buildXmlSchemaType(resourceElement);
- }
- @Override
- protected ListIterable<XmlSchemaTypeAnnotation> getResourceElements() {
- return GenericJavaPackageInfo.this.getXmlSchemaTypeAnnotations();
- }
- @Override
- protected XmlSchemaTypeAnnotation getResourceElement(XmlSchemaType contextElement) {
- return contextElement.getXmlSchemaTypeAnnotation();
- }
- }
-
- /**
- * xml java type adapter container
- */
- protected class XmlJavaTypeAdapterContainer
- extends ContextListContainer<XmlJavaTypeAdapter, XmlJavaTypeAdapterAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XML_JAVA_TYPE_ADAPTERS_LIST;
- }
-
- @Override
- protected XmlJavaTypeAdapter buildContextElement(XmlJavaTypeAdapterAnnotation resourceElement) {
- return GenericJavaPackageInfo.this.buildXmlJavaTypeAdapter(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlJavaTypeAdapterAnnotation> getResourceElements() {
- return GenericJavaPackageInfo.this.getXmlJavaTypeAdapterAnnotations();
- }
-
- @Override
- protected XmlJavaTypeAdapterAnnotation getResourceElement(XmlJavaTypeAdapter contextElement) {
- return contextElement.getAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
deleted file mode 100644
index 00f539662f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaPackageXmlJavaTypeAdapter(JaxbPackageInfo parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- protected String buildDefaultType() {
- //there is no default type on a package level XmlJavaTypeAdapter, it must be specified
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getSpecifiedType() == null || getFullyQualifiedType().equals(XmlJavaTypeAdapter.DEFAULT_TYPE)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED,
- this,
- getAnnotation().getTypeTextRange(astRoot)));
- }
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java
deleted file mode 100644
index 04480116be..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageXmlSchemaType.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPackageXmlSchemaType
- extends GenericJavaXmlSchemaType
-{
-
- public GenericJavaPackageXmlSchemaType(JaxbPackageInfo parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
- super(parent, xmlSchemaTypeAnnotation);
- }
-
- @Override
- public JaxbPackageInfo getParent() {
- return (JaxbPackageInfo) super.getParent();
- }
-
- protected JaxbPackageInfo getJaxbPackageInfo() {
- return getParent();
- }
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return getJaxbPackageInfo().getJaxbPackage();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String fqType = getFullyQualifiedType();
- if (fqType == null || XmlSchemaTypeAnnotation.DEFAULT_TYPE.equals(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
deleted file mode 100644
index 01edcb52ef..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaPersistentAttribute
- extends AbstractJavaContextNode
- implements JaxbPersistentAttribute {
-
- protected final Accessor accessor;
-
- protected JaxbAttributeMapping mapping; // never null
-
- protected String defaultMappingKey;
-
-
-
- public static JaxbPersistentAttribute buildPersistentProperty(
- JaxbClassMapping parent,
- JavaResourceMethod resourceGetter,
- JavaResourceMethod resourceSetter) {
- return new GenericJavaPersistentAttribute(
- parent, new PropertyAccessor(parent, resourceGetter, resourceSetter));
- }
-
- public static JaxbPersistentAttribute buildPersistentField(
- JaxbClassMapping parent,
- JavaResourceField resourceField) {
- return new GenericJavaPersistentAttribute(
- parent, new FieldAccessor(parent, resourceField));
- }
-
-
- public GenericJavaPersistentAttribute(JaxbClassMapping parent, Accessor accessor) {
- super(parent);
- this.accessor = accessor;
- // keep non-null at all times
- this.mapping = this.buildMapping();
- }
-
- public JaxbClassMapping getClassMapping() {
- return (JaxbClassMapping) super.getParent();
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncMapping();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateMapping();
- }
-
-
- // ***** declaring class/ inheritance *****
-
- public JavaResourceType getDeclaringJavaResourceType() {
- return this.accessor.getJavaResourceAttribute().getResourceType();
- }
-
- public boolean isInherited() {
- return getDeclaringJavaResourceType() != getClassMapping().getJaxbType().getJavaResourceType();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.getJavaResourceAttribute().getName();
- }
-
-
- // ***** accessor *****
-
- public boolean isFor(JavaResourceField resourceField) {
- return this.accessor.isFor(resourceField);
- }
-
- public boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return this.accessor.isFor(resourceGetter, resourceSetter);
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.accessor.getJavaResourceAttribute();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- return this.accessor.getJavaResourceAttributeBaseTypeName();
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- return this.accessor.isJavaResourceAttributeCollectionType();
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- return this.accessor.isJavaResourceAttributeTypeSubTypeOf(typeName);
- }
-
- // ********** mapping **********
-
- public JaxbAttributeMapping getMapping() {
- return this.mapping;
- }
-
- /**
- * Clients do not set the mapping directly.
- * @see #setMappingKey(String)
- */
- protected void setMapping(JaxbAttributeMapping mapping) {
- JaxbAttributeMapping old = this.mapping;
- this.mapping = mapping;
- this.firePropertyChanged(MAPPING_PROPERTY, old, mapping);
- }
-
- public String getMappingKey() {
- return this.mapping.getKey();
- }
-
- /**
- * Possible transitions:
- * <table border>
- * <th>
- * <th>null mapping/default<br>
- * <code>key = null</code>
- * <th>specified mapping A<br>
- * <code>key = "A"</code>
- * <th>specified mapping B<br>
- * <code>key = "B"</code>
- * <tr>
- * <th>[default] null mapping
- * <td>do nothing
- * <td>add annotation A<br>
- * set new mapping A
- * <td>add annotation B<br>
- * set new mapping B
- * <tr>
- * <th>default mapping A
- * <td>do nothing
- * <td>add annotation A<br>
- * <em>re-use</em> default mapping A
- * <td>add annotation B<br>
- * set new mapping B
- * <tr>
- * <th>specified mapping A
- * <td>remove annotation A<br>
- * set new default or null mapping
- * <td>do nothing
- * <td>remove annotation A<br>
- * add annotation B<br>
- * set new mapping B
- * </table>
- * The "do nothing" transitions are handled in this method.
- */
- public JaxbAttributeMapping setMappingKey(String key) {
- if (this.mapping.isDefault()) {
- if (key == null) {
- // leave the default mapping unchanged
- } else {
- this.setMappingKey_(key); // replace the default mapping
- }
- } else {
- if (this.valuesAreEqual(key, this.mapping.getKey())) {
- // leave the specified mapping unchanged
- } else {
- this.setMappingKey_(key); // replace the specified mapping
- }
- }
- return this.mapping;
- }
-
- /**
- * We have either:<ul>
- * <li>a <em>default</em> mapping and a non-<code>null</code> key
- * </ul>or<ul>
- * <li>a <em>specified</em> mapping and a different (possibly
- * <code>null</code>) key
- * </ul>
- */
- protected void setMappingKey_(String key) {
- JavaAttributeMappingDefinition definition = this.getSpecifiedMappingDefinition(key);
- if (definition == null) {
- // our mapping is "specified" and the key is null;
- // check for a default definition
- definition = this.getDefaultMappingDefinition();
- Iterable<String> supportingAnnotationNames = (definition != null) ? definition.getSupportingAnnotationNames() : EmptyIterable.<String>instance();
- // clear any mapping annotation(s);
- // leave the "default" mapping's supporting annotations;
- // if there is no "default" mapping, clear all supporting annotations too(?)
- this.setMappingAnnotation(null, supportingAnnotationNames);
- } else {
- this.setMappingAnnotation(definition);
- }
- // note: 'definition' can still be null (if the key is null and there is no "default" mapping)
- this.setMapping(this.buildMapping(definition));
- }
-
- /**
- * pre-condition: definition is not <code>null</code>
- */
- protected void setMappingAnnotation(JavaAttributeMappingDefinition definition) {
- this.setMappingAnnotation(definition.getAnnotationName(), definition.getSupportingAnnotationNames());
- }
-
- protected void setMappingAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- this.getJavaResourceAttribute().setPrimaryAnnotation(primaryAnnotationName, supportingAnnotationNames);
- }
-
- protected JaxbAttributeMapping buildMapping(JavaAttributeMappingDefinition definition) {
- return (definition == null) ? this.buildNullMapping() : this.buildMapping_(definition);
- }
-
- protected JaxbAttributeMapping buildNullMapping() {
- return this.getFactory().buildJavaNullAttributeMapping(this);
- }
-
- /**
- * pre-condition: definition is not null
- * <p>
- * If we are converting a <em>default</em> mapping to its <em>specified</em>
- * manifestation, we just keep the same mapping and create its annotation.
- * We do <em>not</em> do the same thing when converting a <em>specified</em>
- * mapping to its <em>default</em> manifestation. We rebuild the
- * entire mapping, simplifying the clearing of all its state. We do this
- * because we allow clients to modify a <em>default</em> mapping (or any of
- * its components) directly,
- * modifying its state and triggering a conversion to a <em>specified</em>
- * mapping. The only way to convert a <em>specified</em> mapping to a
- * <em>default</em> mapping is by {@link #setMappingKey(String) setting the
- * mapping key} to <code>null</code>.
- */
- protected JaxbAttributeMapping buildMapping_(JavaAttributeMappingDefinition definition) {
- // 'mapping' is null during construction
- if ((this.mapping != null) && this.mapping.isDefault() && Tools.valuesAreEqual(this.mapping.getKey(), definition.getKey())) {
- this.mapping.synchronizeWithResourceModel(); // the mapping instance hasn't changed, but some resource differences may have resulted
- return this.mapping;
- }
- return definition.buildMapping(this, this.getFactory());
- }
-
- /**
- * We only look for a <em>specified</em> mapping here.
- * We look for a default mapping during <em>update</em>.
- */
- protected JaxbAttributeMapping buildMapping() {
- return this.buildMapping(this.getSpecifiedMappingDefinition());
- }
-
- /**
- * Look for a <em>specified</em> mapping and sync our mapping.
- */
- protected void syncMapping() {
- JavaAttributeMappingDefinition definition = this.getSpecifiedMappingDefinition();
- if (definition == null) {
- if (this.mapping.isDefault()) {
- // null/default => null/default
- this.mapping.synchronizeWithResourceModel();
- } else {
- // specified => null/default
- definition = this.getDefaultMappingDefinition();
- this.setMapping(this.buildMapping(definition));
- }
- } else {
- if (this.mapping.isDefault()) {
- // null/default => specified
- // (will not change mapping instance if keys are the same, but will sync the mapping)
- this.setMapping(this.buildMapping(definition));
- } else {
- // specified => specified
- if (this.valuesAreEqual(definition.getKey(), this.mapping.getKey())) {
- this.mapping.synchronizeWithResourceModel();
- } else {
- this.setMapping(this.buildMapping(definition));
- }
- }
- }
- }
-
- /**
- * Return the "specified" mapping definition for the specified key.
- */
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition(String key) {
- if (key == null) {
- return null;
- }
- for (JavaAttributeMappingDefinition definition : this.getSpecifiedMappingDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), key)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("invalid mapping key: " + key); //$NON-NLS-1$
- }
-
- /**
- * Return the mapping definition for the mapping currently specified in the
- * source code.
- */
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition() {
- for (JavaAttributeMappingDefinition definition : this.getSpecifiedMappingDefinitions()) {
- if (definition.isSpecified(this)) {
- return definition;
- }
- }
- return null;
- }
-
- protected Iterable<JavaAttributeMappingDefinition> getSpecifiedMappingDefinitions() {
- return this.getPlatform().getSpecifiedJavaAttributeMappingDefinitions();
- }
-
-
- // ********** default mapping **********
-
- public String getDefaultMappingKey() {
- return this.defaultMappingKey;
- }
-
- protected void setDefaultMappingKey(String mappingKey) {
- String old = this.defaultMappingKey;
- this.defaultMappingKey = mappingKey;
- this.firePropertyChanged(DEFAULT_MAPPING_KEY_PROPERTY, old, mappingKey);
- }
-
- /**
- * If a mapping annotation is specified, we would have already set a
- * <em>specified</em> mapping in {@link #syncMapping()}. We need only check
- * for changes to the <em>default</em> mapping.
- */
- protected void updateMapping() {
- JavaAttributeMappingDefinition definition = this.getDefaultMappingDefinition();
- String newDefaultKey = (definition == null) ? null : definition.getKey();
- if (this.mapping.isDefault() && Tools.valuesAreDifferent(this.mapping.getKey(), newDefaultKey)) {
- this.setMapping(this.buildMapping(definition)); // the default mapping has changed
- } else {
- this.mapping.update();
- }
- this.setDefaultMappingKey(newDefaultKey);
- }
-
- protected JavaAttributeMappingDefinition getDefaultMappingDefinition() {
- for (DefaultJavaAttributeMappingDefinition definition : this.getDefaultMappingDefinitions()) {
- if (definition.isDefault(this)) {
- return definition;
- }
- }
- return null;
- }
-
- protected Iterable<DefaultJavaAttributeMappingDefinition> getDefaultMappingDefinitions() {
- return this.getPlatform().getDefaultJavaAttributeMappingDefinitions();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.mapping.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getJavaResourceAttribute().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // validate that unsupported annotations are not present
- JavaAttributeMappingDefinition currentMappingDefinition = getCurrentMappingDefinition();
- Iterable<String> supportingAnnotationNames = currentMappingDefinition.getSupportingAnnotationNames();
-
- for (Annotation annotation : getJavaResourceAttribute().getTopLevelAnnotations()) {
- if (Tools.valuesAreDifferent(currentMappingDefinition.getAnnotationName(), annotation.getAnnotationName())
- && ! CollectionTools.contains(supportingAnnotationNames, annotation.getAnnotationName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION,
- new String[] { annotation.getAnnotationName(), currentMappingDefinition.getAnnotationName() },
- this,
- annotation.getTextRange(astRoot)));
- }
- }
-
- this.getMapping().validate(messages, reporter, astRoot);
- }
-
- protected JavaAttributeMappingDefinition getCurrentMappingDefinition() {
- Iterable<? extends JavaAttributeMappingDefinition> mappingDefinitions =
- (this.mapping.isDefault()) ?
- getDefaultMappingDefinitions()
- : getSpecifiedMappingDefinitions();
-
- for (JavaAttributeMappingDefinition mappingDefinition : mappingDefinitions) {
- if (Tools.valuesAreEqual(mappingDefinition.getKey(), this.mapping.getKey())) {
- return mappingDefinition;
- }
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java
deleted file mode 100644
index 10a874665f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTypeXmlJavaTypeAdapter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-public class GenericJavaTypeXmlJavaTypeAdapter
- extends AbstractJavaXmlJavaTypeAdapter
-{
-
- public GenericJavaTypeXmlJavaTypeAdapter(JaxbType parent, XmlJavaTypeAdapterAnnotation resource) {
- super(parent, resource);
- }
-
- @Override
- public JaxbType getParent() {
- return (JaxbType) super.getParent();
- }
-
- // ********** type **********
- @Override
- protected String buildDefaultType() {
- return getParent().getJavaResourceType().getQualifiedName();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java
deleted file mode 100644
index b71db30e34..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdapter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-
-public class GenericJavaXmlAdapter
- extends AbstractJavaContextNode
- implements XmlAdapter {
-
- protected final JavaResourceType resourceType;
-
- protected String boundType;
-
- protected String valueType;
-
-
- public GenericJavaXmlAdapter(JavaContextNode parent, JavaResourceType resourceType) {
- super(parent);
- this.resourceType = resourceType;
- initBoundAndValueTypes();
- }
-
-
- public JavaResourceType getJavaResourceType() {
- return this.resourceType;
- }
-
-
- // ***** overrides *****
-
- @Override
- public IResource getResource() {
- return this.resourceType.getFile();
- }
-
-
- // ***** sync/update *****
-
- protected void initBoundAndValueTypes() {
- String[] types = findBoundAndValueTypes(getJavaResourceType());
- this.boundType = types[0];
- this.valueType = types[1];
- }
-
-
- @Override
- public void update() {
- super.update();
- // these are in update, since their values may depend on other classes
- updateBoundAndValueTypes();
- }
-
- protected void updateBoundAndValueTypes() {
- String[] types = findBoundAndValueTypes(getJavaResourceType());
- setBoundType_(types[0]);
- setValueType_(types[1]);
- }
-
- protected String[] findBoundAndValueTypes(JavaResourceType resourceType) {
- for (JavaResourceMethod resourceMethod : resourceType.getMethods()) {
- if (MARSHAL_METHOD_NAME.equals(resourceMethod.getName()) && resourceMethod.getParametersSize() == 1) {
- String valueType = resourceMethod.getTypeName();
- String boundType = resourceMethod.getParameterTypeName(0);
- return new String[] { boundType, valueType };
- }
- }
-
- String superResourceTypeName = resourceType.getSuperclassQualifiedName();
- if (! StringTools.stringIsEmpty(superResourceTypeName)) {
- JavaResourceType superResourceType
- = (JavaResourceType) getJaxbProject().getJavaResourceType(superResourceTypeName, JavaResourceAbstractType.Kind.TYPE);
- if (superResourceType != null) {
- return findBoundAndValueTypes(superResourceType);
- }
- }
-
- String objectTypeName = Object.class.getName();
- return new String[] { objectTypeName, objectTypeName };
- }
-
-
- // ***** bound type *****
-
- public String getBoundType() {
- return this.boundType;
- }
-
- protected void setBoundType_(String newType) {
- String oldType = this.boundType;
- this.boundType = newType;
- firePropertyChanged(BOUND_TYPE_PROPERTY, oldType, newType);
- }
-
-
- // ***** value type *****
-
- public String getValueType() {
- return this.valueType;
- }
-
- protected void setValueType_(String newType) {
- String oldType = this.valueType;
- this.valueType = newType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, oldType, newType);
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getJavaResourceType().getNameTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
deleted file mode 100644
index 6b94b4273d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAnyAttributeMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlAnyAttributeAnnotation>
- implements XmlAnyAttributeMapping {
-
- public GenericJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initializeXmlJavaTypeAdapter();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(Map.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ANY_ATTRIBUTE__NON_MAP_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
deleted file mode 100644
index a5d9f92acf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAnyElementMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlAnyElementAnnotation>
- implements XmlAnyElementMapping {
-
- protected Boolean specifiedLax;
-
- protected String specifiedValue;
-
- protected final XmlElementRefs xmlElementRefs;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.specifiedLax = buildSpecifiedLax();
- this.specifiedValue = getResourceValueString();
- this.xmlElementRefs = buildXmlElementRefs();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- setSpecifiedLax_(buildSpecifiedLax());
- setSpecifiedValue_(getResourceValueString());
- this.xmlElementRefs.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefs.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** lax *****
-
- public boolean isLax() {
- return (getSpecifiedLax() == null) ? isDefaultLax() : getSpecifiedLax().booleanValue();
- }
-
- public Boolean getSpecifiedLax() {
- return this.specifiedLax;
- }
-
- public void setSpecifiedLax(Boolean newSpecifiedLax) {
- getOrCreateAnnotation().setLax(newSpecifiedLax);
- setSpecifiedLax_(newSpecifiedLax);
- }
-
- protected void setSpecifiedLax_(Boolean newSpecifiedLax) {
- Boolean oldLax = this.specifiedLax;
- this.specifiedLax = newSpecifiedLax;
- firePropertyChanged(SPECIFIED_LAX_PROPERTY, oldLax, newSpecifiedLax);
- }
-
- protected Boolean buildSpecifiedLax() {
- return getAnnotation().getLax();
- }
-
- public boolean isDefaultLax() {
- return DEFAULT_LAX;
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return getSpecifiedValue() == null ? getDefaultValue() : getSpecifiedValue();
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String location) {
- getOrCreateAnnotation().setValue(location);
- setSpecifiedValue_(location);
- }
-
- protected void setSpecifiedValue_(String type) {
- String old = this.specifiedValue;
- this.specifiedValue = type;
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, old, type);
- }
-
- protected String getResourceValueString() {
- return getAnnotation().getValue();
- }
-
- public String getDefaultValue() {
- return DEFAULT_VALUE;
- }
-
-
- // ***** XmlElementRefs *****
-
- public XmlElementRefs getXmlElementRefs() {
- return this.xmlElementRefs;
- }
-
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRefs.getReferencedXmlTypeNames();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRefs.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRefs.validate(messages, reporter, astRoot);
-
- if (getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS) != null) {
- XmlElementRefAnnotation xmlElementRefAnnotation =
- (XmlElementRefAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF);
- if (xmlElementRefAnnotation != null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION,
- new String[] { JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS },
- getPersistentAttribute(),
- xmlElementRefAnnotation.getTextRange(astRoot)));
- }
- }
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlMixed != null) {
- this.xmlMixed.validate(messages, reporter, astRoot);
- }
- }
-
- protected class XmlElementRefsContext
- implements GenericJavaXmlElementRefs.Context {
-
- protected XmlElementRefsAnnotation getXmlElementRefsAnnotation() {
- return (XmlElementRefsAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected XmlElementRefsAnnotation addXmlElementRefsAnnotation() {
- return (XmlElementRefsAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected void removeXmlElementRefsAnnotation() {
- GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_REFS);
- }
-
- protected XmlElementRefAnnotation getXmlElementRefAnnotation() {
- return (XmlElementRefAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- protected XmlElementRefAnnotation addXmlElementRefAnnotation() {
- return (XmlElementRefAnnotation) GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- protected void removeXmlElementRefAnnotation() {
- GenericJavaXmlAnyElementMapping.this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_REF);
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.getXmlElementRefs();
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- return new SingleElementListIterable(xmlElementRefAnnotation);
- }
-
- return EmptyListIterable.instance();
- }
-
- public XmlElementRefAnnotation addXmlElementRefAnnotation(int index) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.addXmlElementRef(index);
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- if (index > 1) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- xmlElementRefsAnnotation = addXmlElementRefsAnnotation();
- XmlElementRefAnnotation xmlElementRefAnnotationCopy = xmlElementRefsAnnotation.addXmlElementRef(0);
- xmlElementRefAnnotationCopy.setName(xmlElementRefAnnotation.getName());
- xmlElementRefAnnotationCopy.setNamespace(xmlElementRefAnnotation.getNamespace());
- xmlElementRefAnnotationCopy.setRequired(xmlElementRefAnnotation.getRequired());
- xmlElementRefAnnotationCopy.setType(xmlElementRefAnnotation.getType());
-
- removeXmlElementRefAnnotation();
-
- return xmlElementRefsAnnotation.addXmlElementRef(index);
- }
-
- if (index > 0) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- return addXmlElementRefAnnotation();
- }
-
- public void removeXmlElementRefAnnotation(int index) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- xmlElementRefsAnnotation.removeXmlElementRef(index);
- if (xmlElementRefsAnnotation.getXmlElementRefsSize() == 0) {
- removeXmlElementRefsAnnotation();
- }
- else if (xmlElementRefsAnnotation.getXmlElementRefsSize() == 1) {
- XmlElementRefAnnotation xmlElementRefAnnotation = CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0);
- XmlElementRefAnnotation xmlElementRefAnnotationCopy = addXmlElementRefAnnotation();
- xmlElementRefAnnotationCopy.setName(xmlElementRefAnnotation.getName());
- xmlElementRefAnnotationCopy.setNamespace(xmlElementRefAnnotation.getNamespace());
- xmlElementRefAnnotationCopy.setRequired(xmlElementRefAnnotation.getRequired());
- xmlElementRefAnnotationCopy.setType(xmlElementRefAnnotation.getType());
- removeXmlElementRefsAnnotation();
- }
- return;
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- if (index != 0) {
- throw new IllegalArgumentException(String.valueOf(index));
- }
- removeXmlElementRefAnnotation();
- return;
- }
-
- throw new IllegalArgumentException(String.valueOf(index));
- }
-
- public void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex) {
- if (targetIndex == sourceIndex) {
- return;
- }
-
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation == null) {
- throw new IllegalArgumentException(String.valueOf(targetIndex) + ", " + String.valueOf(sourceIndex));
- }
- xmlElementRefsAnnotation.moveXmlElementRef(targetIndex, sourceIndex);
- }
-
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- XmlElementRefsAnnotation xmlElementRefsAnnotation = getXmlElementRefsAnnotation();
- if (xmlElementRefsAnnotation != null) {
- return xmlElementRefsAnnotation.getTextRange(astRoot);
- }
-
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation();
- if (xmlElementRefAnnotation != null) {
- return xmlElementRefAnnotation.getTextRange(astRoot);
- }
-
- return GenericJavaXmlAnyElementMapping.this.getValidationTextRange(astRoot);
- }
- }
-
-
- protected class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- protected XmlElementRefAnnotation annotation;
-
- public XmlElementRefContext(XmlElementRefAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlAnyElementMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlAnyElementMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java
deleted file mode 100644
index e7ca2fc909..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttachmentRef.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttachmentRef;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-public class GenericJavaXmlAttachmentRef
- extends AbstractJavaContextNode
- implements XmlAttachmentRef {
-
- protected final XmlAttachmentRefAnnotation resourceXmlAttachmentRef;
-
-
- public GenericJavaXmlAttachmentRef(JaxbAttributeMapping parent, XmlAttachmentRefAnnotation resource) {
- super(parent);
- this.resourceXmlAttachmentRef = resource;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlAttachmentRef.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
deleted file mode 100644
index 7d9428c5a5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdAttributeUse;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSimpleTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlAttributeMapping
- extends AbstractJavaXmlNamedNodeMapping<XmlAttributeAnnotation>
- implements XmlAttributeMapping {
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
-
- public GenericJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlAttributeQName(this);
- }
-
-
- // ***** XmlAttribute.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getOrCreateAnnotation().setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- XmlAttributeAnnotation annotation = getAnnotation();
- return (annotation == null) ? null : annotation.getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlList *****
-
- @Override
- protected boolean calculateDefaultXmlList() {
- return getPersistentAttribute().isJavaResourceAttributeCollectionType();
- }
-
-
- // ***** XmlIDREF *****
-
- @Override
- protected GenericJavaXmlIDREF.Context buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- public XsdFeature getXsdFeature() {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type != null) {
- XsdAttributeUse attributeUse = type.getAttribute(this.qName.getNamespace(), this.qName.getName());
- return (attributeUse == null) ? null : attributeUse.getAttributeDeclaration();
- }
- return null;
- }
-
- @Override
- public XsdTypeDefinition getDataTypeXsdTypeDefinition() {
- XsdTypeDefinition xsdType = super.getDataTypeXsdTypeDefinition();
- if (xsdType != null
- && isXmlList()
- && xsdType.getKind() == XsdTypeDefinition.Kind.SIMPLE
- && ((XsdSimpleTypeDefinition) xsdType).getItemType() != null) {
- xsdType = ((XsdSimpleTypeDefinition) xsdType).getItemType();
- }
- return xsdType;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateQName(messages, reporter, astRoot);
- validateSchemaType(messages, reporter, astRoot);
- }
-
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.qName.validate(messages, reporter, astRoot);
- }
-
- protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdFeature xsdFeature = getXsdFeature();
- if (xsdFeature == null) {
- return;
- }
-
- XsdTypeDefinition expectedSchemaType = null;
- if (this.xmlID != null) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID");
- }
- else if (this.xmlIDREF != null) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF");
- }
- else {
- expectedSchemaType = getDataTypeXsdTypeDefinition();
- }
-
- if (expectedSchemaType == null) {
- return;
- }
-
- boolean isItemType = isXmlList() && this.xmlSchemaType == null;
- if (! xsdFeature.typeIsValid(expectedSchemaType, isItemType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ATTRIBUTE__INVALID_SCHEMA_TYPE,
- new String[] { getValueTypeName(), xsdFeature.getName() },
- this,
- this.qName.getNameTextRange(astRoot)));
- }
- }
-
-
- protected class XmlAttributeQName
- extends AbstractJavaQName {
-
- protected XmlAttributeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlAttributeMapping.this.getJaxbPackage();
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ATTRIBUTE_DESC;
- }
-
- @Override
- public String getDefaultName() {
- return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttribute().getName();
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = GenericJavaXmlAttributeMapping.this.getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? EmptyIterable.instance() : xsdType.getAttributeNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage != null && jaxbPackage.getAttributeFormDefault() == XmlNsForm.QUALIFIED) ?
- GenericJavaXmlAttributeMapping.this.getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type != null) {
- if (type.getAttribute(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- if (createIfNull) {
- return GenericJavaXmlAttributeMapping.this.getOrCreateAnnotation();
- }
- else {
- return GenericJavaXmlAttributeMapping.this.getAnnotation();
- }
- }
- }
-
-
- protected class XmlIDREFContext
- extends AbstractJavaXmlNamedNodeMapping.XmlIDREFContext {
-
- public Iterable<ValidatableReference> getReferences() {
-
- return new SingleElementIterable<ValidatableReference>(
-
- new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return GenericJavaXmlAttributeMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- // 1) if we're getting here, XmlIDREF will not be null
- // 2) use the @XmlIDREF text range, since there is no specific place where the type is specified
- return GenericJavaXmlAttributeMapping.this.getXmlIDREF().getValidationTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return GenericJavaXmlAttributeMapping.this.getXsdFeature();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return GenericJavaXmlAttributeMapping.this.getQName().getNameTextRange(astRoot);
- }
- });
- }
-
- @Override
- public boolean isList() {
- return super.isList()
- || GenericJavaXmlAttributeMapping.this.getPersistentAttribute().isJavaResourceAttributeCollectionType();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
deleted file mode 100644
index e207b7f13e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElement
- extends AbstractJavaContextNode
- implements XmlElement {
-
- protected final Context context;
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedNillable;
-
- protected boolean defaultNillable;
-
- protected Boolean specifiedRequired;
-
- protected String defaultValue;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- public GenericJavaXmlElement(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedNillable = buildSpecifiedNillable();
- this.defaultNillable = buildDefaultNillable();
- this.specifiedRequired = buildSpecifiedRequired();
- this.defaultValue = buildDefaultValue();
- this.specifiedType = buildSpecifiedType();
- this.defaultType = buildDefaultType();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedNillable_(buildSpecifiedNillable());
- setDefaultNillable_(buildDefaultNillable());
- setSpecifiedRequired_(buildSpecifiedRequired());
- setDefaultValue_(buildDefaultValue());
- setSpecifiedType_(buildSpecifiedType());
- setDefaultType_(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- protected Context getContext() {
- return this.context;
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getContext().getAttributeMapping();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getContext().getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- return this.context.getAnnotation(createIfNull);
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlElementQName(this);
- }
-
-
- // ***** XmlElement.nillable *****
-
- public boolean isNillable() {
- return (this.specifiedNillable == null) ? isDefaultNillable() : getSpecifiedNillable().booleanValue();
- }
-
- public Boolean getSpecifiedNillable() {
- return this.specifiedNillable;
- }
-
- public void setSpecifiedNillable(Boolean newSpecifiedNillable) {
- getAnnotation(true).setNillable(newSpecifiedNillable);
- setSpecifiedNillable_(newSpecifiedNillable);
- }
-
- protected void setSpecifiedNillable_(Boolean newSpecifiedNillable) {
- Boolean oldNillable = this.specifiedNillable;
- this.specifiedNillable = newSpecifiedNillable;
- firePropertyChanged(SPECIFIED_NILLABLE_PROPERTY, oldNillable, newSpecifiedNillable);
- }
-
- protected Boolean buildSpecifiedNillable() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getNillable();
- }
-
- public boolean isDefaultNillable() {
- return this.defaultNillable;
- }
-
- protected void setDefaultNillable_(boolean newNillable) {
- boolean oldNillable = this.defaultNillable;
- this.defaultNillable = newNillable;
- firePropertyChanged(DEFAULT_NILLABLE_PROPERTY, oldNillable, newNillable);
- }
-
- protected boolean buildDefaultNillable() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getPersistentAttribute().isJavaResourceAttributeCollectionType() : false;
- }
-
-
- // ***** XmlElement.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation(true).setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlElement.defaultValue *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- getAnnotation(true).setDefaultValue(defaultValue);
- setDefaultValue_(defaultValue);
- }
-
- protected void setDefaultValue_(String defaultValue) {
- String oldDefaultValue = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, oldDefaultValue, defaultValue);
- }
-
- protected String buildDefaultValue() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getDefaultValue();
- }
-
-
- // ***** XmlElement.type *****
-
- public String getType() {
- return (this.specifiedType == null) ? getDefaultType() : this.specifiedType;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- getAnnotation(true).setType(newSpecifiedType);
- setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? null : annotation.getType();
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(String newType) {
- String oldType = this.defaultType;
- this.defaultType = newType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldType, newType);
- }
-
- protected String buildDefaultType() {
- return this.context.getDefaultType();
- }
-
- public String getFullyQualifiedType() {
- return (this.specifiedType == null) ? getDefaultType() : getAnnotation(false).getFullyQualifiedTypeName();
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- // only return the specified type - the default type should already be included
- return (this.specifiedType == null) ?
- EmptyIterable.<String>instance()
- : new SingleElementIterable(getFullyQualifiedType());
- }
-
- public XsdElementDeclaration getXsdElement() {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName());
- }
-
- /**
- * Return the expected schema type associated with the data type
- */
- public XsdTypeDefinition getTypeXsdTypeDefinition() {
- String type = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(type) || XmlElement.DEFAULT_TYPE_PROPERTY.equals(type)) {
- return null;
- }
-
- JaxbPackage pkg = getJaxbPackage();
- JaxbPackageInfo pkgInfo = (pkg == null) ? null : pkg.getPackageInfo();
- if (pkgInfo != null) {
- for (XmlSchemaType schemaType : pkgInfo.getXmlSchemaTypes()) {
- if (type.equals(schemaType.getFullyQualifiedType())) {
- return schemaType.getXsdTypeDefinition();
- }
- }
- }
-
- JaxbTypeMapping jaxbTypeMapping = getContextRoot().getTypeMapping(type);
- if (jaxbTypeMapping != null) {
- return jaxbTypeMapping.getXsdTypeDefinition();
- }
-
- String builtInType = getJaxbProject().getPlatform().getDefinition().getSchemaTypeMapping(type);
- if (builtInType != null) {
- return XsdUtil.getSchemaForSchema().getTypeDefinition(builtInType);
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTextRange(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- XmlElementAnnotation annotation = getAnnotation(false);
- return (annotation == null) ? getParent().getValidationTextRange(astRoot) : annotation.getTypeTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validateQName(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
- validateSchemaType(messages, reporter, astRoot);
- }
-
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.qName.validate(messages, reporter, astRoot);
- }
-
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String fqType = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__UNSPECIFIED_TYPE,
- this,
- getTypeTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(this.specifiedType)
- // verify that type actually exists before validating
- && JDTTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
- String attributeBaseType = getAttributeMapping().getValueTypeName();
- if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeBaseType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__ILLEGAL_TYPE,
- new String[] { attributeBaseType },
- this,
- getTypeTextRange(astRoot)));
-
- }
- }
- }
-
- protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdElementDeclaration xsdElement = getXsdElement();
- if (xsdElement == null) {
- return;
- }
-
- XsdTypeDefinition expectedSchemaType = null;
- String typeName = this.context.getAttributeMapping().getDataTypeName();
- if (! XmlElement.DEFAULT_TYPE_PROPERTY.equals(getFullyQualifiedType())) {
- typeName = getFullyQualifiedType();
- }
-
- if (this.context.hasXmlID()) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID");
- }
- else if (this.context.hasXmlIDREF()) {
- expectedSchemaType = XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF");
- }
- else if (this.context.hasXmlSchemaType()) {
- expectedSchemaType = this.context.getXmlSchemaType().getXsdTypeDefinition();
- }
- else if (! XmlElement.DEFAULT_TYPE_PROPERTY.equals(getFullyQualifiedType())) {
- expectedSchemaType = getTypeXsdTypeDefinition();
- }
- else {
- expectedSchemaType = this.context.getAttributeMapping().getDataTypeXsdTypeDefinition();
- }
-
- if (expectedSchemaType == null) {
- return;
- }
-
- if (! xsdElement.typeIsValid(expectedSchemaType, this.context.hasXmlList())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT__INVALID_SCHEMA_TYPE,
- new String[] { typeName, xsdElement.getName() },
- this,
- this.qName.getNameTextRange(astRoot)));
- }
- }
-
-
- protected class XmlElementQName
- extends AbstractJavaElementQName {
-
- protected XmlElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return GenericJavaXmlElement.this.getPersistentAttribute();
- }
-
- @Override
- protected XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElement.this.context.getElementWrapper();
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElement.this.getAnnotation(createIfNull);
- }
- }
-
-
- public interface Context {
-
- JaxbAttributeMapping getAttributeMapping();
-
- XmlElementAnnotation getAnnotation(boolean createIfNull);
-
- String getDefaultType();
-
- XmlElementWrapper getElementWrapper();
-
- boolean hasXmlID();
-
- boolean hasXmlIDREF();
-
- boolean hasXmlList();
-
- boolean hasXmlSchemaType();
-
- XmlSchemaType getXmlSchemaType();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java
deleted file mode 100644
index 75aae25adc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementMapping
- extends AbstractJavaXmlNamedNodeMapping<XmlElementAnnotation>
- implements XmlElementMapping {
-
- protected final XmlElement xmlElement;
-
- protected XmlElementWrapper xmlElementWrapper;
-
-
- public GenericJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElement = buildXmlElement();
- initializeXmlElementWrapper();
- }
-
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElement.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElement.update();
- updateXmlElementWrapper();
- }
-
-
- // ***** XmlElement *****
-
- public XmlElement getXmlElement() {
- return this.xmlElement;
- }
-
- protected XmlElement buildXmlElement() {
- return new GenericJavaXmlElement(this, new XmlElementContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (getXmlElementWrapper() != null) {
- getXmlElementWrapper().synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (getXmlElementWrapper() != null) {
- getXmlElementWrapper().update();
- }
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
-
- // ***** XmlList *****
-
- @Override
- protected boolean calculateDefaultXmlList() {
- return false;
- }
-
-
- // ***** XmlIDREF *****
-
- @Override
- protected GenericJavaXmlIDREF.Context buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getReferencedXmlTypeNames(),
- this.xmlElement.getReferencedXmlTypeNames());
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
- public XsdFeature getXsdFeature() {
- XsdTypeDefinition xsdType = getJaxbClassMapping().getXsdTypeDefinition();
- if (xsdType != null) {
- XmlElementWrapper elementWrapper = this.xmlElementWrapper;
-
- if (elementWrapper == null) {
- return xsdType.getElement(this.xmlElement.getQName().getNamespace(), this.xmlElement.getQName().getName());
- }
- else {
- XsdElementDeclaration xsdWrapperElement = elementWrapper.getXsdElementDeclaration();
- if (xsdWrapperElement != null) {
- return xsdWrapperElement.getElement(this.xmlElement.getQName().getNamespace(), this.xmlElement.getQName().getName());
- }
- }
- }
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElement.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected class XmlElementContext
- implements GenericJavaXmlElement.Context {
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- return (createIfNull) ?
- GenericJavaXmlElementMapping.this.getOrCreateAnnotation()
- : GenericJavaXmlElementMapping.this.getAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementMapping.this;
- }
-
- public String getDefaultType() {
- return GenericJavaXmlElementMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementMapping.this.getXmlElementWrapper();
- }
-
- public boolean hasXmlID() {
- return GenericJavaXmlElementMapping.this.getXmlID() != null;
- }
-
- public boolean hasXmlIDREF() {
- return GenericJavaXmlElementMapping.this.getXmlIDREF() != null;
- }
-
- public boolean hasXmlList() {
- return GenericJavaXmlElementMapping.this.isXmlList();
- }
-
- public boolean hasXmlSchemaType() {
- return getXmlSchemaType() != null;
- }
-
- public XmlSchemaType getXmlSchemaType() {
- return GenericJavaXmlElementMapping.this.getXmlSchemaType();
- }
- }
-
-
- protected class XmlIDREFContext
- extends AbstractJavaXmlNamedNodeMapping.XmlIDREFContext {
-
- public Iterable<ValidatableReference> getReferences() {
-
- return new SingleElementIterable<ValidatableReference>(
-
- new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return GenericJavaXmlElementMapping.this.xmlElement.getType();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- // 1) if we're getting here, XmlIDREF will not be null
- // 2) if there is an @XmlElement annotation, use that, otherwise use the @XmlIDREF
- return (GenericJavaXmlElementMapping.this.getAnnotation() == null) ?
- GenericJavaXmlElementMapping.this.getXmlIDREF().getValidationTextRange(astRoot)
- : GenericJavaXmlElementMapping.this.xmlElement.getTypeTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return GenericJavaXmlElementMapping.this.getXsdFeature();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return GenericJavaXmlElementMapping.this.xmlElement.getQName().getNameTextRange(astRoot);
- }
- });
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
deleted file mode 100644
index 9141e40481..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRef
- extends AbstractJavaContextNode
- implements XmlElementRef {
-
- protected final Context context;
-
- protected final JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
- protected String specifiedType;
-
- protected String defaultType;
-
-
- public GenericJavaXmlElementRef(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedType = buildSpecifiedType();
- this.defaultType = buildDefaultType();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- setSpecifiedType_(buildSpecifiedType());
- setDefaultType_(buildDefaultType());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
- @Override
- public JavaContextNode getParent() {
- return (JavaContextNode) super.getParent();
- }
-
- protected Context getContext() {
- return this.context;
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getContext().getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- protected JaxbQName buildQName() {
- return new XmlElementRefQName(this);
- }
-
-
- // ***** XmlElementRef.required *****
-
- public boolean isRequired() {
- return (this.specifiedRequired == null) ? isDefaultRequired() : this.specifiedRequired.booleanValue();
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation().setRequired(newSpecifiedRequired);
- setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- return getAnnotation().getRequired();
- }
-
- public boolean isDefaultRequired() {
- return false;
- }
-
-
- // ***** XmlElementRef.type *****
-
- public String getType() {
- return (this.specifiedType == null) ? getDefaultType() : this.specifiedType;
- }
-
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String newSpecifiedType) {
- getAnnotation().setType(newSpecifiedType);
- setSpecifiedType_(newSpecifiedType);
- }
-
- protected void setSpecifiedType_(String newSpecifiedType) {
- String oldType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldType, newSpecifiedType);
- }
-
- protected String buildSpecifiedType() {
- return getAnnotation().getType();
- }
-
- public String getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(String newType) {
- String oldType = this.defaultType;
- this.defaultType = newType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldType, newType);
- }
-
- protected String buildDefaultType() {
- return this.context.getDefaultType();
- }
-
- public String getFullyQualifiedType() {
- return (this.specifiedType == null) ? getDefaultType() : getAnnotation().getFullyQualifiedTypeName();
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- // only return the specified type - the default type should already be included
- if (this.specifiedType != null
- && ! isTypeJAXBElement()) {
- return new SingleElementIterable(getFullyQualifiedType());
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean isTypeJAXBElement() {
- return (StringTools.stringsAreEqual(JAXB.JAXB_ELEMENT, getFullyQualifiedType()));
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTypeTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.qName.validate(messages, reporter, astRoot);
- validateType(messages, reporter, astRoot);
- }
-
- protected void validateType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- String fqType = getFullyQualifiedType();
- if (StringTools.stringIsEmpty(fqType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__UNSPECIFIED_TYPE,
- this,
- getTypeTextRange(astRoot)));
- }
- else if (! StringTools.stringIsEmpty(this.specifiedType)
- // verify that type actually exists before validating
- && JDTTools.findType(getJaxbProject().getJavaProject(), fqType) != null) {
- String attributeValueType = getContext().getAttributeMapping().getValueTypeName();
- if (! JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), fqType, attributeValueType)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__ILLEGAL_TYPE,
- new String[] { attributeValueType },
- this,
- getTypeTextRange(astRoot)));
-
- }
-
- // if type is a persistent class, check that it or a subclass has a root element specified
- JaxbTypeMapping typeMapping = getJaxbProject().getContextRoot().getTypeMapping(fqType);
- if (typeMapping != null && ! typeMapping.hasRootElementInHierarchy()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_ROOT_ELEMENT,
- new String[] { attributeValueType },
- this,
- getTypeTextRange(astRoot)));
- }
- }
- }
-
-
- protected class XmlElementRefQName
- extends AbstractJavaElementQName {
-
- protected XmlElementRefQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return GenericJavaXmlElementRef.this.getPersistentAttribute();
- }
-
- protected boolean isTypeJAXBElement() {
- return GenericJavaXmlElementRef.this.isTypeJAXBElement();
- }
-
- protected JaxbTypeMapping getReferencedTypeMapping() {
- String fqTypeName = GenericJavaXmlElementRef.this.getFullyQualifiedType();
- return getJaxbProject().getContextRoot().getTypeMapping(fqTypeName);
- }
-
- @Override
- protected XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRef.this.context.getElementWrapper();
- }
-
- @Override
- public String getDefaultName() {
- if (isTypeJAXBElement()) {
- return super.getDefaultName();
- }
-
- JaxbTypeMapping referencedTypeMapping = getReferencedTypeMapping();
- if (referencedTypeMapping != null) {
- XmlRootElement rootElement = referencedTypeMapping.getXmlRootElement();
- if (rootElement != null) {
- return rootElement.getQName().getName();
- }
- }
-
- return "";
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbTypeMapping referencedTypeMapping = getReferencedTypeMapping();
- if (referencedTypeMapping != null) {
- XmlRootElement rootElement = referencedTypeMapping.getXmlRootElement();
- if (rootElement != null) {
- return rootElement.getQName().getNamespace();
- }
- }
-
- return super.getDefaultNamespace();
- }
-
- @Override
- protected void validateName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // only validate if type is JAXBElement
- if (isTypeJAXBElement()) {
- super.validateName(messages, reporter, astRoot);
- }
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validateReference(messages, reporter, astRoot);
-
- // if type is JAXBElement, then name/namespace must also point at a valid XmlElementDecl
- if (! isTypeJAXBElement()) {
- return;
- }
-
- XmlRegistry registry = getJaxbPackage().getRegistry();
-
- if (registry == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_REGISTRY,
- this,
- getValidationTextRange(astRoot)));
- return;
- }
-
- for (JaxbElementFactoryMethod elementDecl : registry.getElementFactoryMethods()) {
- if (Tools.valuesAreEqual(getName(), elementDecl.getQName().getName())
- && Tools.valuesAreEqual(getNamespace(), elementDecl.getQName().getNamespace())) {
- return;
- }
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL,
- new String[] { getNamespace(), getName() },
- this,
- getValidationTextRange(astRoot)));
-
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElementRef.this.getAnnotation();
- }
- }
-
-
- public interface Context {
-
- JaxbAttributeMapping getAttributeMapping();
-
- XmlElementRefAnnotation getAnnotation();
-
- String getDefaultType();
-
- XmlElementWrapper getElementWrapper();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java
deleted file mode 100644
index 9362158238..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefMapping.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementRefAnnotation>
- implements XmlElementRefMapping {
-
- protected final XmlElementRef xmlElementRef;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementRef = buildXmlElementRef();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRef.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRef.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** XmlElementRef *****
-
- public XmlElementRef getXmlElementRef() {
- return this.xmlElementRef;
- }
-
- protected XmlElementRef buildXmlElementRef() {
- return new GenericJavaXmlElementRef(this, new XmlElementRefContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRef.getReferencedXmlTypeNames();
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRef.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRef.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
- }
-
-
- public class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- public XmlElementRefAnnotation getAnnotation() {
- return GenericJavaXmlElementRefMapping.this.getAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementRefMapping.this;
- }
-
- public String getDefaultType() {
- return GenericJavaXmlElementRefMapping.this.getPersistentAttribute().getJavaResourceAttributeBaseTypeName();
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRefMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
deleted file mode 100644
index c7e0f48e47..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefs.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefs
- extends AbstractJavaContextNode
- implements XmlElementRefs {
-
- protected final Context context;
-
- protected final ContextListContainer<XmlElementRef, XmlElementRefAnnotation> xmlElementRefContainer;
-
-
- public GenericJavaXmlElementRefs(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- this.xmlElementRefContainer = this.buildXmlElementRefContainer();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRefContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefContainer.update();
- }
-
-
- // ***** xml element refs *****
-
- public ListIterable<XmlElementRef> getXmlElementRefs() {
- return this.xmlElementRefContainer.getContextElements();
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefContainer.getContextElementsSize();
- }
-
- public XmlElementRef addXmlElementRef(int index) {
- XmlElementRefAnnotation annotation = this.context.addXmlElementRefAnnotation(index);
- return this.xmlElementRefContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlElementRef(int index) {
- this.context.removeXmlElementRefAnnotation(index);
- this.xmlElementRefContainer.removeContextElement(index);
- }
-
- public void removeXmlElementRef(XmlElementRef xmlElementRef) {
- removeXmlElementRef(this.xmlElementRefContainer.indexOfContextElement(xmlElementRef));
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- this.context.moveXmlElementRefAnnotation(targetIndex, sourceIndex);
- this.xmlElementRefContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlElementRef buildXmlElementRef(XmlElementRefAnnotation xmlElementRefAnnotation) {
- return this.context.buildXmlElementRef(this, xmlElementRefAnnotation);
- }
-
- protected ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- return this.context.getXmlElementRefAnnotations();
- }
-
- protected ContextListContainer<XmlElementRef, XmlElementRefAnnotation> buildXmlElementRefContainer() {
- XmlElementRefContainer container = new XmlElementRefContainer();
- container.initialize();
- return container;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (XmlElementRef elementRef : getXmlElementRefs()) {
- result = elementRef.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateTypesAndQNames(messages, reporter, astRoot);
-
- for (XmlElementRef elementRef : getXmlElementRefs()) {
- elementRef.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- Bag<String> xmlElementRefTypes = new HashBag<String>();
- Bag<QName> xmlElementRefQnames = new HashBag<QName>();
-
- for (XmlElementRef xmlElementRef : getXmlElementRefs()) {
- String typeName = xmlElementRef.getFullyQualifiedType();
- boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName);
- if (! isJaxbElement && ! StringTools.stringIsEmpty(typeName)) {
- xmlElementRefTypes.add(typeName);
- }
- String elementRefName = xmlElementRef.getQName().getName();
- if (isJaxbElement && ! StringTools.stringIsEmpty(elementRefName)) {
- xmlElementRefQnames.add(new QName(xmlElementRef.getQName().getNamespace(), elementRefName));
- }
- }
-
- for (XmlElementRef xmlElementRef : getXmlElementRefs()) {
- String typeName = xmlElementRef.getFullyQualifiedType();
- boolean isJaxbElement = JAXB.JAXB_ELEMENT.equals(typeName);
- if (! isJaxbElement && xmlElementRefTypes.count(typeName) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE,
- new String[] { typeName },
- xmlElementRef,
- xmlElementRef.getTypeTextRange(astRoot)));
- }
-
- String xmlElementNamespace = xmlElementRef.getQName().getNamespace();
- String xmlElementName = xmlElementRef.getQName().getName();
- if (isJaxbElement && xmlElementRefQnames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName },
- xmlElementRef,
- xmlElementRef.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
-
- // ***** misc *****
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- new TransformationIterable<XmlElementRef, Iterable<String>>(getXmlElementRefs()) {
- @Override
- protected Iterable<String> transform(XmlElementRef xmlElementRef) {
- return xmlElementRef.getReferencedXmlTypeNames();
- }
- });
- }
-
-
-
- protected class XmlElementRefContainer
- extends ContextListContainer<XmlElementRef, XmlElementRefAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlElementRefs.XML_ELEMENT_REFS_LIST;
- }
-
- @Override
- protected XmlElementRef buildContextElement(XmlElementRefAnnotation resourceElement) {
- return GenericJavaXmlElementRefs.this.buildXmlElementRef(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlElementRefAnnotation> getResourceElements() {
- return GenericJavaXmlElementRefs.this.getXmlElementRefAnnotations();
- }
-
- @Override
- protected XmlElementRefAnnotation getResourceElement(XmlElementRef contextElement) {
- // in this context, there will never be an XmlElementRef without an annotation
- return contextElement.getAnnotation();
- }
- }
-
-
- public interface Context {
-
- ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations();
-
- XmlElementRefAnnotation addXmlElementRefAnnotation(int index);
-
- void removeXmlElementRefAnnotation(int index);
-
- void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex);
-
- XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation);
-
- TextRange getValidationTextRange(CompilationUnit astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java
deleted file mode 100644
index 48bbf2022c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRefsMapping.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementRefsMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementRefsAnnotation>
- implements XmlElementRefsMapping {
-
- protected final XmlElementRefs xmlElementRefs;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlMixed xmlMixed;
-
-
- public GenericJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementRefs = buildXmlElementRefs();
- initializeXmlElementWrapper();
- initializeXmlMixed();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementRefs.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlMixed();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementRefs.update();
- updateXmlElementWrapper();
- updateXmlMixed();
- }
-
-
- // ***** XmlElementRefs *****
-
- public XmlElementRefs getXmlElementRefs() {
- return this.xmlElementRefs;
- }
-
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
-
- // ***** XmlMixed *****
-
- public XmlMixed getXmlMixed() {
- return this.xmlMixed;
- }
-
- protected void setXmlMixed_(XmlMixed xmlMixed) {
- XmlMixed oldXmlMixed = this.xmlMixed;
- this.xmlMixed = xmlMixed;
- firePropertyChanged(XML_MIXED_PROPERTY, oldXmlMixed, xmlMixed);
- }
-
- public XmlMixed addXmlMixed() {
- if (this.xmlMixed != null) {
- throw new IllegalStateException();
- }
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) getJavaResourceAttribute().addAnnotation(JAXB.XML_MIXED);
-
- XmlMixed xmlMixed = buildXmlMixed(annotation);
- setXmlMixed_(xmlMixed);
- return xmlMixed;
- }
-
- public void removeXmlMixed() {
- if (this.xmlMixed == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_MIXED);
- setXmlMixed_(null);
- }
-
- protected XmlMixedAnnotation getXmlMixedAnnotation() {
- return (XmlMixedAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_MIXED);
- }
-
- protected XmlMixed buildXmlMixed(XmlMixedAnnotation xmlMixedAnnotation) {
- return new GenericJavaXmlMixed(this, xmlMixedAnnotation);
- }
-
- protected void initializeXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- this.xmlMixed = buildXmlMixed(annotation);
- }
- }
-
- protected void syncXmlMixed() {
- XmlMixedAnnotation annotation = getXmlMixedAnnotation();
- if (annotation != null) {
- if (this.xmlMixed != null) {
- this.xmlMixed.synchronizeWithResourceModel();
- }
- else {
- setXmlMixed_(buildXmlMixed(annotation));
- }
- }
- else {
- setXmlMixed_(null);
- }
- }
-
- protected void updateXmlMixed() {
- if (this.xmlMixed != null) {
- this.xmlMixed.update();
- }
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.xmlElementRefs.getReferencedXmlTypeNames();
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.xmlElementRefs.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.xmlElementRefs.validate(messages, reporter, astRoot);
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlMixed != null) {
- this.xmlMixed.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected class XmlElementRefsContext
- implements GenericJavaXmlElementRefs.Context {
-
- protected XmlElementRefsAnnotation getXmlElementRefsAnnotation() {
- return GenericJavaXmlElementRefsMapping.this.getAnnotation();
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefAnnotations() {
- return getXmlElementRefsAnnotation().getXmlElementRefs();
- }
-
- public XmlElementRefAnnotation addXmlElementRefAnnotation(int index) {
- return getXmlElementRefsAnnotation().addXmlElementRef(index);
- }
-
- public void removeXmlElementRefAnnotation(int index) {
- getXmlElementRefsAnnotation().removeXmlElementRef(index);
- }
-
- public void moveXmlElementRefAnnotation(int targetIndex, int sourceIndex) {
- getXmlElementRefsAnnotation().moveXmlElementRef(targetIndex, sourceIndex);
- }
-
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new GenericJavaXmlElementRef(parent, new XmlElementRefContext(annotation));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlElementRefsAnnotation().getTextRange(astRoot);
- }
- }
-
-
- protected class XmlElementRefContext
- implements GenericJavaXmlElementRef.Context {
-
- protected XmlElementRefAnnotation annotation;
-
- public XmlElementRefContext(XmlElementRefAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementRefAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementRefsMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementRefsMapping.this.getXmlElementWrapper();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
deleted file mode 100644
index 23f7c5aa00..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlElementWrapper
- extends AbstractJavaContextNode
- implements XmlElementWrapper {
-
- protected final Context context;
-
- protected JaxbQName qName;
-
- protected Boolean specifiedRequired;
-
- protected Boolean specifiedNillable;
-
-
- public GenericJavaXmlElementWrapper(JaxbAttributeMapping parent, Context context) {
- super(parent);
- this.context = context;
- this.qName = buildQName();
- this.specifiedRequired = buildSpecifiedRequired();
- this.specifiedNillable = this.buildSpecifiedNillable();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlElementQName(this);
- }
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getAttributeMapping().getPersistentAttribute();
- }
-
- protected JaxbClassMapping getJaxbClassMapping() {
- return getPersistentAttribute().getClassMapping();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbClassMapping().getJaxbType().getJaxbPackage();
- }
-
- protected XmlElementWrapperAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- setSpecifiedRequired_(buildSpecifiedRequired());
- this.setSpecifiedNillable_(this.buildSpecifiedNillable());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ***** schema component ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- //************ XmlElementWrapper.required ***************
-
- public boolean isRequired() {
- return (this.getSpecifiedRequired() == null) ? this.isDefaultRequired() : this.getSpecifiedRequired().booleanValue();
- }
-
- public boolean isDefaultRequired() {
- return DEFAULT_REQUIRED;
- }
-
- public Boolean getSpecifiedRequired() {
- return this.specifiedRequired;
- }
-
- public void setSpecifiedRequired(Boolean newSpecifiedRequired) {
- getAnnotation().setRequired(newSpecifiedRequired);
- this.setSpecifiedRequired_(newSpecifiedRequired);
- }
-
- protected void setSpecifiedRequired_(Boolean newSpecifiedRequired) {
- Boolean oldRequired = this.specifiedRequired;
- this.specifiedRequired = newSpecifiedRequired;
- firePropertyChanged(SPECIFIED_REQUIRED_PROPERTY, oldRequired, newSpecifiedRequired);
- }
-
- protected Boolean buildSpecifiedRequired() {
- return getAnnotation().getRequired();
- }
-
-
- //************ XmlElementWrapper.nillable ***************
-
- public boolean isNillable() {
- return (this.getSpecifiedNillable() == null) ? this.isDefaultNillable() : this.getSpecifiedNillable().booleanValue();
- }
-
- public boolean isDefaultNillable() {
- return DEFAULT_NILLABLE;
- }
-
- public Boolean getSpecifiedNillable() {
- return this.specifiedNillable;
- }
-
- public void setSpecifiedNillable(Boolean newSpecifiedNillable) {
- getAnnotation().setNillable(newSpecifiedNillable);
- this.setSpecifiedNillable_(newSpecifiedNillable);
- }
-
- protected void setSpecifiedNillable_(Boolean newSpecifiedNillable) {
- Boolean oldNillable = this.specifiedNillable;
- this.specifiedNillable = newSpecifiedNillable;
- firePropertyChanged(SPECIFIED_NILLABLE_PROPERTY, oldNillable, newSpecifiedNillable);
- }
-
- protected Boolean buildSpecifiedNillable() {
- return getAnnotation().getNillable();
- }
-
-
- // **************** misc **************************************************
-
- public XsdElementDeclaration getXsdElementDeclaration() {
- XsdTypeDefinition xsdType = getPersistentAttribute().getClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName());
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
-
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (! getPersistentAttribute().isJavaResourceAttributeCollectionType()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION,
- this,
- getValidationTextRange(astRoot)));
- }
-
- validateQName(messages, reporter, astRoot);
- }
-
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.qName.validate(messages, reporter, astRoot);
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
-
- public interface Context {
-
- /**
- * This should never be null
- */
- XmlElementWrapperAnnotation getAnnotation();
- }
-
-
- public static class SimpleContext
- implements Context {
-
- protected XmlElementWrapperAnnotation annotation;
-
- public SimpleContext(XmlElementWrapperAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementWrapperAnnotation getAnnotation() {
- return this.annotation;
- }
- }
-
-
- protected class XmlElementQName
- extends AbstractJavaQName {
-
- protected XmlElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlElementWrapper.this.getJaxbPackage();
- }
-
- @Override
- public String getDefaultName() {
- return "";
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage != null && jaxbPackage.getElementFormDefault() == XmlNsForm.QUALIFIED) ?
- GenericJavaXmlElementWrapper.this.getJaxbClassMapping().getQName().getNamespace() : "";
- }
-
- @Override
- public Iterable<String> getNameProposals(Filter<String> filter) {
- XsdTypeDefinition xsdType = GenericJavaXmlElementWrapper.this.getJaxbClassMapping().getXsdTypeDefinition();
- return (xsdType == null) ? EmptyIterable.instance() : xsdType.getElementNameProposals(getNamespace(), filter);
- }
-
- @Override
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- return (schema == null) ? EmptyIterable.<String>instance() : schema.getNamespaceProposals(filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition type = getJaxbClassMapping().getXsdTypeDefinition();
- if (type == null) {
- return;
- }
-
- if (type.getElement(getNamespace(), getName()) == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlElementWrapper.this.getAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java
deleted file mode 100644
index 993b48d308..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableReference;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlElementsMapping
- extends AbstractJavaAdaptableAttributeMapping<XmlElementsAnnotation>
- implements XmlElementsMapping {
-
- protected final ContextListContainer<XmlElement, XmlElementAnnotation> xmlElementContainer;
-
- protected XmlElementWrapper xmlElementWrapper;
-
- protected XmlIDREF xmlIDREF;
-
-
- public GenericJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlElementContainer = buildXmlElementContainer();
- initializeXmlElementWrapper();
- initializeXmlIDREF();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlElementContainer.synchronizeWithResourceModel();
- syncXmlElementWrapper();
- syncXmlIDREF();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlElementContainer.update();
- updateXmlElementWrapper();
- updateXmlIDREF();
- }
-
-
- // ***** xml elements *****
-
- public ListIterable<XmlElement> getXmlElements() {
- return this.xmlElementContainer.getContextElements();
- }
-
- public int getXmlElementsSize() {
- return this.xmlElementContainer.getContextElementsSize();
- }
-
- public XmlElement addXmlElement(int index) {
- XmlElementAnnotation annotation = getAnnotation().addXmlElement(index);
- return this.xmlElementContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlElement(int index) {
- getAnnotation().removeXmlElement(index);
- this.xmlElementContainer.removeContextElement(index);
- }
-
- public void removeXmlElement(XmlElement xmlElement) {
- removeXmlElement(this.xmlElementContainer.indexOfContextElement(xmlElement));
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- getAnnotation().moveXmlElement(targetIndex, sourceIndex);
- this.xmlElementContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlElement buildXmlElement(XmlElementAnnotation xmlElementAnnotation) {
- return new GenericJavaXmlElement(this, new XmlElementContext(xmlElementAnnotation));
- }
-
- protected ListIterable<XmlElementAnnotation> getXmlElementAnnotations() {
- return getAnnotation().getXmlElements();
- }
-
-
- // ***** XmlElementWrapper *****
-
- public XmlElementWrapper getXmlElementWrapper() {
- return this.xmlElementWrapper;
- }
-
- public XmlElementWrapper addXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- XmlElementWrapper xmlElementWrapper = buildXmlElementWrapper();
- setXmlElementWrapper_(xmlElementWrapper);
- return xmlElementWrapper;
- }
-
- public void removeXmlElementWrapper() {
- if (this.xmlElementWrapper == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- setXmlElementWrapper_(null);
- }
-
- protected void setXmlElementWrapper_(XmlElementWrapper xmlElementWrapper) {
- XmlElementWrapper oldXmlElementWrapper = this.xmlElementWrapper;
- this.xmlElementWrapper = xmlElementWrapper;
- firePropertyChanged(XML_ELEMENT_WRAPPER_PROPERTY, oldXmlElementWrapper, xmlElementWrapper);
- }
-
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new GenericJavaXmlElementWrapper(this, new GenericJavaXmlElementWrapper.SimpleContext(getXmlElementWrapperAnnotation()));
- }
-
- protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() {
- return (XmlElementWrapperAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- protected void initializeXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- this.xmlElementWrapper = buildXmlElementWrapper();
- }
- }
-
- protected void syncXmlElementWrapper() {
- if (getXmlElementWrapperAnnotation() != null) {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.synchronizeWithResourceModel();
- }
- else {
- setXmlElementWrapper_(buildXmlElementWrapper());
- }
- }
- else {
- setXmlElementWrapper_(null);
- }
- }
-
- protected void updateXmlElementWrapper() {
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.update();
- }
- }
-
- protected ContextListContainer<XmlElement, XmlElementAnnotation> buildXmlElementContainer() {
- XmlElementContainer container = new XmlElementContainer();
- container.initialize();
- return container;
- }
-
-
- // ***** XmlIDREF *****
-
- public XmlIDREF getXmlIDREF() {
- return this.xmlIDREF;
- }
-
- protected void setXmlIDREF_(XmlIDREF xmlIDREF) {
- XmlIDREF oldXmlIDREF = this.xmlIDREF;
- this.xmlIDREF = xmlIDREF;
- firePropertyChanged(XML_IDREF_PROPERTY, oldXmlIDREF, xmlIDREF);
- }
-
- public XmlIDREF addXmlIDREF() {
- if (this.xmlIDREF != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(JAXB.XML_IDREF);
- XmlIDREF xmlIDREF = buildXmlIDREF();
- setXmlIDREF_(xmlIDREF);
- return xmlIDREF;
- }
-
- public void removeXmlIDREF() {
- if (this.xmlIDREF == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(JAXB.XML_IDREF);
- setXmlIDREF_(null);
- }
-
- protected void initializeXmlIDREF() {
- if (getXmlIDREFAnnotation() != null) {
- this.xmlIDREF = buildXmlIDREF();
- }
- }
-
- protected void syncXmlIDREF() {
- if (getXmlIDREFAnnotation() == null) {
- setXmlIDREF_(null);
- }
- else if (this.xmlIDREF == null) {
- setXmlIDREF_(buildXmlIDREF());
- }
- else {
- this.xmlIDREF.synchronizeWithResourceModel();
- }
- }
-
- protected void updateXmlIDREF() {
- if (this.xmlIDREF != null) {
- this.xmlIDREF.update();
- }
- }
- protected XmlIDREFAnnotation getXmlIDREFAnnotation() {
- return (XmlIDREFAnnotation) getJavaResourceAttribute().getAnnotation(JAXB.XML_IDREF);
- }
-
- protected XmlIDREF buildXmlIDREF() {
- return new GenericJavaXmlIDREF(this, buildXmlIDREFContext());
- }
-
- protected XmlIDREFContext buildXmlIDREFContext() {
- return new XmlIDREFContext();
- }
-
-
- // ***** misc *****
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return new CompositeIterable<String>(
- super.getReferencedXmlTypeNames(),
- new CompositeIterable<String>(
- new TransformationIterable<XmlElement, Iterable<String>>(getXmlElements()) {
- @Override
- protected Iterable<String> transform(XmlElement o) {
- return o.getReferencedXmlTypeNames();
- }
- }));
- }
-
- @Override
- public boolean isParticleMapping() {
- return true;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (XmlElement xmlElement : getXmlElements()) {
- result = xmlElement.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- if (this.xmlElementWrapper != null) {
- result = this.xmlElementWrapper.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateDuplicateTypesAndQNames(messages, reporter, astRoot);
-
- for (XmlElement xmlElement : getXmlElements()) {
- xmlElement.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlElementWrapper != null) {
- this.xmlElementWrapper.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlIDREF != null) {
- this.xmlIDREF.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateTypesAndQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- Bag<String> xmlElementTypes = new HashBag<String>();
- Bag<QName> xmlElementQNames = new HashBag<QName>();
-
- for (XmlElement xmlElement : getXmlElements()) {
- String typeName = xmlElement.getFullyQualifiedType();
- if (! StringTools.stringIsEmpty(typeName)) {
- xmlElementTypes.add(typeName);
- }
- String elementName = xmlElement.getQName().getName();
- if (! StringTools.stringIsEmpty(elementName)) {
- xmlElementQNames.add(new QName(xmlElement.getQName().getNamespace(), elementName));
- }
- }
-
- for (XmlElement xmlElement : getXmlElements()) {
- validateDuplicateType(xmlElement, xmlElementTypes, messages, astRoot);
- validateDuplicateQName(xmlElement, xmlElementQNames, messages, astRoot);
- }
- }
-
- protected void validateDuplicateType(XmlElement xmlElement, Bag<String> xmlElementTypes,
- List<IMessage> messages, CompilationUnit astRoot) {
- String xmlElementType = xmlElement.getFullyQualifiedType();
- if (xmlElementTypes.count(xmlElementType) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE,
- new String[] { xmlElementType },
- xmlElement,
- xmlElement.getTypeTextRange(astRoot)));
- }
- }
-
- protected void validateDuplicateQName(XmlElement xmlElement, Bag<QName> xmlElementQNames,
- List<IMessage> messages, CompilationUnit astRoot) {
- String xmlElementNamespace = xmlElement.getQName().getNamespace();
- String xmlElementName = xmlElement.getQName().getName();
- if (xmlElementQNames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName },
- xmlElement,
- xmlElement.getQName().getNameTextRange(astRoot)));
- }
- }
-
- protected class XmlElementContainer
- extends ContextListContainer<XmlElement, XmlElementAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlElementsMapping.XML_ELEMENTS_LIST;
- }
-
- @Override
- protected XmlElement buildContextElement(XmlElementAnnotation resourceElement) {
- return GenericJavaXmlElementsMapping.this.buildXmlElement(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlElementAnnotation> getResourceElements() {
- return GenericJavaXmlElementsMapping.this.getXmlElementAnnotations();
- }
-
- @Override
- protected XmlElementAnnotation getResourceElement(XmlElement contextElement) {
- // in the context of this mapping, there will never be an XmlElement without an annotation
- return contextElement.getAnnotation(false);
- }
- }
-
-
- protected class XmlElementContext
- implements GenericJavaXmlElement.Context {
-
- protected XmlElementAnnotation annotation;
-
- protected XmlElementContext(XmlElementAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlElementAnnotation getAnnotation(boolean createIfNull) {
- // will never be null in this context
- return annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return GenericJavaXmlElementsMapping.this;
- }
-
- public String getDefaultType() {
- return null;
- }
-
- public XmlElementWrapper getElementWrapper() {
- return GenericJavaXmlElementsMapping.this.getXmlElementWrapper();
- }
-
- public boolean hasXmlID() {
- return false;
- }
-
- public boolean hasXmlIDREF() {
- return GenericJavaXmlElementsMapping.this.getXmlIDREF() != null;
- }
-
- public boolean hasXmlList() {
- return false;
- }
-
- public boolean hasXmlSchemaType() {
- return false;
- }
-
- public XmlSchemaType getXmlSchemaType() {
- return null;
- }
- }
-
-
- protected class XmlIDREFContext
- implements GenericJavaXmlIDREF.Context {
-
- public XmlIDREFAnnotation getAnnotation() {
- return GenericJavaXmlElementsMapping.this.getXmlIDREFAnnotation();
- }
-
- public Iterable<ValidatableReference> getReferences() {
- return new TransformationIterable<XmlElement, ValidatableReference>(
- GenericJavaXmlElementsMapping.this.getXmlElements()) {
-
- @Override
- protected ValidatableReference transform(final XmlElement o) {
-
- return new ValidatableReference() {
-
- public String getFullyQualifiedType() {
- return o.getFullyQualifiedType();
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return o.getTypeTextRange(astRoot);
- }
-
- public XsdFeature getXsdFeature() {
- return o.getXsdElement();
- }
-
- public TextRange getXsdFeatureTextRange(CompilationUnit astRoot) {
- return o.getQName().getNameTextRange(astRoot);
- }
- };
- }
- };
- }
-
- public boolean isList() {
- return false;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java
deleted file mode 100644
index c9b039ad82..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlID
- extends AbstractJavaContextNode
- implements XmlID
-{
-
- protected final XmlIDAnnotation resourceXmlID;
-
- public GenericJavaXmlID(XmlNamedNodeMapping parent, XmlIDAnnotation resource) {
- super(parent);
- this.resourceXmlID = resource;
- }
-
-
- public XmlNamedNodeMapping getMapping() {
- return (XmlNamedNodeMapping) getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getMapping().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateAttributeType(messages, astRoot);
-
- XsdFeature xsdFeature = getMapping().getXsdFeature();
- if (xsdFeature == null) {
- return;
- }
-
- XsdTypeDefinition idrefType = XsdUtil.getSchemaForSchema().getTypeDefinition("ID");
- if (! xsdFeature.typeIsValid(idrefType, false)) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__SCHEMA_TYPE_NOT_ID,
- new String [] { xsdFeature.getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) {
- if (! getPersistentAttribute().isJavaResourceAttributeTypeSubTypeOf(String.class.getName())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID__ATTRIBUTE_TYPE_NOT_STRING,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlID.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
deleted file mode 100644
index 903a8ead21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlIDREF.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlIDREF;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdFeature;
-import org.eclipse.jpt.jaxb.core.xsd.XsdUtil;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlIDREF
- extends AbstractJavaContextNode
- implements XmlIDREF {
-
- protected final Context context;
-
-
- public GenericJavaXmlIDREF(JaxbAttributeMapping parent, Context context) {
- super(parent);
- this.context = context;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- for (ValidatableReference ref : this.context.getReferences()) {
- String typeName = ref.getFullyQualifiedType();
-
- // Object may be used in some cases of a *single* type, but can't be validated
- if (! (Object.class.getName().equals(typeName) && CollectionTools.size(this.context.getReferences()) == 1)) {
-
- JaxbClassMapping classMapping = getContextRoot().getClassMapping(typeName);
- if (classMapping == null || classMapping.getXmlIdMapping() == null) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID,
- new String[] { typeName },
- this,
- ref.getTypeTextRange(astRoot)));
- }
- }
-
- XsdFeature xsdFeature = ref.getXsdFeature();
- if (xsdFeature == null) {
- return;
- }
- if (xsdFeature != null
- && ! xsdFeature.typeIsValid(XsdUtil.getSchemaForSchema().getTypeDefinition("IDREF"), this.context.isList())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ID_REF__SCHEMA_TYPE_NOT_IDREF,
- new String [] { xsdFeature.getName() },
- this,
- ref.getXsdFeatureTextRange(astRoot)));
- }
- }
- }
-
-
- public interface Context {
-
- XmlIDREFAnnotation getAnnotation();
-
- Iterable<ValidatableReference> getReferences();
-
- boolean isList();
- }
-
-
- public interface ValidatableReference {
-
- String getFullyQualifiedType();
-
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- XsdFeature getXsdFeature();
-
- TextRange getXsdFeatureTextRange(CompilationUnit astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
deleted file mode 100644
index 4898ebd157..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlMixed.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlMixed;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-public class GenericJavaXmlMixed
- extends AbstractJavaContextNode
- implements XmlMixed {
-
- protected final XmlMixedAnnotation resourceXmlMixed;
-
-
- public GenericJavaXmlMixed(JaxbAttributeMapping parent, XmlMixedAnnotation resource) {
- super(parent);
- this.resourceXmlMixed = resource;
- }
-
-
- @Override
- public JaxbAttributeMapping getParent() {
- return (JaxbAttributeMapping) super.getParent();
- }
-
- protected JaxbPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
-
- //************* validation ****************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceXmlMixed.getTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
deleted file mode 100644
index d317dffb14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlNs.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-public class GenericJavaXmlNs
- extends AbstractJavaContextNode
- implements XmlNs {
-
- protected final XmlNsAnnotation resourceXmlNs;
-
- protected String namespaceURI;
-
- protected String prefix;
-
-
- public GenericJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
- super(parent);
- this.resourceXmlNs = xmlNsAnnotation;
- this.namespaceURI = this.getResourceNamespaceURI();
- this.prefix = this.getResourcePrefix();
- }
-
-
- public XmlNsAnnotation getResourceXmlNs() {
- return this.resourceXmlNs;
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setNamespaceURI_(this.getResourceNamespaceURI());
- this.setPrefix_(this.getResourcePrefix());
- }
-
-
- protected JaxbPackageInfo getJaxbPackageInfo() {
- return getXmlSchema().getJaxbPackageInfo();
- }
-
- protected XmlSchema getXmlSchema() {
- return (XmlSchema) getParent();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getJaxbPackageInfo().getResourcePackage();
- }
-
-
- // ***** namespaceURI *****
-
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- public void setNamespaceURI(String namespace) {
- this.resourceXmlNs.setNamespaceURI(namespace);
- this.setNamespaceURI_(namespace);
- }
-
- protected void setNamespaceURI_(String namespaceURI) {
- String old = this.namespaceURI;
- this.namespaceURI = namespaceURI;
- this.firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
- }
-
- protected String getResourceNamespaceURI() {
- return this.resourceXmlNs.getNamespaceURI();
- }
-
-
- // ***** prefix *****
-
- public String getPrefix() {
- return this.prefix;
- }
-
- public void setPrefix(String prefix) {
- this.resourceXmlNs.setPrefix(prefix);
- this.setPrefix_(prefix);
- }
-
- protected void setPrefix_(String prefix) {
- String old = this.prefix;
- this.prefix = prefix;
- this.firePropertyChanged(PREFIX_PROPERTY, old, prefix);
- }
-
- protected String getResourcePrefix() {
- return this.resourceXmlNs.getPrefix();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- if (getResourceXmlNs().namespaceURITouches(pos, astRoot)) {
- return getNamespaceURICompletionProposals(pos, filter, astRoot);
- }
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getNamespaceURICompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- String packageNamespace = getJaxbPackageInfo().getJaxbPackage().getNamespace();
- Iterable<String> result = (StringTools.stringIsEmpty(packageNamespace)) ?
- EmptyIterable.instance() : new SingleElementIterable(StringTools.convertToJavaStringLiteral(packageNamespace));
- XsdSchema schema = getJaxbPackageInfo().getJaxbPackage().getXsdSchema();
- if (schema != null) {
- result = new CompositeIterable<String>(result, schema.getNamespaceProposals(filter));
- }
- return CollectionTools.set(result);
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceXmlNs().getTextRange(astRoot);
- }
-
-
- // ***** miscellaneous *****
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.namespaceURI);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java
deleted file mode 100644
index 2a69368779..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRegistry.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaXmlRegistry
- extends AbstractJavaContextNode
- implements XmlRegistry {
-
- protected final ElementFactoryMethodContainer elementFactoryMethodContainer;
-
-
- public GenericJavaXmlRegistry(JaxbClass parent) {
- super(parent);
- this.elementFactoryMethodContainer = new ElementFactoryMethodContainer();
-
- initElementFactoryMethods();
- }
-
-
- public JaxbClass getJaxbClass() {
- return (JaxbClass) getParent();
- }
-
- public JavaResourceType getJavaResourceType() {
- return getJaxbClass().getJavaResourceType();
- }
-
- protected XmlRegistryAnnotation getAnnotation() {
- return (XmlRegistryAnnotation) getJavaResourceType().getAnnotation(JAXB.XML_REGISTRY);
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbClass().getJaxbPackage();
- }
-
-
- // ***** synchronize/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncElementFactoryMethods();
- }
-
- @Override
- public void update() {
- super.update();
- updateElementFactoryMethods();
- }
-
-
- // ***** element factory methods *****
-
- public Iterable<JaxbElementFactoryMethod> getElementFactoryMethods() {
- return this.elementFactoryMethodContainer.getContextElements();
- }
-
- public int getElementFactoryMethodsSize() {
- return this.elementFactoryMethodContainer.getContextElementsSize();
- }
-
- protected void initElementFactoryMethods() {
- this.elementFactoryMethodContainer.initialize();
- }
-
- protected void syncElementFactoryMethods() {
- this.elementFactoryMethodContainer.synchronizeWithResourceModel();
- }
-
- protected void updateElementFactoryMethods() {
- this.elementFactoryMethodContainer.update();
- }
-
- private JaxbElementFactoryMethod buildElementFactoryMethod(JavaResourceMethod resourceMethod) {
- return getFactory().buildJavaElementFactoryMethod(this, resourceMethod);
- }
-
- private Iterable<JavaResourceMethod> getResourceElementFactoryMethods() {
- return new FilteringIterable<JavaResourceMethod>(getJavaResourceType().getMethods()) {
- @Override
- protected boolean accept(JavaResourceMethod method) {
- return methodIsElementFactoryMethod(method);
- }
- };
- }
-
- // Return methods with XmlElementDecl annotation
- protected static boolean methodIsElementFactoryMethod(JavaResourceMethod method) {
- return methodHasXmlElementDeclAnnotation(method);
- }
-
- protected static boolean methodHasXmlElementDeclAnnotation(JavaResourceMethod method) {
- return method.getAnnotation(JAXB.XML_ELEMENT_DECL) != null;
- }
-
- protected static boolean methodReturnTypeIsJAXBElement(JavaResourceMethod method) {
- return method.typeIsSubTypeOf(JAXB.XML_ELEMENT);
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) {
- result = efm.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.<String>instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : getJaxbClass().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- Iterable<XmlRegistry> registries = getContextRoot().getXmlRegistries(getJaxbPackage());
- if (CollectionTools.size(registries) > 1) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE,
- this,
- getValidationTextRange(astRoot)));
- }
-
- validateDuplicateQNames(messages, reporter, astRoot);
-
- for (JaxbElementFactoryMethod efm : getElementFactoryMethods()) {
- efm.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateQNames(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- Map<String, Bag<QName>> xmlElementDeclQnames = new HashMap<String, Bag<QName>>();
-
- for (JaxbElementFactoryMethod xmlElementDecl : getElementFactoryMethods()) {
- String elementDeclName = xmlElementDecl.getQName().getName();
- if (! StringTools.stringIsEmpty(elementDeclName)) {
- String fqScope = xmlElementDecl.getFullyQualifiedScope();
- if (xmlElementDeclQnames.get(fqScope) == null) {
- xmlElementDeclQnames.put(fqScope, new HashBag<QName>());
- }
- xmlElementDeclQnames.get(fqScope).add(new QName(xmlElementDecl.getQName().getNamespace(), elementDeclName));
- }
- }
-
- for (JaxbElementFactoryMethod xmlElementDecl : getElementFactoryMethods()) {
- String fqScope = xmlElementDecl.getFullyQualifiedScope();
- String xmlElementNamespace = xmlElementDecl.getQName().getNamespace();
- String xmlElementName = xmlElementDecl.getQName().getName();
- if (xmlElementDeclQnames.get(fqScope).count(new QName(xmlElementNamespace, xmlElementName)) > 1) {
- String scopeDesc = "";
- if (! JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME.equals(fqScope)) {
- scopeDesc = NLS.bind(JptJaxbCoreMessages.XML_ELEMENT_DECL__SCOPE, fqScope);
- }
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME,
- new String[] { xmlElementName, scopeDesc },
- xmlElementDecl,
- xmlElementDecl.getQName().getNameTextRange(astRoot)));
- }
- }
- }
-
-
- /**
- * element factory method container adapter
- */
- protected class ElementFactoryMethodContainer
- extends ContextCollectionContainer<JaxbElementFactoryMethod, JavaResourceMethod> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XmlRegistry.ELEMENT_FACTORY_METHODS_COLLECTION;
- }
-
- @Override
- protected JaxbElementFactoryMethod buildContextElement(JavaResourceMethod resourceElement) {
- return GenericJavaXmlRegistry.this.buildElementFactoryMethod(resourceElement);
- }
-
- @Override
- protected Iterable<JavaResourceMethod> getResourceElements() {
- return GenericJavaXmlRegistry.this.getResourceElementFactoryMethods();
- }
-
- @Override
- protected JavaResourceMethod getResourceElement(JaxbElementFactoryMethod contextElement) {
- return contextElement.getResourceMethod();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
deleted file mode 100644
index 5147639f89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlRootElement
- extends AbstractJavaContextNode
- implements XmlRootElement {
-
- protected final XmlRootElementAnnotation annotation;
-
- protected JaxbQName qName;
-
-
- public GenericJavaXmlRootElement(JaxbTypeMapping parent, XmlRootElementAnnotation resourceXmlRootElementAnnotation) {
- super(parent);
- this.annotation = resourceXmlRootElementAnnotation;
- this.qName = buildQName();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlRootElementQName(this);
- }
-
- public JaxbTypeMapping getTypeMapping() {
- return (JaxbTypeMapping) getParent();
- }
-
- protected JaxbType getJaxbType() {
- return getTypeMapping().getJaxbType();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getJaxbType().getJaxbPackage();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ***** schema element ref *****
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
- }
-
-
- //****************** miscellaneous ********************
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.qName.toString());
- }
-
-
- protected class XmlRootElementQName
- extends AbstractJavaQName {
-
- protected XmlRootElementQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlRootElement.this.getJaxbPackage();
- }
-
- @Override
- public String getDefaultNamespace() {
- JaxbPackage jaxbPackage = this.getJaxbPackage();
- return (jaxbPackage == null) ? null : jaxbPackage.getNamespace();
- }
-
- @Override
- public String getDefaultName() {
- return Introspector.decapitalize(GenericJavaXmlRootElement.this.getJaxbType().getSimpleName());
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getElementNameProposals(getNamespace(), filter);
- }
-
- @Override
- public String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_ELEMENT_DESC;
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String name = getName();
- String namespace = getNamespace();
- XsdSchema schema = this.getXsdSchema();
-
- if (schema != null) {
- // element must resolve
- XsdElementDeclaration schemaElement = schema.getElementDeclaration(namespace, name);
- if (schemaElement == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- else {
- // element type must agree with parent's schema type
- XsdTypeDefinition schemaType = GenericJavaXmlRootElement.this.getTypeMapping().getXsdTypeDefinition();
- if (schemaType != null) {
- if (! schemaType.equals(schemaElement.getType())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE,
- new String[] {name, namespace},
- this,
- getValidationTextRange(astRoot)));
- }
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlRootElement.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
deleted file mode 100644
index 3c7603548c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.xsd.XSDForm;
-
-public class GenericJavaXmlSchema
- extends AbstractJavaContextNode
- implements XmlSchema {
-
- protected String specifiedNamespace;
-
- protected String location;
-
- protected XmlNsForm specifiedAttributeFormDefault;
-
- protected XmlNsForm specifiedElementFormDefault;
-
- protected final ContextListContainer<XmlNs, XmlNsAnnotation> xmlNsPrefixContainer;
-
-
- public GenericJavaXmlSchema(JaxbPackageInfo parent) {
- super(parent);
- this.specifiedNamespace = this.getResourceNamespace();
- this.location = this.getResourceLocation();
- this.specifiedAttributeFormDefault = getResourceAttributeFormDefault();
- this.specifiedElementFormDefault = getResourceElementFormDefault();
- this.xmlNsPrefixContainer = this.buildXmlNsPrefixContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedNamespace_(this.getResourceNamespace());
- this.setLocation_(this.getResourceLocation());
- this.setSpecifiedAttributeFormDefault_(getResourceAttributeFormDefault());
- this.setSpecifiedElementFormDefault_(getResourceElementFormDefault());
- this.syncXmlNsPrefixes();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateXmlNsPrefixes();
- }
-
- public JaxbPackageInfo getJaxbPackageInfo() {
- return (JaxbPackageInfo) getParent();
- }
-
- public JaxbPackage getJaxbPackage() {
- return getJaxbPackageInfo().getJaxbPackage();
- }
-
- protected JavaResourcePackage getResourcePackage() {
- return getJaxbPackageInfo().getResourcePackage();
- }
-
-
- // ********** xml schema annotation **********
-
- protected XmlSchemaAnnotation getXmlSchemaAnnotation() {
- return (XmlSchemaAnnotation) this.getResourcePackage().getNonNullAnnotation(JAXB.XML_SCHEMA);
- }
-
- // ********** namespace **********
-
- public String getNamespace() {
- return (this.specifiedNamespace == null) ? "" : this.specifiedNamespace; //$NON-NLS-1$
- }
-
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String namespace) {
- this.getXmlSchemaAnnotation().setNamespace(namespace);
- this.setSpecifiedNamespace_(namespace);
- }
-
- protected void setSpecifiedNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
- }
-
- protected String getResourceNamespace() {
- return getXmlSchemaAnnotation().getNamespace();
- }
-
-
- // ********** location **********
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- this.getXmlSchemaAnnotation().setLocation(location);
- this.setLocation_(location);
- }
-
- protected void setLocation_(String location) {
- String old = this.location;
- this.location = location;
- this.firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- protected String getResourceLocation() {
- return getXmlSchemaAnnotation().getLocation();
- }
-
-
- // ********** attribute form default **********
-
- public XmlNsForm getAttributeFormDefault() {
- return (this.specifiedAttributeFormDefault == null) ? XmlNsForm.UNSET : this.specifiedAttributeFormDefault;
- }
-
- public XmlNsForm getSpecifiedAttributeFormDefault() {
- return this.specifiedAttributeFormDefault;
- }
-
- public void setSpecifiedAttributeFormDefault(XmlNsForm attributeFormDefault) {
- getXmlSchemaAnnotation().setAttributeFormDefault(XmlNsForm.toJavaResourceModel(attributeFormDefault));
- setSpecifiedAttributeFormDefault_(attributeFormDefault);
- }
-
- protected void setSpecifiedAttributeFormDefault_(XmlNsForm attributeFormDefault) {
- XmlNsForm old = this.specifiedAttributeFormDefault;
- this.specifiedAttributeFormDefault = attributeFormDefault;
- firePropertyChanged(SPECIFIED_ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
- }
-
- protected XmlNsForm getResourceAttributeFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getAttributeFormDefault());
- }
-
-
- // ********** element form default **********
-
- public XmlNsForm getElementFormDefault() {
- return (this.specifiedElementFormDefault == null) ? XmlNsForm.UNSET : this.specifiedElementFormDefault;
- }
-
- public XmlNsForm getSpecifiedElementFormDefault() {
- return this.specifiedElementFormDefault;
- }
-
- public void setSpecifiedElementFormDefault(XmlNsForm elementFormDefault) {
- getXmlSchemaAnnotation().setElementFormDefault(XmlNsForm.toJavaResourceModel(elementFormDefault));
- setSpecifiedElementFormDefault_(elementFormDefault);
- }
-
- protected void setSpecifiedElementFormDefault_(XmlNsForm elementFormDefault) {
- XmlNsForm old = this.specifiedElementFormDefault;
- this.specifiedElementFormDefault = elementFormDefault;
- firePropertyChanged(SPECIFIED_ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
- }
-
- protected XmlNsForm getResourceElementFormDefault() {
- return XmlNsForm.fromJavaResourceModel(getXmlSchemaAnnotation().getElementFormDefault());
- }
-
-
- // ********** xml namespace prefixes **********
-
- public ListIterable<XmlNs> getXmlNsPrefixes() {
- return this.xmlNsPrefixContainer.getContextElements();
- }
-
- public int getXmlNsPrefixesSize() {
- return this.xmlNsPrefixContainer.getContextElementsSize();
- }
-
- public XmlNs addXmlNsPrefix(int index) {
- XmlNsAnnotation annotation = this.getXmlSchemaAnnotation().addXmlns(index);
- return this.xmlNsPrefixContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlNsPrefix(XmlNs xmlNsPrefix) {
- this.removeXmlNsPrefix(this.xmlNsPrefixContainer.indexOfContextElement(xmlNsPrefix));
- }
-
- public void removeXmlNsPrefix(int index) {
- this.getXmlSchemaAnnotation().removeXmlns(index);
- this.xmlNsPrefixContainer.removeContextElement(index);
- }
-
- public void moveXmlNsPrefix(int targetIndex, int sourceIndex) {
- this.getXmlSchemaAnnotation().moveXmlns(targetIndex, sourceIndex);
- this.xmlNsPrefixContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected XmlNs buildXmlNs(XmlNsAnnotation xmlNsAnnotation) {
- return this.getFactory().buildJavaXmlNs(this, xmlNsAnnotation);
- }
-
- protected void syncXmlNsPrefixes() {
- this.xmlNsPrefixContainer.synchronizeWithResourceModel();
- }
-
- protected void updateXmlNsPrefixes() {
- this.xmlNsPrefixContainer.update();
- }
-
- protected ListIterable<XmlNsAnnotation> getXmlNsAnnotations() {
- return getXmlSchemaAnnotation().getXmlns();
- }
-
- protected ContextListContainer<XmlNs, XmlNsAnnotation> buildXmlNsPrefixContainer() {
- XmlNsPrefixContainer container = new XmlNsPrefixContainer();
- container.initialize();
- return container;
- }
-
-
- // **************** content assist ****************************************
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (namespaceTouches(pos, astRoot)) {
- return getNamespaceProposals(filter);
- }
-
- for (XmlNs xmlns : getXmlNsPrefixes()) {
- result = xmlns.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
- protected boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().namespaceTouches(pos, astRoot);
- }
-
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<SchemaEntry, String>(
- getJaxbProject().getSchemaLibrary().getSchemaEntries()) {
- @Override
- protected String transform(SchemaEntry o) {
- return o.getNamespace();
- }
- },
- filter));
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getXmlSchemaAnnotation().getTextRange(astRoot);
- }
-
-
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // removing this validation message for now: see jaxb bug 823 (http://java.net/jira/browse/JAXB-823)
-// XsdSchema schema = getJaxbPackage().getXsdSchema();
-// if (schema != null) {
-// if (formConflicts(getAttributeFormDefault(), schema.getXSDComponent().getAttributeFormDefault())) {
-// messages.add(
-// DefaultValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// JaxbValidationMessages.XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT,
-// this,
-// getXmlSchemaAnnotation().getAttributeFormDefaultTextRange(astRoot)));
-// }
-//
-// if (formConflicts(getElementFormDefault(), schema.getXSDComponent().getElementFormDefault())) {
-// messages.add(
-// DefaultValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// JaxbValidationMessages.XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT,
-// this,
-// getXmlSchemaAnnotation().getElementFormDefaultTextRange(astRoot)));
-// }
-// }
- }
-
- protected boolean formConflicts(XmlNsForm form, XSDForm xsdForm) {
- return (form == XmlNsForm.QUALIFIED) ^ (xsdForm == XSDForm.QUALIFIED_LITERAL);
- }
-
-
- /**
- * xml ns prefix container adapter
- */
- protected class XmlNsPrefixContainer
- extends ContextListContainer<XmlNs, XmlNsAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return XML_NS_PREFIXES_LIST;
- }
-
- @Override
- protected XmlNs buildContextElement(XmlNsAnnotation resourceElement) {
- return GenericJavaXmlSchema.this.buildXmlNs(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlNsAnnotation> getResourceElements() {
- return GenericJavaXmlSchema.this.getXmlNsAnnotations();
- }
-
- @Override
- protected XmlNsAnnotation getResourceElement(XmlNs contextElement) {
- return contextElement.getResourceXmlNs();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
deleted file mode 100644
index 1cb1d4e01d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbQName;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class GenericJavaXmlSchemaType
- extends AbstractJavaContextNode
- implements XmlSchemaType {
-
- protected final XmlSchemaTypeAnnotation annotation;
-
- protected JaxbQName qName;
-
- protected String type;
-
-
- protected GenericJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.qName = buildQName();
- this.type = this.getResourceTypeString();
- }
-
-
- protected JaxbQName buildQName() {
- return new XmlSchemaTypeQName(this);
- }
-
- public JaxbQName getQName() {
- return this.qName;
- }
-
- public XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() {
- return this.annotation;
- }
-
- protected abstract JaxbPackage getJaxbPackage();
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.qName.synchronizeWithResourceModel();
- this.setType_(this.getResourceTypeString());
- }
-
- @Override
- public void update() {
- super.update();
- this.qName.update();
- }
-
-
- // ********** type **********
-
- public String getType() {
- return this.type;
- }
-
- public void setType(String location) {
- this.annotation.setType(location);
- this.setType_(location);
- }
-
- protected void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- }
-
- protected String getResourceTypeString() {
- return this.annotation.getType();
- }
-
- public String getFullyQualifiedType() {
- return getXmlSchemaTypeAnnotation().getFullyQualifiedType();
- }
-
-
- // ***** misc *****
-
- public XsdTypeDefinition getXsdTypeDefinition() {
- JaxbPackage pkg = getJaxbPackage();
- XsdSchema xsdSchema = (pkg == null) ? null : pkg.getXsdSchema();
- if (xsdSchema == null) {
- return null;
- }
-
- if (! StringTools.stringIsEmpty(this.qName.getName())) {
- return xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName());
- }
-
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- result = this.qName.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.qName.validate(messages, reporter, astRoot);
-
- XsdTypeDefinition xsdType = getXsdTypeDefinition();
- if (xsdType != null && xsdType.getKind() != XsdTypeDefinition.Kind.SIMPLE) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_SCHEMA_TYPE__NON_SIMPLE_TYPE,
- new String[] { qName.getName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- protected TextRange getTypeTextRange(CompilationUnit astRoot) {
- return getXmlSchemaTypeAnnotation().getTypeTextRange(astRoot);
- }
-
-
- protected class XmlSchemaTypeQName
- extends AbstractJavaQName {
-
- protected XmlSchemaTypeQName(JavaContextNode parent) {
- super(parent, new QNameAnnotationProxy());
- }
-
-
- @Override
- protected JaxbPackage getJaxbPackage() {
- return GenericJavaXmlSchemaType.this.getJaxbPackage();
- }
-
- @Override
- protected String getReferencedComponentTypeDescription() {
- return JptJaxbCoreMessages.XML_TYPE_DESC;
- }
-
- @Override
- public String getDefaultName() {
- return null;
- }
-
- @Override
- public String getDefaultNamespace() {
- return XmlSchemaType.DEFAULT_NAMESPACE;
- }
-
- @Override
- protected Iterable<String> getNamespaceProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getNamespaceProposals(filter);
- }
-
- @Override
- protected Iterable<String> getNameProposals(Filter<String> filter) {
- XsdSchema schema = this.getXsdSchema();
- if (schema == null) {
- return EmptyIterable.instance();
- }
- return schema.getSimpleTypeNameProposals(getNamespace(), filter);
- }
-
- @Override
- protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- String name = getName();
- String namespace = getNamespace();
-
- if (! StringTools.stringIsEmpty(name)) {
- XsdSchema schema = this.getXsdSchema();
-
- if (schema != null) {
- XsdTypeDefinition schemaType = schema.getTypeDefinition(namespace, name);
- if (schemaType == null) {
- messages.add(getUnresolveSchemaComponentMessage(astRoot));
- }
- }
- }
- }
- }
-
-
- protected class QNameAnnotationProxy
- extends AbstractJavaQName.AbstractQNameAnnotationProxy {
-
- @Override
- protected QNameAnnotation getAnnotation(boolean createIfNull) {
- return GenericJavaXmlSchemaType.this.annotation;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
deleted file mode 100644
index d4216aa54f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSeeAlso.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-public class GenericJavaXmlSeeAlso
- extends AbstractJavaContextNode
- implements XmlSeeAlso {
-
- protected final XmlSeeAlsoAnnotation annotation;
-
- protected final ListContainer<String, String> valueContainer;
-
-
- public GenericJavaXmlSeeAlso(JaxbTypeMapping parent, XmlSeeAlsoAnnotation annotation) {
- super(parent);
- this.annotation = annotation;
- this.valueContainer = this.buildValueContainer();
- }
-
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.valueContainer.synchronizeWithResourceModel();
- }
-
- public ListIterable<String> getClasses() {
- return this.valueContainer.getContextElements();
- }
-
- public int getClassesSize() {
- return this.valueContainer.getContextElementsSize();
- }
-
- public void addClass(int index, String clazz) {
- this.annotation.addClass(index, clazz);
- this.valueContainer.addContextElement(index, clazz);
- }
-
- public void removeClass(int index) {
- this.annotation.removeClass(index);
- this.valueContainer.removeContextElement(index);
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- this.annotation.moveClass(targetIndex, sourceIndex);
- this.valueContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- public Iterable<String> getReferencedXmlTypeNames() {
- return this.annotation.getFullyQualifiedClasses();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.annotation.getTextRange(astRoot);
- }
-
- protected ListContainer<String, String> buildValueContainer() {
- ValueContainer container = new ValueContainer();
- container.initialize();
- return container;
- }
-
-
- protected class ValueContainer
- extends ListContainer<String, String> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CLASSES_LIST;
- }
-
- @Override
- protected String buildContextElement(String resourceElement) {
- return resourceElement;
- }
-
- @Override
- protected ListIterable<String> getResourceElements() {
- return GenericJavaXmlSeeAlso.this.annotation.getClasses();
- }
-
- @Override
- protected String getResourceElement(String contextElement) {
- return contextElement;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java
deleted file mode 100644
index ba23f4ee1c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-public class GenericJavaXmlTransientMapping
- extends AbstractJavaAttributeMapping<XmlTransientAnnotation> {
-
- public GenericJavaXmlTransientMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- @Override
- public Iterable<String> getReferencedXmlTypeNames() {
- return EmptyIterable.instance();
- }
-
- @Override
- public boolean isTransient() {
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java
deleted file mode 100644
index be352f4c52..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaXmlValueMapping
- extends AbstractJavaXmlNodeMapping<XmlValueAnnotation>
- implements XmlValueMapping {
-
- public GenericJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
-
- // ***** XmlList *****
-
- @Override
- protected boolean calculateDefaultXmlList() {
- return getPersistentAttribute().isJavaResourceAttributeCollectionType();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateSchemaType(messages, reporter, astRoot);
- }
-
- protected void validateSchemaType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- XsdTypeDefinition xsdClassType = getClassMapping().getXsdTypeDefinition();
-
- if (xsdClassType == null) {
- return;
- }
-
- if (! xsdClassType.hasTextContent()) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__NO_TEXT_CONTENT,
- this,
- getValidationTextRange(astRoot)));
- return;
- }
-
- XsdTypeDefinition xsdType = xsdClassType.getBaseType();
- XsdTypeDefinition expectedSchemaType = getDataTypeXsdTypeDefinition();
-
- if (xsdType == null || expectedSchemaType == null) {
- return;
- }
-
- if (! xsdType.typeIsValid(expectedSchemaType, isXmlList())) {
- messages.add(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.XML_VALUE__INVALID_SCHEMA_TYPE,
- new String[] { getValueTypeName() },
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java
deleted file mode 100644
index 8db3c4e7d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAnyAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAnyAttributeMappingDefinition INSTANCE =
- new JavaXmlAnyAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlAnyAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAnyAttributeMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java
deleted file mode 100644
index 9fdb50c8ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAnyElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlAnyElementMappingDefinition INSTANCE =
- new JavaXmlAnyElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_ELEMENT_REF,
- JAXB.XML_ELEMENT_REFS,
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED };
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlAnyElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAnyElementMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
deleted file mode 100644
index 76e21bfe76..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaXmlAttributeMappingDefinition INSTANCE =
- new JavaXmlAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = {
- JAXB.XML_ATTACHMENT_REF,
- JAXB.XML_ID,
- JAXB.XML_IDREF,
- JAXB.XML_INLINE_BINARY_DATA,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_LIST,
- JAXB.XML_MIME_TYPE,
- JAXB.XML_SCHEMA_TYPE };
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlAttributeMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
deleted file mode 100644
index 747b2c8e13..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementMappingDefinition.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
- implements DefaultJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlElementMappingDefinition INSTANCE =
- new JavaXmlElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- JAXB.XML_ID,
- JAXB.XML_IDREF,
- JAXB.XML_LIST,
- JAXB.XML_SCHEMA_TYPE,
- JAXB.XML_ATTACHMENT_REF,
- JAXB.XML_MIME_TYPE,
- JAXB.XML_INLINE_BINARY_DATA,
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER };
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementMapping(parent);
- }
-
- /**
- * From the JAXB spec section 8.12.5.1 Default Mapping:
- * <p>
- * A single valued property or field must be mapped by with the following default mapping annotation:<ul>
- * <li> @XmlElement
- * </ul>
- * <p>
- * A property or field with a collection type must be mapped by with the following default mapping annotation:<ul>
- * <li> if the property or field is annotated with @XmlList, then the default mapping annotation is:<ul>
- * <li> @XmlElement
- * </ul>
- * <li> otherwise the default mapping annotation is:<ul>
- * <li> @XmlElements({ @XmlElement(nillable=true)})
- * (NB: this actually means the same as
- * @XmlElement(nillable=true)
- * )
- * </ul>
- */
- public boolean isDefault(JaxbPersistentAttribute persistentAttribute) {
- return true;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java
deleted file mode 100644
index bf39f5f8c6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementRefMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementRefMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementRefMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java
deleted file mode 100644
index 809bbe33ff..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementRefsMappingDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementRefsMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaXmlElementRefsMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementRefsMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_MIXED });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementRefsMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java
deleted file mode 100644
index 54a86d7233..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlElementsMappingDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlElementsMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE
- = new JavaXmlElementsMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlElementsMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>( new String[] {
- JAXB.XML_ELEMENT_WRAPPER,
- JAXB.XML_IDREF,
- JAXB.XML_JAVA_TYPE_ADAPTER });
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlElementsMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java
deleted file mode 100644
index 47827efa68..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlTransientMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlTransientMappingDefinition INSTANCE =
- new JavaXmlTransientMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlTransientMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlTransientMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java
deleted file mode 100644
index a426ae477b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class JavaXmlValueMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaXmlValueMappingDefinition INSTANCE =
- new JavaXmlValueMappingDefinition();
-
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- JAXB.XML_LIST,
- JAXB.XML_JAVA_TYPE_ADAPTER,
- JAXB.XML_SCHEMA_TYPE };
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected JavaXmlValueMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return factory.buildJavaXmlValueMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java
deleted file mode 100644
index 125950698e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/PropertyAccessor.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.context.Accessor;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-public class PropertyAccessor
- extends AbstractJavaContextNode
- implements Accessor {
-
-
- protected final JavaResourceMethod resourceGetter;
-
- protected final JavaResourceMethod resourceSetter;
-
- public PropertyAccessor(JaxbClassMapping parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- super(parent);
- this.resourceGetter = resourceGetter;
- this.resourceSetter = resourceSetter;
- }
-
- public JavaResourceAttribute getJavaResourceAttribute() {
- return this.calculateResourceMethodToAnnotate();
- }
-
- public String getJavaResourceAttributeBaseTypeName() {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return null in this case
- //rather than attempting to define the type from the setter's parameters
- return getterMethod == null ? null : AccessorTools.getBaseTypeName(getterMethod);
- }
-
- public boolean isJavaResourceAttributeCollectionType() {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return false in this case
- //rather than attempting to use the setter's parameters
- return getterMethod == null ? false : AccessorTools.isCollectionType(getterMethod);
- }
-
- public boolean isJavaResourceAttributeTypeSubTypeOf(String typeName) {
- JavaResourceAttribute getterMethod = getResourceGetterMethod();
- //it's invalid to have a setter without a getter, so just return false in this case
- //rather than attempting to use the setter's parameters
- return getterMethod == null ? false : getterMethod.typeIsSubTypeOf(typeName);
- }
-
- public JavaResourceMethod getResourceGetterMethod() {
- return this.resourceGetter;
- }
-
- public JavaResourceMethod getResourceSetterMethod() {
- return this.resourceSetter;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return false;
- }
-
- public boolean isFor(JavaResourceMethod getterMethod, JavaResourceMethod setterMethod) {
- return (this.resourceGetter == getterMethod) && (this.resourceSetter == setterMethod);
- }
-
- //since this is based on a preference as well as annotation location
- //we will just calculate it instead of handling it in sync and storing it.
- protected JavaResourceMethod calculateResourceMethodToAnnotate() {
- if (getterIsAnnotated()) {
- if (setterIsAnnotated()) {
- //use preference for which one to set the primary annotation on.
- return getAnnotateGetterPreference() ? this.resourceGetter : this.resourceSetter;
- }
- return this.resourceGetter;
- }
- else if (setterIsAnnotated()) {
- return this.resourceSetter;
- }
- else if (getAnnotateGetterPreference()&& this.resourceGetter != null) {
- return this.resourceGetter;
- }
- return this.resourceSetter;
- }
-
- protected boolean getterIsAnnotated() {
- return this.resourceGetter == null ? false : this.resourceGetter.isAnnotated();
- }
-
- protected boolean setterIsAnnotated() {
- return this.resourceSetter == null ? false : this.resourceSetter.isAnnotated();
- }
-
- //TODO bug 333483 - make this a preference for the user to select whether the getter or setter should be annotated.
- protected boolean getAnnotateGetterPreference() {
- return true;
- }
-
- //TODO validation - bug 333484
- //if (getterIsAnnotated() && setterIsAnnotated()) error to user
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- // TODO Auto-generated method stub
- return null;
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java
deleted file mode 100644
index a9d2a5f736..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProperties.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-
-public interface JaxbFacetDataModelProperties
- extends IDataModelProperties {
-
- static final String PREFIX_
- = JaxbFacetDataModelProperties.class.getSimpleName() + "."; //$NON-NLS-1$
-
- public static final String PLATFORM
- = PREFIX_ + "PLATFORM"; //$NON-NLS-1$
-
- public static final String LIBRARY_INSTALL_DELEGATE
- = PREFIX_ + "LIBRARY_INSTALL_DELEGATE"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
deleted file mode 100644
index 638e6ea8c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDataModelProvider.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-
-
-public abstract class JaxbFacetDataModelProvider
- extends FacetInstallDataModelProvider
- implements JaxbFacetDataModelProperties {
-
- protected static final DataModelPropertyDescriptor[] EMPTY_DMPD_ARRAY = new DataModelPropertyDescriptor[0];
-
-
- protected static final Comparator<DataModelPropertyDescriptor> DMPD_COMPARATOR =
- new Comparator<DataModelPropertyDescriptor>() {
- public int compare(DataModelPropertyDescriptor dmpd1, DataModelPropertyDescriptor dmpd2) {
- return dmpd1.getPropertyDescription().compareTo(dmpd2.getPropertyDescription());
- }
- };
-
-
-
- // listens to primary runtime changing
- private IFacetedProjectListener fprojListener;
-
- private LibraryInstallDelegate defaultLibraryInstallDelegate;
-
-
- protected JaxbFacetDataModelProvider() {
- super();
- this.fprojListener = buildFprojListener();
- }
-
-
- protected IFacetedProjectListener buildFprojListener() {
- return new IFacetedProjectListener() {
- public void handleEvent(IFacetedProjectEvent event) {
- getLibraryInstallDelegate().refresh();
- }
- };
- }
-
- @Override
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(PLATFORM);
- names.add(LIBRARY_INSTALL_DELEGATE);
- return names;
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID)) {
- return JaxbFacet.ID;
- }
- else if (propertyName.equals(PLATFORM)) {
- return getDefaultPlatform();
- }
- else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) {
- return getDefaultLibraryInstallDelegate();
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
- protected JaxbPlatformDescription getDefaultPlatform() {
- return JptJaxbCorePlugin.getDefaultPlatform(getProjectFacetVersion());
- }
-
- protected LibraryInstallDelegate getDefaultLibraryInstallDelegate() {
- // delegate itself changes only when facet version changes
- if (this.defaultLibraryInstallDelegate == null) {
- this.defaultLibraryInstallDelegate = buildDefaultLibraryInstallDelegate();
- }
- else if (! this.defaultLibraryInstallDelegate.getProjectFacetVersion().equals(getProjectFacetVersion())) {
- this.defaultLibraryInstallDelegate.dispose();
- this.defaultLibraryInstallDelegate = buildDefaultLibraryInstallDelegate();
- }
- return defaultLibraryInstallDelegate;
- }
-
- protected LibraryInstallDelegate buildDefaultLibraryInstallDelegate() {
- IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
- IProjectFacetVersion pfv = getProjectFacetVersion();
- if (fpjwc == null || pfv == null) {
- return null;
- }
- LibraryInstallDelegate lid = new LibraryInstallDelegate(fpjwc, pfv);
- lid.addListener(buildLibraryInstallDelegateListener());
- return lid;
- }
-
- protected IPropertyChangeListener buildLibraryInstallDelegateListener() {
- return new IPropertyChangeListener() {
- public void propertyChanged(String property, Object oldValue, Object newValue ) {
- if (LibraryInstallDelegate.PROP_AVAILABLE_PROVIDERS.equals(property)) {
- adjustLibraryInstallDelegate();
- }
- getDataModel().notifyPropertyChange(LIBRARY_INSTALL_DELEGATE, IDataModel.VALUE_CHG);
- }
- };
- }
-
- protected void adjustLibraryInstallDelegate() {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
- if (lid != null) {
- List<JaxbLibraryProviderInstallOperationConfig> jaxbConfigs
- = new ArrayList<JaxbLibraryProviderInstallOperationConfig>();
- // add the currently selected one first
- JaxbLibraryProviderInstallOperationConfig currentJaxbConfig = null;
- LibraryProviderOperationConfig config = lid.getLibraryProviderOperationConfig();
- if (config instanceof JaxbLibraryProviderInstallOperationConfig) {
- currentJaxbConfig = (JaxbLibraryProviderInstallOperationConfig) config;
- jaxbConfigs.add(currentJaxbConfig);
- }
- for (ILibraryProvider lp : lid.getLibraryProviders()) {
- config = lid.getLibraryProviderOperationConfig(lp);
- if (config instanceof JaxbLibraryProviderInstallOperationConfig
- && ! config.equals(currentJaxbConfig)) {
- jaxbConfigs.add((JaxbLibraryProviderInstallOperationConfig) config);
- }
- }
- for (JaxbLibraryProviderInstallOperationConfig jaxbConfig : jaxbConfigs) {
- jaxbConfig.setJaxbPlatform(getPlatform());
- }
- }
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACETED_PROJECT_WORKING_COPY)) {
- // should only be done once
- IFacetedProjectWorkingCopy fproj = (IFacetedProjectWorkingCopy) propertyValue;
- fproj.addListener(this.fprojListener, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
- }
- else if (propertyName.equals(FACET_VERSION)) {
- adjustLibraryInstallDelegate();
- this.model.notifyPropertyChange(PLATFORM, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(LIBRARY_INSTALL_DELEGATE, IDataModel.DEFAULT_CHG);
- }
- else if (propertyName.equals(PLATFORM)) {
- adjustLibraryInstallDelegate();
- }
-
- return ok;
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return this.buildValidPlatformDescriptors();
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- protected DataModelPropertyDescriptor[] buildValidPlatformDescriptors() {
- Iterable<JaxbPlatformDescription> validPlatformDescriptions = buildValidPlatformDescriptions();
- Iterable<DataModelPropertyDescriptor> validPlatformDescriptors =
- new TransformationIterable<JaxbPlatformDescription, DataModelPropertyDescriptor>(validPlatformDescriptions) {
- @Override
- protected DataModelPropertyDescriptor transform(JaxbPlatformDescription description) {
- return buildPlatformDescriptor(description);
- }
- };
- return ArrayTools.sort(ArrayTools.array(validPlatformDescriptors, EMPTY_DMPD_ARRAY), DMPD_COMPARATOR);
- }
-
- protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() {
- return new FilteringIterable<JaxbPlatformDescription>(
- JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatforms()) {
- @Override
- protected boolean accept(JaxbPlatformDescription o) {
- return o.supportsJaxbFacetVersion(getProjectFacetVersion());
- }
- };
- }
-
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return buildPlatformDescriptor(getPlatform());
- }
-
- return super.getPropertyDescriptor(propertyName);
- }
-
- protected DataModelPropertyDescriptor buildPlatformDescriptor(JaxbPlatformDescription desc) {
- return new DataModelPropertyDescriptor(desc, desc.getLabel());
- }
-
- // ********** validation **********
-
- protected static IStatus OK_STATUS = Status.OK_STATUS;
-
- protected static IStatus buildErrorStatus(String message) {
- return buildStatus(IStatus.ERROR, message);
- }
-
- protected static IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- @Override
- public IStatus validate(String propertyName) {
- if (propertyName.equals(PLATFORM)) {
- return this.validatePlatform();
- }
- else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) {
- return getLibraryInstallDelegate().validate();
- }
-
- return super.validate(propertyName);
- }
-
- protected IStatus validatePlatform() {
- return (getPlatform() == null) ?
- buildErrorStatus(JptJaxbCoreMessages.JaxbFacetConfig_validatePlatformNotSpecified)
- : OK_STATUS;
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return (IFacetedProjectWorkingCopy) getProperty(FACETED_PROJECT_WORKING_COPY);
- }
-
- protected IProjectFacetVersion getProjectFacetVersion() {
- return (IProjectFacetVersion) getProperty(FACET_VERSION);
- }
-
- protected JaxbPlatformDescription getPlatform() {
- return (JaxbPlatformDescription) getProperty(PLATFORM);
- }
-
- protected LibraryInstallDelegate getLibraryInstallDelegate() {
- return (LibraryInstallDelegate) getProperty(LIBRARY_INSTALL_DELEGATE);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- getFacetedProjectWorkingCopy().removeListener(this.fprojListener);
- this.defaultLibraryInstallDelegate.dispose();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java
deleted file mode 100644
index 2a5a516cb1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetDelegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public abstract class JaxbFacetDelegate
- implements IDelegate {
-
- public final void execute(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- this.execute_(project, fv, config, monitor);
- }
-
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- SubMonitor subMonitor = SubMonitor.convert(monitor, 7);
-
- IDataModel jaxbConfig = (IDataModel) config;
-
- // project settings
- JaxbPlatformDescription platform =
- (JaxbPlatformDescription) jaxbConfig.getProperty(JaxbFacetDataModelProperties.PLATFORM);
- JptJaxbCorePlugin.setJaxbPlatform(project, platform);
- subMonitor.worked(1);
-
- // defaults settings
- JptJaxbCorePlugin.setDefaultJaxbPlatform(fv, platform);
- subMonitor.worked(1);
-
- //Delegate to LibraryInstallDelegate to configure the project classpath
- LibraryInstallDelegate lid =
- (LibraryInstallDelegate) jaxbConfig.getProperty(JaxbFacetDataModelProperties.LIBRARY_INSTALL_DELEGATE);
- lid.execute(subMonitor.newChild(1));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java
deleted file mode 100644
index a1c426ccf2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public interface JaxbFacetInstallDataModelProperties
- extends JaxbFacetDataModelProperties {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
deleted file mode 100644
index cf5d982cf8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public class JaxbFacetInstallDataModelProvider
- extends JaxbFacetDataModelProvider
- implements JaxbFacetInstallDataModelProperties {
-
- public JaxbFacetInstallDataModelProvider() {
- super();
- }
-
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACET_VERSION)) {
- if (! getPlatform().supportsJaxbFacetVersion(getProjectFacetVersion())) {
- getDataModel().setProperty(PLATFORM, null);
- }
- }
-
- return ok;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java
deleted file mode 100644
index 7724832546..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetInstallDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.validation.ValidationFramework;
-
-
-public class JaxbFacetInstallDelegate
- extends JaxbFacetDelegate {
-
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- ValidationFramework.getDefault().addValidationBuilder(project);
- super.execute_(project, fv, config, monitor);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java
deleted file mode 100644
index 53e1d9a43c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetUninstallDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbFacetUninstallDelegate
- implements IDelegate {
-
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java
deleted file mode 100644
index d9c5b2a932..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProperties.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-
-public interface JaxbFacetVersionChangeDataModelProperties
- extends JaxbFacetDataModelProperties {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java
deleted file mode 100644
index d5772b50e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDataModelProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class JaxbFacetVersionChangeDataModelProvider
- extends JaxbFacetDataModelProvider
- implements JaxbFacetVersionChangeDataModelProperties {
-
- public JaxbFacetVersionChangeDataModelProvider() {
- super();
- }
-
-
- @Override
- protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() {
- // add existing platform to list of choices
- Iterable<JaxbPlatformDescription> validPlatformDescs = super.buildValidPlatformDescriptions();
- if (! CollectionTools.contains(validPlatformDescs, getPlatform())) {
- validPlatformDescs = new CompositeIterable(getPlatform(), validPlatformDescs);
- }
- return validPlatformDescs;
- }
-
- @Override
- protected IStatus validatePlatform() {
- IStatus status = super.validatePlatform();
-
- if (status.isOK()) {
- if (! getPlatform().supportsJaxbFacetVersion(getProjectFacetVersion())) {
- status = buildErrorStatus(JptJaxbCoreMessages.JaxbFacetConfig_validatePlatformDoesNotSupportFacetVersion);
- }
- }
-
- return status;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
deleted file mode 100644
index 2c7a4bc95f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/facet/JaxbFacetVersionChangeDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.jpt.jaxb.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbFacetVersionChangeDelegate
- extends JaxbFacetDelegate {
-
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv, Object config,
- IProgressMonitor monitor) throws CoreException {
-
- SubMonitor sm = SubMonitor.convert(monitor, 2);
- super.execute_(project, fv, config, sm.newChild(1));
-
- JptJaxbCorePlugin.getProjectManager().rebuildJaxbProject(project);
- sm.worked(1);
- // nothing further to do here *just* yet
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
deleted file mode 100644
index 5562320863..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGenerator.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * ClassesGenerator
- */
-public class ClassesGenerator extends AbstractJptGenerator
-{
- public static final String LAUNCH_CONFIG_NAME = "JAXB Run Config"; //$NON-NLS-1$
- public static final String JAXB_GENERIC_GEN_CLASS = "com.sun.tools.xjc.XJCFacade"; //$NON-NLS-1$
- public static final String JAXB_GENERIC_GEN_JDK_CLASS = "com.sun.tools.internal.xjc.XJCFacade"; //$NON-NLS-1$
- public static final String JAXB_ECLIPSELINK_GEN_CLASS = "org.eclipse.persistence.jaxb.xjc.MOXyXJC"; //$NON-NLS-1$
-
- private final String schemaPathOrUri;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final String[] bindingsFileNames;
- private final ClassesGeneratorOptions generatorOptions;
- private final ClassesGeneratorExtensionOptions generatorExtensionOptions;
- private final String mainType;
- private String toolsJarPath;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new ClassesGenerator(javaProject,
- schemaPathOrUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions).generate(monitor);
- }
-
- /**
- * Test if the JDK Jaxb compiler is on the classpath.
- */
- public static boolean genericJaxbJdkIsOnClasspath(IJavaProject javaProject) {
- try {
- IType genClass = javaProject.findType(JAXB_GENERIC_GEN_JDK_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the non-JDK Jaxb compiler is on the classpath.
- */
- public static boolean genericJaxbNonJdkIsOnClasspath(IJavaProject javaProject) {
- try {
- IType genClass = javaProject.findType(JAXB_GENERIC_GEN_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static IVMInstall getVMInstall(IJavaProject javaProject) throws CoreException {
- return JavaRuntime.getVMInstall(javaProject);
- }
-
- public static String getVMInstallLocation(IVMInstall vm) {
- return vm.getInstallLocation().getAbsolutePath();
- }
-
- public static String getVMInstallToolsJarAbsolutePath(IVMInstall vm) {
- String vmInstallLocation = getVMInstallLocation(vm);
- return vmInstallLocation + File.separator + "lib" + File.separator + "tools.jar"; //$NON-NLS-1$
- }
-
- public static String buildToolsJarPath(IJavaProject javaProject) {
- try {
- IVMInstall vm = getVMInstall(javaProject);
- return getVMInstallToolsJarAbsolutePath(vm);
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static String findToolsJarPath(IJavaProject javaProject) {
- String toolsAbsolutePath = buildToolsJarPath(javaProject);
- return ((new File(toolsAbsolutePath)).exists()) ? toolsAbsolutePath : null;
- }
-
- public static boolean toolsJarExists(IJavaProject javaProject) {
- return (findToolsJarPath(javaProject) != null);
- }
-
- // ********** constructors **********
-
- protected ClassesGenerator(
- IJavaProject javaProject,
- String schemaPathOrUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
- super(javaProject);
- this.schemaPathOrUri = schemaPathOrUri;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.bindingsFileNames = bindingsFileNames;
- this.generatorOptions = generatorOptions;
- this.generatorExtensionOptions = generatorExtensionOptions;
-
- this.mainType = this.buildMainType(javaProject, usesMoxyGenerator);
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected void specifyJRE() {
- // do nothing
- }
-
- // ********** behavior **********
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // nothing to do yet...
- }
-
- // ********** private methods **********
-
- protected String buildMainType(IJavaProject javaProject, boolean usesMoxyGenerator) {
- if(usesMoxyGenerator) {
- return JAXB_ECLIPSELINK_GEN_CLASS;
- }
- else if(genericJaxbNonJdkIsOnClasspath(javaProject)) {
- return JAXB_GENERIC_GEN_CLASS;
- }
- else if(genericJaxbJdkIsOnClasspath(javaProject)) {
- return JAXB_GENERIC_GEN_JDK_CLASS;
- }
- this.toolsJarPath = findToolsJarPath(javaProject);
- return JAXB_GENERIC_GEN_JDK_CLASS;
- }
-
- private IRuntimeClasspathEntry getToolsClasspathEntry() {
- return (StringTools.stringIsEmpty(this.toolsJarPath)) ?
- null :
- getArchiveClasspathEntry(new Path(this.toolsJarPath));
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- // Containers classpath
- for(IRuntimeClasspathEntry containerClasspathEntry: this.getContainersClasspathEntries()) {
- classpath.add(containerClasspathEntry.getMemento());
- }
- // Tools classpath
- IRuntimeClasspathEntry toolsClasspathEntry = this.getToolsClasspathEntry();
- if(toolsClasspathEntry != null) {
- classpath.add(toolsClasspathEntry.getMemento());
- }
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
- StringBuffer programArguments = new StringBuffer();
-
- programArguments.append("-d "); //$NON-NLS-1$
- if(StringTools.stringIsEmpty(this.outputDir)) {
- throw new RuntimeException("Output directory cannot be empty"); //$NON-NLS-1$
- }
- programArguments.append(StringTools.quote(this.outputDir));
- if( ! StringTools.stringIsEmpty(this.targetPackage)) {
- programArguments.append(" -p "); //$NON-NLS-1$
- programArguments.append(this.targetPackage);
- }
- if( ! StringTools.stringIsEmpty(this.catalog)) {
- programArguments.append(" -catalog "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.catalog));
- }
-
- // Options
- if( ! StringTools.stringIsEmpty(this.generatorOptions.getProxy())) {
- programArguments.append(" -httpproxy "); //$NON-NLS-1$
- programArguments.append(this.generatorOptions.getProxy());
- }
- if( ! StringTools.stringIsEmpty(this.generatorOptions.getProxyFile())) {
- programArguments.append(" -httpproxyfile "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.generatorOptions.getProxyFile()));
- }
-
- if( ! this.generatorOptions.usesStrictValidation()) {
- programArguments.append(" -nv"); //$NON-NLS-1$
- }
- if(this.generatorOptions.makesReadOnly()) {
- programArguments.append(" -readOnly"); //$NON-NLS-1$
- }
- if(this.generatorOptions.suppressesPackageInfoGen()) {
- programArguments.append(" -npa"); //$NON-NLS-1$
- }
- if(this.generatorOptions.suppressesHeaderGen()) {
- programArguments.append(" -no-header"); //$NON-NLS-1$
- }
- if(this.generatorOptions.isVerbose()) {
- programArguments.append(" -verbose"); //$NON-NLS-1$
- }
- if(this.generatorOptions.isQuiet()) {
- programArguments.append(" -quiet"); //$NON-NLS-1$
- }
-
- if(this.generatorOptions.treatsAsXmlSchema()) {
- programArguments.append(" -xmlschema"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsRelaxNg()) {
- programArguments.append(" -relaxng"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsRelaxNgCompact()) {
- programArguments.append(" -relaxng-compact"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsDtd()) {
- programArguments.append(" -dtd"); //$NON-NLS-1$
- }
- if(this.generatorOptions.treatsAsWsdl()) {
- programArguments.append(" -wsdl"); //$NON-NLS-1$
- }
- if(this.generatorOptions.showsVersion()) {
- programArguments.append(" -version"); //$NON-NLS-1$
- }
- if(this.generatorOptions.showsHelp()) {
- programArguments.append(" -help"); //$NON-NLS-1$
- }
-
- // Extension Options
- if(this.generatorExtensionOptions.allowsExtensions()) {
- programArguments.append(" -extension"); //$NON-NLS-1$
- }
- if( ! StringTools.stringIsEmpty(this.generatorExtensionOptions.getClasspath())) {
- programArguments.append(" -classpath "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.generatorExtensionOptions.getClasspath()));
- }
- if( ! StringTools.stringIsEmpty(this.generatorExtensionOptions.getAdditionalArgs())) {
- programArguments.append(' ');
- programArguments.append(this.generatorExtensionOptions.getAdditionalArgs());
- }
-
- // schema
- programArguments.append(' ');
- if(StringTools.stringIsEmpty(this.schemaPathOrUri)) {
- throw new RuntimeException("Schema cannot be empty"); //$NON-NLS-1$
- }
- programArguments.append(StringTools.quote(this.schemaPathOrUri));
-
- // bindings
- if (this.bindingsFileNames.length > 0) {
- for (String bindingsFileName : this.bindingsFileNames) {
- programArguments.append(" -b "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(bindingsFileName));
- }
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
-
- // ********** Queries **********
-
- private List<IRuntimeClasspathEntry> getContainersClasspathEntries() throws CoreException {
- ArrayList<IRuntimeClasspathEntry> classpathEntries = new ArrayList<IRuntimeClasspathEntry>();
- for(IClasspathEntry classpathEntry: this.javaProject.getRawClasspath()) {
- if(classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), this.javaProject);
- if(container != null && container.getKind() == IClasspathContainer.K_SYSTEM) {
- classpathEntries.add(
- JavaRuntime.newRuntimeContainerClasspathEntry(
- container.getPath(),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES,
- this.javaProject));
- }
- }
- }
- return classpathEntries;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java
deleted file mode 100644
index 476945fbe6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorExtensionOptions.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-/**
- * ClassesGeneratorExtensionOptions
- */
-public class ClassesGeneratorExtensionOptions
-{
- private String classpath;
- private boolean allowsExtensions;
-
- private String additionalArgs;
-
- // ********** constructor **********
-
- public ClassesGeneratorExtensionOptions() {
- super();
- }
-
- // ********** getters/setters *********
-
- public boolean allowsExtensions() {
- return this.allowsExtensions;
- }
-
- public void setAllowsExtensions(boolean allowsExtensions) {
- this.allowsExtensions = allowsExtensions;
- }
-
- public String getClasspath() {
- return this.classpath;
- }
-
- public void setClasspath(String classpath){
- this.classpath = classpath;
- }
-
- public String getAdditionalArgs() {
- return this.additionalArgs;
- }
-
- public void setAdditionalArgs(String additionalArgs){
- this.additionalArgs = additionalArgs;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java
deleted file mode 100644
index 1a2cf799d5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/ClassesGeneratorOptions.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-
-/**
- * ClassesGeneratorOptions
- */
-public class ClassesGeneratorOptions
-{
- private String proxy;
- private String proxyFile;
-
- private boolean usesStrictValidation;
- private boolean makesReadOnly;
- private boolean suppressesPackageInfoGen;
- private boolean suppressesHeaderGen;
- private boolean isVerbose;
- private boolean isQuiet;
-
- private boolean treatsAsXmlSchema;
- private boolean treatsAsRelaxNg;
- private boolean treatsAsRelaxNgCompact;
- private boolean treatsAsDtd;
- private boolean treatsAsWsdl;
- private boolean showsVersion;
- private boolean showsHelp;
-
- // ********** constructor **********
-
- public ClassesGeneratorOptions() {
- super();
- }
-
- // ********** getters/setters *********
-
- public String getProxy() {
- return this.proxy;
- }
-
- public void setProxy(String proxy){
- this.proxy = proxy;
- }
-
- public String getProxyFile() {
- return this.proxyFile;
- }
-
- public void setProxyFile(String proxyFile){
- this.proxyFile = proxyFile;
- }
-
- public boolean suppressesPackageInfoGen() {
- return this.suppressesPackageInfoGen;
- }
-
- public void setSuppressesPackageInfoGen(boolean suppressesPackageInfoGen) {
- this.suppressesPackageInfoGen = suppressesPackageInfoGen;
- }
-
- public boolean usesStrictValidation() {
- return this.usesStrictValidation;
- }
-
- public void setUsesStrictValidation(boolean usesStrictValidation) {
- this.usesStrictValidation = usesStrictValidation;
- }
-
- public boolean makesReadOnly() {
- return this.makesReadOnly;
- }
-
- public void setMakesReadOnly(boolean makesReadOnly) {
- this.makesReadOnly = makesReadOnly;
- }
-
- public boolean suppressesHeaderGen() {
- return this.suppressesHeaderGen;
- }
-
- public void setSuppressesHeaderGen(boolean suppressesHeaderGen){
- this.suppressesHeaderGen = suppressesHeaderGen;
- }
-
- public boolean isVerbose() {
- return this.isVerbose;
- }
-
- public void setIsVerbose(boolean isVerbose){
- this.isVerbose = isVerbose;
- }
-
- public boolean isQuiet() {
- return this.isQuiet;
- }
-
- public void setIsQuiet(boolean isQuiet){
- this.isQuiet = isQuiet;
- }
-
- public boolean treatsAsXmlSchema() {
- return this.treatsAsXmlSchema;
- }
-
- public void setTreatsAsXmlSchema(boolean treatsAsXmlSchema){
- this.treatsAsXmlSchema = treatsAsXmlSchema;
- }
-
- public boolean treatsAsRelaxNg() {
- return this.treatsAsRelaxNg;
- }
-
- public void setTreatsAsRelaxNg(boolean treatsAsRelaxNg){
- this.treatsAsRelaxNg = treatsAsRelaxNg;
- }
-
- public boolean treatsAsRelaxNgCompact() {
- return this.treatsAsRelaxNgCompact;
- }
-
- public void setTreatsAsRelaxNgCompact(boolean treatsAsRelaxNgCompact){
- this.treatsAsRelaxNgCompact = treatsAsRelaxNgCompact;
- }
-
- public boolean treatsAsDtd() {
- return this.treatsAsDtd;
- }
-
- public void setTreatsAsDtd(boolean treatsAsDtd){
- this.treatsAsDtd = treatsAsDtd;
- }
-
- public boolean treatsAsWsdl() {
- return this.treatsAsWsdl;
- }
-
- public void setTreatsAsWsdl(boolean treatsAsWsdl){
- this.treatsAsWsdl = treatsAsWsdl;
- }
-
- public boolean showsVersion() {
- return this.showsVersion;
- }
-
- public void setShowsVersion(boolean showsVersion){
- this.showsVersion = showsVersion;
- }
-
- public boolean showsHelp() {
- return this.showsHelp;
- }
-
- public void setShowsHelp(boolean showsHelp){
- this.showsHelp = showsHelp;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java
deleted file mode 100644
index 0db2a9e337..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/GenerateJaxbClassesJob.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-
-/**
- * GenerateJaxbClassesJob
- */
-public class GenerateJaxbClassesJob extends WorkspaceJob {
- private final IJavaProject javaProject;
- private final String absoluteLocalXsdUri;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final boolean usesMoxyGenerator;
- private final String[] bindingsFileNames;
- private final ClassesGeneratorOptions generatorOptions;
- private final ClassesGeneratorExtensionOptions generatorExtensionOptions;
-
- // ********** constructors **********
-
- public GenerateJaxbClassesJob(
- IJavaProject javaProject,
- String absoluteLocalXsdUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
-
- super(JptJaxbCoreMessages.ClassesGenerator_generatingClasses);
- if (javaProject == null) {
- throw new RuntimeException("Project is null"); //$NON-NLS-1$
- }
- else if (StringTools.stringIsEmpty(absoluteLocalXsdUri)) {
- throw new RuntimeException("Schema cannot be empty"); //$NON-NLS-1$
- }
- else if(StringTools.stringIsEmpty(outputDir)) {
- throw new RuntimeException("Output directory cannot be empty"); //$NON-NLS-1$
- }
- this.javaProject = javaProject;
- this.absoluteLocalXsdUri = absoluteLocalXsdUri;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.usesMoxyGenerator = usesMoxyGenerator;
- this.bindingsFileNames = bindingsFileNames;
- this.generatorOptions = generatorOptions;
- this.generatorExtensionOptions = generatorExtensionOptions;
- this.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(this.javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, JptJaxbCoreMessages.ClassesGenerator_generatingClassesTask, 1);
- try {
- this.classesGeneratorGenerate(this.javaProject,
- this.absoluteLocalXsdUri,
- this.outputDir,
- this.targetPackage,
- this.catalog,
- this.usesMoxyGenerator,
- this.bindingsFileNames,
- this.generatorOptions,
- this.generatorExtensionOptions,
- sm.newChild(1));
- }
- catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- // fall through and tell monitor we are done
- }
- catch (RuntimeException re) {
- throw new RuntimeException(re);
- }
- return Status.OK_STATUS;
-}
-
- private void classesGeneratorGenerate(IJavaProject javaProject,
- String absoluteLocalXsdUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions,
- IProgressMonitor monitor) {
-
- ClassesGenerator.generate(javaProject,
- absoluteLocalXsdUri,
- outputDir,
- targetPackage,
- catalog,
- usesMoxyGenerator,
- bindingsFileNames,
- generatorOptions,
- generatorExtensionOptions,
- monitor);
- return;
- }
-} \ No newline at end of file
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
deleted file mode 100644
index 2d821a9114..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/gen/SchemaGenerator.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.gen;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-
-/**
- * SchemaGenerator
- */
-public class SchemaGenerator extends AbstractJptGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "JAXB Schema Gen Run Config"; //$NON-NLS-1$
- static public String JAXB_SCHEMA_GEN_PACKAGE_NAME = "org.eclipse.jpt.jaxb.core.schemagen"; //$NON-NLS-1$
- static public String JAXB_SCHEMA_GEN_CLASS = JAXB_SCHEMA_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME = "org.eclipse.jpt.jaxb.eclipselink.core.schemagen"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_CLASS = ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
-
- static public String ECLIPSELINK_JAXB_CONTEXT_FACTORY = "org.eclipse.persistence.jaxb.JAXBContextFactory"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS = "javax.xml.bind.context.factory=" + ECLIPSELINK_JAXB_CONTEXT_FACTORY; //$NON-NLS-1$
- static public String JAXB_PROPERTIES_FILE_NAME = "jaxb.properties"; //$NON-NLS-1$
-
- static public String JAXB_SCHEMA_GEN_JAR_PREFIX = JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_JAR_PREFIX = ECLIPSELINK_JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
-
- static public String JAXB_GENERIC_SCHEMA_GEN_CLASS = "javax.xml.bind.JAXBContext"; //$NON-NLS-1$
- static public String JAXB_ECLIPSELINK_SCHEMA_GEN_CLASS = "org.eclipse.persistence.jaxb.JAXBContext"; //$NON-NLS-1$
-
- private final String targetSchemaName;
- private final String[] sourceClassNames;
- private String mainType;
- private boolean useMoxy;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy,
- IProgressMonitor monitor) {
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new SchemaGenerator(javaProject,
- targetSchemaName,
- sourceClassNames,
- useMoxy).generate(monitor);
- }
-
- // ********** constructors **********
-
- protected SchemaGenerator(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy) {
- super(javaProject);
- this.targetSchemaName = targetSchemaName;
- this.sourceClassNames = sourceClassNames;
- this.useMoxy = useMoxy;
- this.mainType = (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_CLASS :
- JAXB_SCHEMA_GEN_CLASS;
- this.initialize();
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_JAR_PREFIX :
- JAXB_SCHEMA_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // generate jaxb.properties file if necessary
- if(this.useMoxy) {
- if( ! this.jaxbPropertiesFileIsPresent()) {
- this.generateJaxbPropertiesFile(monitor);
- }
- else if( ! this.jaxbContextUsesMoxy()) {
- //properties file actually specifies a different implementation
- //override wizard setting and fall back to generic generation
- this.useMoxy = false;
- this.mainType = JAXB_SCHEMA_GEN_CLASS;
- }
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Schema_Gen jar
- classpath.add(this.getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
-
- StringBuffer programArguments = new StringBuffer();
- // sourceClassNames
- this.appendClassNameArguments(programArguments);
-
- // schema
- programArguments.append(" -s \""); //$NON-NLS-1$
- programArguments.append(this.targetSchemaName);
- programArguments.append('"');
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** private methods **********
-
- private void appendClassNameArguments(StringBuffer sb) {
- for (String className : this.sourceClassNames) {
- sb.append(" -c "); //$NON-NLS-1$
- sb.append(className);
- }
- }
-
- /**
- * Returns the first "jaxb.properties" file that is found in a valid source
- * folder in the project.
- *
- * Returns null if no "jaxb.properties" file is found.
- */
- private IFile getJaxbPropertiesFile() {
- return getJaxbPropertiesFileFromPackageRoots(JDTTools.getJavaSourceFolders(this.javaProject));
- }
-
- private IFile getJaxbPropertiesFileFromPackageRoots(Iterable<IPackageFragmentRoot> packageFragmentRoots){
- IJavaElement[] javaElements;
- IFile jaxbPropertiesFile = null;
- try {
- for (IPackageFragmentRoot pfr : packageFragmentRoots) {
- jaxbPropertiesFile = this.findJaxbPropertiesFile(pfr.getNonJavaResources());
- if(jaxbPropertiesFile != null) {
- return jaxbPropertiesFile;
- }
- javaElements = pfr.getChildren();
- for(IJavaElement je : javaElements) {
- jaxbPropertiesFile = this.findJaxbPropertiesFile(((IPackageFragment)je).getNonJavaResources());
- if(jaxbPropertiesFile != null) {
- return jaxbPropertiesFile;
- }
- }
- }
- } catch (JavaModelException jme) {
- throw new RuntimeException(jme);
- }
- return null;
- }
-
- private IFile findJaxbPropertiesFile(Object[] objects) throws JavaModelException {
- for(Object object : objects) {
- IResource resource = (IResource) object;
- if(resource.getName().equals(JAXB_PROPERTIES_FILE_NAME)) {
- // jaxb.properties has been found
- return (IFile)resource;
- }
- }
- return null;
- }
-
- private boolean jaxbPropertiesFileIsPresent() {
- return this.getJaxbPropertiesFile() != null;
- }
-
- private boolean jaxbContextUsesMoxy() {
-
- InputStream in = null;
- try {
- in = this.getJaxbPropertiesFile().getContents();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- String line = reader.readLine();
- //jaxb.properties will only contain one property entry, the JAXBContextFactory
- String propertyValue = line.substring(line.indexOf("=") + 1); //$NON-NLS-1$
- if (propertyValue.equals(ECLIPSELINK_JAXB_CONTEXT_FACTORY)) {
- return true;
- }
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException ioe) {
- throw new RuntimeException(ioe);
- }
- }
- }
- return false;
- }
-
- private void generateJaxbPropertiesFile(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 1);
- sm.subTask(JptJaxbCoreMessages.SchemaGenerator_creatingJAXBPropertiesFileTask);
-
- IPackageFragment packageFragment = this.findPackageFragementForSourceClassName(this.sourceClassNames[0]);
-
- IFolder folder = (IFolder)packageFragment.getResource();
- IFile file = folder.getFile(JAXB_PROPERTIES_FILE_NAME);
-
- byte[] bytes;
- try {
- bytes = ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS.getBytes("UTF-8"); //$NON-NLS-1$
- } catch (UnsupportedEncodingException e) {
- throw new RuntimeException(e);
- }
-
- InputStream contents = new ByteArrayInputStream(bytes);
-
- try {
- //the input stream will be closed as a result of calling create
- file.create(contents, IResource.NONE, sm.newChild(1));
- } catch (CoreException ce) {
- throw new RuntimeException(ce);
- }
- }
-
- private IPackageFragment findPackageFragementForSourceClassName(String sourceClassName) {
-
- if(this.classIsInDefaultPackage(sourceClassName)) {
- return this.emptyPackageFragment();
- }
- String packageName = sourceClassName.substring(0, sourceClassName.lastIndexOf('.'));
-
- //Find the existing package fragment where we want to generate
- for (IPackageFragmentRoot pfr : JDTTools.getJavaSourceFolders(this.javaProject)) {
- //use the package of the first source class as the package for generation
- IPackageFragment packageFragment = pfr.getPackageFragment(packageName);
- if (packageFragment.exists()){
- return packageFragment;
- }
- }
- //the existing package fragment was not found
- throw new IllegalStateException("Java package must exist for source class"); //$NON-NLS-1$
- }
-
- private IPackageFragment emptyPackageFragment() {
- return this.getFirstJavaSourceFolder().getPackageFragment(""); //$NON-NLS-1$
- }
-
- private IPackageFragmentRoot getFirstJavaSourceFolder() {
- Iterator<IPackageFragmentRoot> i = JDTTools.getJavaSourceFolders(this.javaProject).iterator();
- return i.hasNext() ? i.next() : null;
- }
-
- private boolean classIsInDefaultPackage(String sourceClassName) {
- return ! sourceClassName.contains("."); //$NON-NLS-1$
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java
deleted file mode 100644
index b7594bd39c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_Factory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbFactory;
-
-/**
- * Generic JAXB version 2.1
- */
-public class GenericJaxb_2_1_Factory
- extends AbstractJaxbFactory {
-
- // singleton
- private static final JaxbFactory INSTANCE = new GenericJaxb_2_1_Factory();
-
- /**
- * Return the singleton.
- */
- public static JaxbFactory instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GenericJaxb_2_1_Factory() {
- super();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
deleted file mode 100644
index 72b0f4ab33..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinition.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.internal.JavaPackageInfoResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyElementMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementRefMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementRefsMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementsMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlTransientMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlValueMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorOrderAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyAttributeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAttachmentRefAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAttributeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementDeclAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementRefAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementRefsAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementWrapperAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlElementsAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlEnumAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlEnumValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlIDAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlIDREFAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlInlineBinaryDataAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlJavaTypeAdapterAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlJavaTypeAdaptersAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlListAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlMimeTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlMixedAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlRegistryAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlRootElementAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSchemaTypesAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSeeAlsoAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTransientAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTypeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex.JaxbIndexResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops.JaxbPropertiesResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class GenericJaxb_2_1_PlatformDefinition
- extends AbstractJaxbPlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new GenericJaxb_2_1_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
- protected GenericJaxb_2_1_PlatformDefinition() {
- super();
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_1;
- }
-
- public JaxbFactory getFactory() {
- return GenericJaxb_2_1_Factory.instance();
- }
-
- @Override
- protected Map<String, String> buildJavaToSchemaTypes() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("boolean", "boolean");
- map.put("java.lang.Boolean", "boolean");
- map.put("byte", "byte");
- map.put("java.lang.Byte", "byte");
- map.put("short", "short");
- map.put("java.lang.Short", "short");
- map.put("int", "int");
- map.put("java.lang.Integer", "int");
- map.put("long", "long");
- map.put("java.lang.Long", "long");
- map.put("float", "float");
- map.put("java.lang.Float", "float");
- map.put("double", "double");
- map.put("java.lang.Double", "double");
- map.put("java.lang.String", "string");
- map.put("java.math.BigInteger", "integer");
- map.put("java.math.BigDecimal", "decimal");
- map.put("java.util.Calendar", "dateTime");
- map.put("java.util.Date", "dateTime");
- map.put("javax.xml.namespace.QName", "QName");
- map.put("java.net.URI", "string");
- map.put("javax.xml.datatype.XMLGregorianCalendar", "anySimpleType");
- map.put("javax.xml.datatype.Duration", "duration");
- map.put("java.lang.Object", "anyType");
- map.put("java.awt.Image", "base64Binary");
- map.put("javax.activation.DataHandler", "base64Binary");
- map.put("javax.xml.transform.Source", "base64Binary");
- map.put("java.util.UUID", "string");
- return map;
- }
-
- @Override
- protected JaxbResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JaxbResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JavaPackageInfoResourceModelProvider.instance(),
- JaxbIndexResourceModelProvider.instance(),
- JaxbPropertiesResourceModelProvider.instance()};
- }
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
- }
- throw new IllegalArgumentException(contentType.toString());
- }
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return new AnnotationDefinition[] {
- XmlAccessorOrderAnnotationDefinition.instance(),
- XmlAccessorTypeAnnotationDefinition.instance(),
- XmlAnyAttributeAnnotationDefinition.instance(),
- XmlAnyElementAnnotationDefinition.instance(),
- XmlAttachmentRefAnnotationDefinition.instance(),
- XmlAttributeAnnotationDefinition.instance(),
- XmlElementAnnotationDefinition.instance(),
- XmlElementDeclAnnotationDefinition.instance(),
- XmlElementRefAnnotationDefinition.instance(),
- XmlElementRefsAnnotationDefinition.instance(),
- XmlElementsAnnotationDefinition.instance(),
- XmlElementWrapperAnnotationDefinition.instance(),
- XmlEnumAnnotationDefinition.instance(),
- XmlEnumValueAnnotationDefinition.instance(),
- XmlIDAnnotationDefinition.instance(),
- XmlIDREFAnnotationDefinition.instance(),
- XmlInlineBinaryDataAnnotationDefinition.instance(),
- XmlJavaTypeAdaptersAnnotationDefinition.instance(),
- XmlListAnnotationDefinition.instance(),
- XmlMimeTypeAnnotationDefinition.instance(),
- XmlMixedAnnotationDefinition.instance(),
- XmlRegistryAnnotationDefinition.instance(),
- XmlRootElementAnnotationDefinition.instance(),
- XmlSchemaAnnotationDefinition.instance(),
- XmlSchemaTypesAnnotationDefinition.instance(),
- XmlSeeAlsoAnnotationDefinition.instance(),
- XmlTransientAnnotationDefinition.instance(),
- XmlTypeAnnotationDefinition.instance(),
- XmlValueAnnotationDefinition.instance()};
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return new NestableAnnotationDefinition[] {
- XmlJavaTypeAdapterAnnotationDefinition.instance(),
- XmlSchemaTypeAnnotationDefinition.instance()
- };
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlElementMappingDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- definitions.add(JavaXmlAnyAttributeMappingDefinition.instance());
- definitions.add(JavaXmlAnyElementMappingDefinition.instance());
- definitions.add(JavaXmlAttributeMappingDefinition.instance());
- definitions.add(JavaXmlElementMappingDefinition.instance());
- definitions.add(JavaXmlElementRefMappingDefinition.instance());
- definitions.add(JavaXmlElementRefsMappingDefinition.instance());
- definitions.add(JavaXmlElementsMappingDefinition.instance());
- definitions.add(JavaXmlTransientMappingDefinition.instance());
- definitions.add(JavaXmlValueMappingDefinition.instance());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java
deleted file mode 100644
index a8a235bdc8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxb_2_1_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class GenericJaxb_2_1_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return GenericJaxb_2_1_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java
deleted file mode 100644
index 50df9e2c93..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinition.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class GenericJaxb_2_2_PlatformDefinition
- extends GenericJaxb_2_1_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new GenericJaxb_2_2_PlatformDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected GenericJaxb_2_2_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return GenericJaxbPlatform.VERSION_2_2;
- }
-
- @Override
- public JaxbFactory getFactory() {
- return GenericJaxb_2_1_Factory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java
deleted file mode 100644
index 14944e74e7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb22/GenericJaxb_2_2_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.jaxb22;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class GenericJaxb_2_2_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return GenericJaxb_2_2_PlatformDefinition.instance();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 87d08f80ca..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbJreLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderInstallOperationConfig;
-
-
-public class JaxbJreLibraryProviderInstallOperationConfig
- extends LibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbJreLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- if (old != jaxbPlatform) {
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
- }
-
- @Override
- public synchronized IStatus validate() {
- IStatus status = super.validate();
- if (! status.isOK()) {
- return status;
- }
-
- for (LibraryValidator libraryValidator : JptCommonCorePlugin.getLibraryValidators(this)) {
- status = libraryValidator.validate(this);
- if (! status.isOK()) {
- return status;
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
deleted file mode 100644
index 0fede72a1b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbLibraryProviderInstallOperationConfigAdapterFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-/**
- * Factory to build Dali adapters for an {@link JaxbLibraryProviderInstallOperationConfig}:<ul>
- * <li>{@link JaxbPlatformDescription}
- * </ul>
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>.
- */
-public class JaxbLibraryProviderInstallOperationConfigAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JaxbPlatformDescription.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof JaxbLibraryProviderInstallOperationConfig) {
- return this.getAdapter((JaxbLibraryProviderInstallOperationConfig) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(JaxbLibraryProviderInstallOperationConfig config, Class<?> adapterType) {
- if (adapterType == JaxbPlatformDescription.class) {
- return config.getJaxbPlatform();
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 1b6769914d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbOsgiBundlesLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.jpt.common.core.internal.libprov.JptOsgiBundlesLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public class JaxbOsgiBundlesLibraryProviderInstallOperationConfig
- extends JptOsgiBundlesLibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbOsgiBundlesLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 39349ca701..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libprov/JaxbUserLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libprov;
-
-import org.eclipse.jpt.common.core.internal.libprov.JptUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public class JaxbUserLibraryProviderInstallOperationConfig
- extends JptUserLibraryProviderInstallOperationConfig
- implements JaxbLibraryProviderInstallOperationConfig {
-
- private JaxbPlatformDescription jaxbPlatform;
-
-
- public JaxbUserLibraryProviderInstallOperationConfig() {
- super();
- }
-
-
- public JaxbPlatformDescription getJaxbPlatform() {
- return this.jaxbPlatform;
- }
-
- public void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform) {
- JaxbPlatformDescription old = this.jaxbPlatform;
- this.jaxbPlatform = jaxbPlatform;
- notifyListeners(PROP_JAXB_PLATFORM, old, jaxbPlatform);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
deleted file mode 100644
index 4ec0fc3238..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-
-public class GenericEclipseLinkBundlesLibraryValidator
-// extends AbstractOsgiBundlesLibraryValidator
- {
-
-// public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-// JpaOsgiBundlesLibraryProviderInstallOperationConfig jpaConfig
-// = (JpaOsgiBundlesLibraryProviderInstallOperationConfig) config;
-// Map<String, VersionRange[]> bundleVersionRanges = new HashMap<String, VersionRange[]>();
-// String bundleName = "javax.persistence"; //$NON-NLS-1$
-// VersionRange[] versionRanges = new VersionRange[0];
-// if (config.getProjectFacetVersion().equals(JpaFacet.VERSION_1_0)) {
-// versionRanges = new VersionRange[] {new VersionRange("[1.0, 3.0)")}; //$NON-NLS-1$
-// }
-// else if (config.getProjectFacetVersion().equals(JpaFacet.VERSION_2_0)) {
-// versionRanges = new VersionRange[] {new VersionRange("[2.0, 3.0)")}; //$NON-NLS-1$
-// }
-// bundleVersionRanges.put(bundleName, versionRanges);
-// return validate(jpaConfig, bundleVersionRanges);
-// }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
deleted file mode 100644
index c4abe11d02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/GenericJaxbUserLibraryValidator.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jpt.common.core.internal.libval.LibValUtil;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class GenericJaxbUserLibraryValidator
- implements LibraryValidator {
-
- public synchronized IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-
- JaxbUserLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbUserLibraryProviderInstallOperationConfig) config;
-
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
- IProjectFacetVersion javaVersion = JaxbLibValUtil.getJavaVersion(jaxbConfig);
- IProjectFacetVersion javaJaxbVersion = JaxbLibValUtil.findJavaJaxbVersion(jaxbConfig);
-
- Iterable<IPath> libraryPaths =
- new TransformationIterable<IClasspathEntry, IPath>(jaxbConfig.resolve()) {
- @Override
- protected IPath transform(IClasspathEntry o) {
- return o.getPath();
- }
- };
-
- // dev-time portion of validation - error if actual java library *conflicts with* jaxb facet
- // or if library does not provide supplemental classes
-
- IProjectFacetVersion jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
-
- // null here implies something prior to jaxb 2.1
- if (jreJaxbVersion != null) {
- if (jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
- }
- // if jre is enough for jaxb version, we don't look for classes in the library
- else {
- Set<String> classNames = new HashSet<String>();
-
- classNames.add("javax.xml.bind.annotation.XmlSeeAlso"); //$NON-NLS-1$
- if (jaxbVersion.compareTo(JaxbFacet.VERSION_2_2) >= 0) {
- classNames.add("javax.xml.bind.JAXBPermission"); //$NON-NLS-1$
- }
-
- IStatus status = LibValUtil.validate(libraryPaths, classNames);
-
- if (! status.isOK()) {
- return status;
- }
- }
-
- // runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
- // user may override implementation manually, however
- // assume 1.6 runtime environs are latest (with jaxb 2.1, not 2.0)
-
- // null here implies something prior to jaxb 2.1
- if (javaJaxbVersion != null && javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.UserLibraryValidator_incompatibleJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
deleted file mode 100644
index 7701da3606..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbJreLibraryValidator.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbJreLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
-
- JaxbLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbLibraryProviderInstallOperationConfig) config;
-
- if (! jaxbConfig.getJaxbPlatform().getGroup().equals(GenericJaxbPlatform.GROUP)) {
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, JptJaxbCoreMessages.JreLibraryValidator_invalidPlatform);
- }
-
- IProjectFacetVersion jaxbVersion = config.getProjectFacetVersion();
- IProjectFacetVersion javaVersion = JaxbLibValUtil.getJavaVersion(jaxbConfig);
- IProjectFacetVersion javaJaxbVersion = JaxbLibValUtil.findJavaJaxbVersion(jaxbConfig);
-
- // dev-time portion of validation - error if actual java library does not support jaxb facet
-
- IProjectFacetVersion jreJaxbVersion = JaxbLibValUtil.findJreJaxbVersion(jaxbConfig);
-
- // null here implies something prior to jaxb 2.1
- if (jreJaxbVersion == null || jreJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaLibrary,
- new String[] {jaxbVersion.getVersionString()});
- return new Status(IStatus.ERROR, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- // runtime portion of validation - warn if java facet is insufficient to provide jaxb api.
- // user may override implementation manually, however
- // assume 1.6 runtime environs are latest (with jaxb 2.1, not 2.0)
-
- // null here implies something prior to jaxb 2.1
- if (javaJaxbVersion == null || javaJaxbVersion.compareTo(jaxbVersion) < 0) {
- String message = NLS.bind(
- JptJaxbCoreMessages.JreLibraryValidator_invalidJavaFacet,
- new String[] {javaVersion.getVersionString(), jaxbVersion.getVersionString()});
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, message);
- }
-
- // TODO - check for xjc classes when we support jdk version of xjc
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
deleted file mode 100644
index ce5d0ab6bb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/libval/JaxbLibValUtil.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.libval;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.zip.ZipFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.LibraryLocation;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.libprov.JaxbLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.common.project.facet.core.StandardJreRuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-
-
-public class JaxbLibValUtil {
-
- static IProjectFacetVersion getJavaVersion(JaxbLibraryProviderInstallOperationConfig config) {
- return config.getFacetedProject().getProjectFacetVersion(JavaFacet.FACET);
- }
-
- /**
- * Return jaxb version determined by java facet version.
- * Assume highest update of java (i.e. java 1.6 maps to jaxb 2.1)
- */
- static IProjectFacetVersion findJavaJaxbVersion(JaxbLibraryProviderInstallOperationConfig config) {
- IProjectFacetVersion javaVersion = getJavaVersion(config);
-
- if (javaVersion == JavaFacet.VERSION_1_6) {
- return JaxbFacet.VERSION_2_1;
- }
- else if (javaVersion == JavaFacet.VERSION_1_7) {
- return JaxbFacet.VERSION_2_2;
- }
-
- return null;
- }
-
- static IProjectFacetVersion findJreJaxbVersion(JaxbLibraryProviderInstallOperationConfig config) {
- IRuntime runtime = config.getFacetedProject().getPrimaryRuntime();
-
- if (runtime != null) {
- for (IRuntimeComponent rc : runtime.getRuntimeComponents()) {
- IVMInstall vm = findVMInstall(rc);
- if (vm != null) {
- return findJreJaxbVersion(vm);
- }
- }
- }
-
- IVMInstall vm = JavaRuntime.getDefaultVMInstall();
-
- IJavaProject javaProject = JavaCore.create(config.getFacetedProject().getProject());
- if (javaProject != null) {
- try {
- vm = JavaRuntime.getVMInstall(javaProject);
- }
- catch (CoreException ce) {
- // do nothing, just use the default install
- }
- }
-
- if (vm != null) {
- return findJreJaxbVersion(vm);
- }
-
- return null;
- }
-
- private static IVMInstall findVMInstall(IRuntimeComponent rc) {
- String vmInstallTypeId
- = rc.getProperty(StandardJreRuntimeComponent.PROP_VM_INSTALL_TYPE);
- String vmInstallId
- = rc.getProperty(StandardJreRuntimeComponent.PROP_VM_INSTALL_ID);
-
- if (vmInstallTypeId == null || vmInstallId == null) {
- return null;
- }
-
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(vmInstallTypeId);
-
- if( vmInstallType == null ) {
- return null;
- }
-
- return vmInstallType.findVMInstall(vmInstallId);
- }
-
- private static IProjectFacetVersion findJreJaxbVersion(IVMInstall vm) {
- if (vm instanceof IVMInstall2) {
- String javaVersion = ((IVMInstall2) vm).getJavaVersion();
- if (javaVersion != null) {
- // all other versions except 1.7 and 1.6 have no corresponding version (as of yet)
- if (javaVersion.startsWith(JavaCore.VERSION_1_7)) {
- return JaxbFacet.VERSION_2_2;
- }
- // 1.6 must be further analyzed
- if (! javaVersion.startsWith(JavaCore.VERSION_1_6)) {
- return null;
- }
- }
- }
-
- Iterable<IPath> vmLibPaths
- = new TransformationIterable<LibraryLocation, IPath>(
- new ArrayIterable<LibraryLocation>(JavaRuntime.getLibraryLocations(vm))) {
- @Override
- protected IPath transform(LibraryLocation o) {
- return o.getSystemLibraryPath();
- }
- };
-
- boolean foundXmlSeeAlso = false; // marker for jaxb 2.1 +
- boolean foundJAXBPermission = false; // marker for jaxb 2.2 +
-
- for (IPath vmLibPath : vmLibPaths) {
- File file = vmLibPath.toFile();
-
- if (file.exists()) {
- ZipFile zip = null;
-
- try {
- zip = new ZipFile(file);
-
- foundXmlSeeAlso |= zip.getEntry("javax/xml/bind/annotation/XmlSeeAlso.class") != null;
- foundJAXBPermission |= zip.getEntry("javax/xml/bind/JAXBPermission.class") != null;
-
- // short circuit for JAXB 2.2
- if (foundJAXBPermission) {
- return JaxbFacet.VERSION_2_2;
- }
- }
- catch (IOException e) {}
- finally {
- if (zip != null) {
- try {
- zip.close();
- }
- catch (IOException e) {}
- }
- }
- }
- }
-
- if (foundXmlSeeAlso) {
- return JaxbFacet.VERSION_2_1;
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java
deleted file mode 100644
index 745ba46411..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/operations/SchemaFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.operations;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.core.internal.operations.AbstractJptFileCreationDataModelProvider;
-
-/**
- * SchemaFileCreationDataModelProvider
- */
-public class SchemaFileCreationDataModelProvider extends AbstractJptFileCreationDataModelProvider
-{
-
- @Override
- protected String getDefaultFileName() {
- if(this.getProject() == null) {
- return null;
- }
- return this.getProject().getName();
- }
-
- /**
- * Return a best guess source location for the for the specified project
- */
- @Override
- protected IContainer getDefaultContainer() {
- IContainer defaultContainer = super.getDefaultContainer();
- if(defaultContainer != null) {
- IProject project = (IProject) this.model.getProperty(PROJECT);
- return defaultContainer.getFolder(project.getLocation());
- }
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java
deleted file mode 100644
index 6ca6048f5b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformDescriptionImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.jpt.common.core.internal.utility.XPointTools;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class JaxbPlatformDescriptionImpl
- implements JaxbPlatformDescription {
-
- private String id;
- private String pluginId;
- private String label;
- private String factoryClassName;
- private IProjectFacetVersion jaxbFacetVersion;
- private boolean default_ = false;
- private JaxbPlatformGroupDescriptionImpl group;
-
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- void setLabel(String label) {
- this.label = label;
- }
-
- public String getFactoryClassName() {
- return this.factoryClassName;
- }
-
- void setFactoryClassName(String className) {
- this.factoryClassName = className;
- }
-
- public IProjectFacetVersion getJaxbFacetVersion() {
- return this.jaxbFacetVersion;
- }
-
- void setJaxbFacetVersion(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- this.jaxbFacetVersion = jaxbFacetVersion;
- }
-
- public boolean supportsJaxbFacetVersion(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- return (this.jaxbFacetVersion != null) ? this.jaxbFacetVersion.equals(jaxbFacetVersion) : true;
- }
-
- public boolean isDefault() {
- return this.default_;
- }
-
- void setDefault(boolean default_) {
- this.default_ = default_;
- }
-
- public JaxbPlatformGroupDescription getGroup() {
- return this.group;
- }
-
- void setGroup(JaxbPlatformGroupDescriptionImpl group) {
- this.group = group;
- }
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- JaxbPlatformDefinitionFactory factory = XPointTools.instantiate(
- this.pluginId, JaxbPlatformManagerImpl.QUALIFIED_EXTENSION_POINT_ID,
- this.factoryClassName, JaxbPlatformDefinitionFactory.class);
- return factory.buildJaxbPlatformDefinition();
- }
-
- @Override
- public String toString() {
- return this.label;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java
deleted file mode 100644
index e3e83ad95d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformGroupDescriptionImpl.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-
-public class JaxbPlatformGroupDescriptionImpl
- implements JaxbPlatformGroupDescription {
-
- private String id;
- private String pluginId;
- private String label;
- private Map<String, JaxbPlatformDescriptionImpl> platforms;
-
-
- JaxbPlatformGroupDescriptionImpl() {
- this.platforms = new HashMap<String, JaxbPlatformDescriptionImpl>();
- }
-
- public String getId() {
- return this.id;
- }
-
- void setId(String id) {
- this.id = id;
- }
-
- public String getPluginId() {
- return this.pluginId;
- }
-
- void setPluginId(String pluginId) {
- this.pluginId = pluginId;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- void setLabel(String label) {
- this.label = label;
- }
-
- void addPlatform(JaxbPlatformDescriptionImpl platform) {
- this.platforms.put(platform.getId(), platform);
- }
-
- public Iterable<JaxbPlatformDescription> getPlatforms() {
- return new SuperIterableWrapper<JaxbPlatformDescription>(CollectionTools.collection(this.platforms.values()));
- }
-
- @Override
- public String toString() {
- return this.label;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
deleted file mode 100644
index 978a21cb8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.GenericAnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-public final class JaxbPlatformImpl
- implements JaxbPlatform {
-
- private JaxbPlatformDefinition platformDefinition;
-
- private AnnotationProvider annotationProvider;
-
-
- public JaxbPlatformImpl(JaxbPlatformDefinition jaxbPlatformDefinition) {
- super();
- this.platformDefinition = jaxbPlatformDefinition;
- this.annotationProvider = new GenericAnnotationProvider(this.platformDefinition.getAnnotationDefinitions(), this.platformDefinition.getNestableAnnotationDefinitions());
- }
-
-
- public JaxbPlatformDescription getDescription() {
- return this.platformDefinition.getDescription();
- }
-
- public JaxbPlatformDefinition getDefinition() {
- return this.platformDefinition;
- }
-
- // ********** factory **********
-
- public JaxbFactory getFactory() {
- return this.platformDefinition.getFactory();
- }
-
-
- // ********** JAXB file/resource models **********
-
- public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return (contentType == null) ? null : this.buildJaxbFile(jaxbProject, file, contentType);
- }
-
- protected JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType) {
- JptResourceModel resourceModel = this.buildResourceModel(jaxbProject, file, contentType);
- return (resourceModel == null) ? null : getFactory().buildJaxbFile(jaxbProject, file, contentType, resourceModel);
- }
-
- protected JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file, IContentType contentType) {
- JaxbResourceModelProvider provider = this.getResourceModelProvider(contentType);
- return (provider == null) ? null : provider.buildResourceModel(jaxbProject, file);
- }
-
- /**
- * Return null if we don't have a provider for the specified content type
- * (since we don't have control over the possible content types).
- */
- protected JaxbResourceModelProvider getResourceModelProvider(IContentType contentType) {
- for (JaxbResourceModelProvider provider : getResourceModelProviders()) {
- if (contentType.equals(provider.getContentType())) {
- return provider;
- }
- }
- return null;
- }
-
- protected ListIterable<JaxbResourceModelProvider> getResourceModelProviders() {
- return this.platformDefinition.getResourceModelProviders();
- }
-
-
- // ********** Java annotations **********
-
- public AnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return DefaultAnnotationEditFormatter.instance();
- }
-
-
- // ********** Java attribute mappings **********
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(
- JaxbPersistentAttribute attribute) {
- for (JavaAttributeMappingDefinition definition : getSpecifiedJavaAttributeMappingDefinitions()) {
- if (definition.isSpecified(attribute)) {
- return definition;
- }
- }
- throw new IllegalStateException("There must be a mapping definition for all attributes"); //$NON-NLS-1$
- }
-
- public Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions() {
- return this.platformDefinition.getSpecifiedJavaAttributeMappingDefinitions();
- }
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey) {
- for (JavaAttributeMappingDefinition definition : getSpecifiedJavaAttributeMappingDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions() {
- return this.platformDefinition.getDefaultJavaAttributeMappingDefinitions();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
deleted file mode 100644
index e619fc47e8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformManagerImpl.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import static org.eclipse.jpt.common.core.internal.utility.XPointTools.*;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.internal.utility.XPointTools.XPointException;
-import org.eclipse.jpt.common.utility.internal.KeyedSet;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperIterableWrapper;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformManager;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbPlatformManagerImpl
- implements JaxbPlatformManager {
-
- static final String EXTENSION_POINT_ID = "jaxbPlatforms"; //$NON-NLS-1$
- static final String QUALIFIED_EXTENSION_POINT_ID = JptJaxbCorePlugin.PLUGIN_ID_ + EXTENSION_POINT_ID;
- static final String PLATFORM_GROUP_ELEMENT = "jaxbPlatformGroup"; //$NON-NLS-1$
- static final String PLATFORM_ELEMENT = "jaxbPlatform"; //$NON-NLS-1$
- static final String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
- static final String LABEL_ATTRIBUTE = "label"; //$NON-NLS-1$
- static final String FACTORY_CLASS_ATTRIBUTE = "factoryClass"; //$NON-NLS-1$
- static final String JAXB_FACET_VERSION_ATTRIBUTE = "jaxbFacetVersion"; //$NON-NLS-1$
- static final String DEFAULT_ATTRIBUTE = "default"; //$NON-NLS-1$
- static final String GROUP_ELEMENT = "group"; //$NON-NLS-1$
-
-
- private static final JaxbPlatformManagerImpl INSTANCE = new JaxbPlatformManagerImpl();
-
-
- public static JaxbPlatformManagerImpl instance() {
- return INSTANCE;
- }
-
-
- private KeyedSet<String, JaxbPlatformGroupDescriptionImpl> platformGroupDescriptions;
- private KeyedSet<String, JaxbPlatformDescriptionImpl> platformDescriptions;
-
-
- // ********** constructor/initialization **********
-
- private JaxbPlatformManagerImpl() {
- super();
- this.platformGroupDescriptions = new KeyedSet<String, JaxbPlatformGroupDescriptionImpl>();
- this.platformDescriptions = new KeyedSet<String, JaxbPlatformDescriptionImpl>();
- readExtensions();
- }
-
-
- private void readExtensions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint xpoint
- = registry.getExtensionPoint(JptJaxbCorePlugin.PLUGIN_ID, EXTENSION_POINT_ID);
-
- if (xpoint == null) {
- throw new IllegalStateException();
- }
-
- List<IConfigurationElement> platformGroupConfigs = new ArrayList<IConfigurationElement>();
- List<IConfigurationElement> platformConfigs = new ArrayList<IConfigurationElement>();
-
- for (IExtension extension : xpoint.getExtensions()) {
- for (IConfigurationElement element : extension.getConfigurationElements()) {
- if (element.getName().equals(PLATFORM_GROUP_ELEMENT)) {
- platformGroupConfigs.add(element);
- }
- else if (element.getName().equals(PLATFORM_ELEMENT)) {
- platformConfigs.add(element);
- }
- }
- }
-
- for (IConfigurationElement element : platformGroupConfigs) {
- readPlatformGroupExtension(element);
- }
-
- for (IConfigurationElement element : platformConfigs) {
- readPlatformExtension(element);
- }
- }
-
- private void readPlatformGroupExtension(IConfigurationElement element) {
- try {
- final JaxbPlatformGroupDescriptionImpl desc = new JaxbPlatformGroupDescriptionImpl();
-
- // plug-in id
- desc.setPluginId(element.getContributor().getName());
-
- // id
- desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformGroupDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
- throw new XPointException();
- }
-
- // label
- desc.setLabel(findRequiredAttribute(element, LABEL_ATTRIBUTE));
-
- this.platformGroupDescriptions.addItem(desc.getId(), desc);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
- private void readPlatformExtension(IConfigurationElement element) {
- try {
- final JaxbPlatformDescriptionImpl desc = new JaxbPlatformDescriptionImpl();
-
- // plug-in id
- desc.setPluginId(element.getContributor().getName());
-
- // id
- desc.setId(findRequiredAttribute(element, ID_ATTRIBUTE));
-
- if (this.platformDescriptions.containsKey(desc.getId())) {
- logDuplicateExtension(QUALIFIED_EXTENSION_POINT_ID, ID_ATTRIBUTE, desc.getId());
- throw new XPointException();
- }
-
- // label
- desc.setLabel(findRequiredAttribute(element, LABEL_ATTRIBUTE));
-
- // factory class
- desc.setFactoryClassName(findRequiredAttribute(element, FACTORY_CLASS_ATTRIBUTE));
-
- // JAXB facet version
- String jaxbFacetVersionString = element.getAttribute(JAXB_FACET_VERSION_ATTRIBUTE);
- if (jaxbFacetVersionString != null) {
- IProjectFacetVersion jpaFacetVersion = JaxbFacet.FACET.getVersion(jaxbFacetVersionString);
- if (jpaFacetVersion != null) {
- desc.setJaxbFacetVersion(jpaFacetVersion);
- }
- else {
- logInvalidValue(element, JAXB_FACET_VERSION_ATTRIBUTE, jaxbFacetVersionString);
- throw new XPointException();
- }
- }
-
- // default
- String defaultString = element.getAttribute(DEFAULT_ATTRIBUTE);
- if (defaultString != null) {
- if (defaultString.equals("true")) { //$NON-NLS-1$
- desc.setDefault(true);
- }
- else if (defaultString.equals("false")) { //$NON-NLS-1$
- desc.setDefault(false);
- }
- else {
- logInvalidValue(element, DEFAULT_ATTRIBUTE, defaultString);
- throw new XPointException();
- }
- }
-
- // group
- String groupId = element.getAttribute(GROUP_ELEMENT);
- if (groupId != null) {
- JaxbPlatformGroupDescriptionImpl group = this.platformGroupDescriptions.getItem(groupId);
- if (group != null) {
- desc.setGroup(group);
- group.addPlatform(desc);
- }
- else {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
- throw new XPointException();
- }
- }
- else {
- JaxbPlatformGroupDescriptionImpl group = new JaxbPlatformGroupDescriptionImpl();
- group.setPluginId(desc.getPluginId());
- group.setId(desc.getId());
- group.setLabel(desc.getLabel());
- group.addPlatform(desc);
-
- if (this.platformGroupDescriptions.containsKey(group.getId())) {
- logInvalidValue(element, GROUP_ELEMENT, groupId);
- throw new XPointException();
- }
-
- this.platformGroupDescriptions.addItem(group.getId(), group);
- }
-
- this.platformDescriptions.addItem(desc.getId(), desc);
- }
- catch (XPointException e) {
- // Ignore and continue. The problem has already been reported to the user
- // in the log.
- }
- }
-
-
- // ********** public methods **********
-
- public Iterable<JaxbPlatformGroupDescription> getJaxbPlatformGroups() {
- return new SuperIterableWrapper<JaxbPlatformGroupDescription>(this.platformGroupDescriptions.getItemSet());
- }
-
- public JaxbPlatformGroupDescription getJaxbPlatformGroup(String groupId) {
- return this.platformGroupDescriptions.getItem(groupId);
- }
-
- public Iterable<JaxbPlatformDescription> getJaxbPlatforms() {
- return new SuperIterableWrapper<JaxbPlatformDescription>(this.platformDescriptions.getItemSet());
- }
-
- public JaxbPlatformDescription getJaxbPlatform(String platformId) {
- return this.platformDescriptions.getItem(platformId);
- }
-
- public JaxbPlatformDescription getDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion) {
- if (! jaxbFacetVersion.getProjectFacet().equals(JaxbFacet.FACET)) {
- throw new IllegalArgumentException(jaxbFacetVersion.toString());
- }
- for (JaxbPlatformDescription platform : getJaxbPlatforms()) {
- if (platform.isDefault() && platform.supportsJaxbFacetVersion(jaxbFacetVersion)) {
- return platform;
- }
- }
- return null;
- }
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition(IProject project) {
- String jaxbPlatformId = JptJaxbCorePlugin.getJaxbPlatformId(project);
- JaxbPlatformDescriptionImpl platformDesc = this.platformDescriptions.getItem(jaxbPlatformId);
- if (platformDesc == null) {
- throw new IllegalArgumentException("Project does not have a recognized JAXB platform."); //$NON-NLS-1$
- }
- return platformDesc.buildJaxbPlatformDefinition();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
deleted file mode 100644
index 599dc4e1ac..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformTester.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.platform;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-
-/**
- * Property tester for {@link JaxbPlatformDescription}.
- * See <code>org.eclipse.jpt.jaxb.core/plugin.xml</code>
- */
-public class JaxbPlatformTester
- extends PropertyTester
-{
- public static final String JAXB_PLATFORM = "jaxbPlatform"; //$NON-NLS-1$
- public static final String JAXB_PLATFORM_GROUP = "jaxbPlatformGroup"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof JaxbPlatformDescription) {
- return this.test((JaxbPlatformDescription) receiver, property, expectedValue);
- }
- return false;
- }
-
- private boolean test(JaxbPlatformDescription platform, String property, Object expectedValue) {
- if (property.equals(JAXB_PLATFORM)) {
- JaxbPlatformDescription expected = this.getJaxbPlatform(expectedValue);
- return Tools.valuesAreEqual(platform, expected);
- }
- if (property.equals(JAXB_PLATFORM_GROUP)) {
- JaxbPlatformGroupDescription expected = this.getJaxbPlatformGroup(expectedValue);
- return Tools.valuesAreEqual(platform.getGroup(), expected);
- }
- return false;
- }
-
- private JaxbPlatformDescription getJaxbPlatform(Object id) {
- return JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform((String) id);
- }
-
- private JaxbPlatformGroupDescription getJaxbPlatformGroup(Object id) {
- return JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup((String) id);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
deleted file mode 100644
index cdbc71baf4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/prefs/JaxbPreferencesManager.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.prefs;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jpt.jaxb.core.GenericJaxbPlatform;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * JaxbPreferencesManager
- */
-public class JaxbPreferencesManager
-{
- private final IProject project;
-
- private static volatile boolean flushPreferences = true;
-
- // ********** public constants **********
-
- /**
- * The node for storing a JAXB project's platform in the project's preferences.
- */
- protected static final String PLATFORM_PREF_NODE = "platform"; //$NON-NLS-1$
-
- /**
- * The key for storing the platform id
- */
- protected static final String PLATFORM_ID_PREF_KEY = "platform-id"; //$NON-NLS-1$
-
- /**
- * The key for storing the default JAXB platform ID for JAXB 2.1 in the workspace preferences.
- */
- public static final String DEFAULT_JAXB_PLATFORM_2_1_PREF_KEY =
- "defaultJaxbPlatform_" + JaxbFacet.VERSION_2_1.getVersionString(); //$NON-NLS-1$
-
- /**
- * The key for storing the default JAXB platform ID for JAXB 2.2 in the workspace preferences.
- */
- public static final String DEFAULT_JAXB_PLATFORM_2_2_PREF_KEY =
- "defaultJaxbPlatform_" + JaxbFacet.VERSION_2_2.getVersionString(); //$NON-NLS-1$
-
- /**
- * The node for storing a JAXB project's schemas in the project's preferences.
- */
- public static final String SCHEMAS_PREF_NODE = "schemas"; //$NON-NLS-1$
-
- /**
- * The node prefix for storing a particular JAXB project schema in the project's preferences.
- * Specific schema nodes are followed by integers ("schema-1", "schema-2", etc.)
- */
- public static final String SCHEMA_PREF_NODE_PREFIX = "schema-"; //$NON-NLS-1$
-
- /**
- * The key for storing a schema location (such as a uri or catalog key) in the project's preferences
- */
- public static final String SCHEMA_LOCATION_PREF_KEY = "location"; //$NON-NLS-1$
-
-
- // ********** preferences **********
-
- /**
- * Return the Dali preferences for the specified context.
- */
- private static IEclipsePreferences getPreferences(IScopeContext context) {
- return context.getNode(JptJaxbCorePlugin.PLUGIN_ID);
- }
-
- /**
- * Return the Dali preferences for the current workspace instance.
- */
- public static IEclipsePreferences getWorkspacePreferences() {
- return getPreferences(InstanceScope.INSTANCE);
- }
-
- /**
- * Return the default Dali preferences
- * @see JpaPreferenceInitializer
- */
- public static IEclipsePreferences getDefaultPreferences() {
- return getPreferences(DefaultScope.INSTANCE);
- }
-
- // ********** workspace preference **********
-
- public static void setWorkspacePreference(String key, String value) {
- IEclipsePreferences wkspPrefs = getWorkspacePreferences();
- if(value == null) {
- wkspPrefs.remove(key);
- }
- else {
- wkspPrefs.put(key, value);
- }
- flush(wkspPrefs);
- }
-
- // ********** private static methods **********
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * The preferences end up getting flushed after the test case has deleted
- * its project, resulting in resource exceptions in the log, e.g.
- * <pre>
- * Resource '/JpaProjectManagerTests' is not open.
- * </pre>
- * See <code>JptJaxbCoreTestsPlugin.start(BundleContext)</code>
- */
- @SuppressWarnings("unused")
- private static void doNotFlushPreferences() {
- flushPreferences = false;
- }
-
- /**
- * Flush preferences in an asynchronous Job because the flush request will
- * trigger a lock on the project, which can cause us some deadlocks (e.g.
- * when deleting the metamodel source folder).
- * Note: the flush will also remove the prefs node if it is empty
- */
- private static void flush(IEclipsePreferences prefs) {
- if (flushPreferences) {
- new PreferencesFlushJob(prefs).schedule();
- }
- }
-
- private static class PreferencesFlushJob extends Job {
- private final IEclipsePreferences prefs;
- PreferencesFlushJob(IEclipsePreferences prefs) {
- super(NLS.bind(JptJaxbCoreMessages.PREFERENCES_FLUSH_JOB_NAME, prefs.absolutePath()));
- this.prefs = prefs;
- }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- prefs.flush();
- }
- catch(BackingStoreException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- return Status.OK_STATUS;
- }
- }
-
- // ********** implementation **************************************************
-
- public JaxbPreferencesManager(IProject project) {
- if(project == null) {
- throw new RuntimeException("Project is null"); //$NON-NLS-1$
- }
- this.project = project;
- }
-
- // ********** preferences **********
-
- protected Preferences getProjectPreferences() {
- try {
- IFacetedProject fproj = ProjectFacetsManager.create(this.project);
- return fproj.getPreferences(JaxbFacet.FACET);
- }
- catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
- }
- catch (CoreException ce) {
- JptJaxbCorePlugin.log(ce);
- }
- return null;
- }
-
- // ********** getters/setters *********
-
- /**
- * Return the JAXB platform ID associated with the specified Eclipse project.
- */
- public String getJaxbPlatformId() {
- Preferences prefs = this.getProjectPreferences();
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- return platformPrefs.get(PLATFORM_ID_PREF_KEY, GenericJaxbPlatform.VERSION_2_1.getId());
- }
-
- /**
- * Set the {@link JaxbPlatformDescription} associated with the specified Eclipse project.
- */
- public void setJaxbPlatform(JaxbPlatformDescription platform) {
- Preferences prefs = this.getProjectPreferences();
- Preferences platformPrefs = prefs.node(PLATFORM_PREF_NODE);
- platformPrefs.put(PLATFORM_ID_PREF_KEY, platform.getId());
- try {
- platformPrefs.flush();
- }
- catch (BackingStoreException bse) {
- JptJaxbCorePlugin.log(bse);
- }
- }
-
- public List<String> getSchemaLocations() {
- List<String> schemaLocations = new Vector<String>();
- Preferences prefs = this.getProjectPreferences();
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- boolean checkAnotherNode = true;
- for (int i = 1; checkAnotherNode; i++ ) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- if (schemasPrefs.nodeExists(nodeName)) {
- Preferences schemaPrefs = schemasPrefs.node(nodeName);
- String location = schemaPrefs.get(SCHEMA_LOCATION_PREF_KEY, null);
- if (location != null) {
- schemaLocations.add(location);
- }
- }
- else {
- checkAnotherNode = false;
- }
- }
- }
- catch (BackingStoreException bse) {
- // this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
- }
- return schemaLocations;
- }
-
- public void setSchemaLocations(List<String> schemaLocations) {
- Preferences prefs = this.getProjectPreferences();
- Preferences schemasPrefs = prefs.node(SCHEMAS_PREF_NODE);
- try {
- int i = 1;
- for (String location : schemaLocations) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- Preferences schemaPref = schemasPrefs.node(nodeName);
- schemaPref.put(SCHEMA_LOCATION_PREF_KEY, location);
- i ++;
- }
- boolean checkAnotherNode = true;
- for ( ; checkAnotherNode; i++ ) {
- String nodeName = SCHEMA_PREF_NODE_PREFIX + String.valueOf(i);
- if (schemasPrefs.nodeExists(nodeName)) {
- schemasPrefs.node(nodeName).removeNode();
- }
- else {
- checkAnotherNode = false;
- }
- }
- schemasPrefs.flush();
- }
- catch (BackingStoreException bse) {
- // this means that the prefs are corrupted, in which case reading anything is unlikely
- JptJaxbCorePlugin.log(bse);
- }
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
deleted file mode 100644
index 8df576788f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/AbstractJaxbFileResourceModel.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource;
-
-import java.io.BufferedInputStream;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.core.JptResourceModelListener;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-
-public abstract class AbstractJaxbFileResourceModel<S>
- implements JptResourceModel
-{
- protected final IFile file;
-
- /**
- * This is <code>null</code> if there is no package name.
- */
- protected final String packageName;
-
- protected final S state;
-
- protected final ListenerList<JptResourceModelListener> resourceModelListenerList =
- new ListenerList<JptResourceModelListener>(JptResourceModelListener.class);
-
-
- protected AbstractJaxbFileResourceModel(IFile file) {
- super();
- if (file == null) {
- throw new NullPointerException();
- }
- this.file = file;
- this.packageName = this.buildPackageName();
- this.state = this.buildState();
- this.load();
- }
-
- protected String buildPackageName() {
- String pkg = this.buildPackageName_();
- return StringTools.stringIsEmpty(pkg) ? null : pkg;
- }
-
- protected String buildPackageName_() {
- IJavaElement javaElement = JavaCore.create(this.file.getParent());
- if ((javaElement != null) && (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT)) {
- return ((IPackageFragment) javaElement).getElementName();
- }
- return null;
- }
-
- protected abstract S buildState();
-
- public String getPackageName() {
- return this.packageName;
- }
-
- protected void reload() {
- this.load();
- }
-
- protected void load() {
- InputStream stream = null;
- try {
- stream = this.file.getContents();
- if (stream != null) {
- this.load(new BufferedInputStream(stream));
- }
- }
- catch (CoreException ce) {
- // workspace out of sync - no underlying file - simply don't load
- }
- catch (Exception ex) {
- JptJaxbCorePlugin.log(ex);
- }
- finally {
- this.closeStream(stream);
- }
- }
-
- /**
- * The specified stream is not <code>null</code>.
- */
- protected abstract void load(InputStream stream) throws IOException;
-
- protected void closeStream(Closeable stream) {
- try {
- if (stream != null) {
- stream.close();
- }
- } catch (IOException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- public void update() {
- this.reload();
- this.resourceModelChanged();
- }
-
-
- // ********** JptResourceModel implementation **********
-
- public IFile getFile() {
- return this.file;
- }
-
- public void addResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JptResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
- protected void resourceModelChanged() {
- for (JptResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java
deleted file mode 100644
index 84d2402975..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class NullXmlAccessorOrderAnnotation
- extends NullAnnotation
- implements XmlAccessorOrderAnnotation
-{
- protected NullXmlAccessorOrderAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- @Override
- protected XmlAccessorOrderAnnotation addAnnotation() {
- return (XmlAccessorOrderAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlAccessorTOrderAnnotation implementation **********
-
- // ***** value
- public XmlAccessOrder getValue() {
- return null;
- }
-
- public void setValue(XmlAccessOrder value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 18248a0e9b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class NullXmlAccessorTypeAnnotation
- extends NullAnnotation
- implements XmlAccessorTypeAnnotation
-{
- protected NullXmlAccessorTypeAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- @Override
- protected XmlAccessorTypeAnnotation addAnnotation() {
- return (XmlAccessorTypeAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlAccessorTypeAnnotation implementation **********
-
- // ***** value
- public XmlAccessType getValue() {
- return null;
- }
-
- public void setValue(XmlAccessType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
deleted file mode 100644
index 5f22fae013..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class NullXmlEnumAnnotation
- extends NullAnnotation
- implements XmlEnumAnnotation
-{
- protected NullXmlEnumAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- @Override
- protected XmlEnumAnnotation addAnnotation() {
- return (XmlEnumAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public String getFullyQualifiedValueClassName() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
deleted file mode 100644
index ba178b4fda..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class NullXmlEnumValueAnnotation
- extends NullAnnotation
- implements XmlEnumValueAnnotation
-{
- protected NullXmlEnumValueAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- @Override
- protected XmlEnumValueAnnotation addAnnotation() {
- return (XmlEnumValueAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return null;
- }
-
- public void setValue(String value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
deleted file mode 100644
index 7c2cc3bacf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchema
- */
-public final class NullXmlSchemaAnnotation
- extends NullAnnotation
- implements XmlSchemaAnnotation
-{
- protected NullXmlSchemaAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- @Override
- protected XmlSchemaAnnotation addAnnotation() {
- return (XmlSchemaAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlSchemaAnnotation implementation **********
-
- // ***** namespace
-
- public String getNamespace() {
- return null;
- }
-
- public void setNamespace(String namespace) {
- if (namespace != null) {
- this.addAnnotation().setNamespace(namespace);
- }
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** location
-
- public String getLocation() {
- return null;
- }
-
- public void setLocation(String location) {
- if (location != null) {
- this.addAnnotation().setLocation(location);
- }
- }
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public XmlNsForm getAttributeFormDefault() {
- return null;
- }
-
- public void setAttributeFormDefault(XmlNsForm attributeFormDefault) {
- if (attributeFormDefault != null) {
- this.addAnnotation().setAttributeFormDefault(attributeFormDefault);
- }
- }
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public XmlNsForm getElementFormDefault() {
- return null;
- }
-
- public void setElementFormDefault(XmlNsForm elementFormDefault) {
- if (elementFormDefault != null) {
- this.addAnnotation().setElementFormDefault(elementFormDefault);
- }
- }
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public ListIterable<XmlNsAnnotation> getXmlns() {
- return EmptyListIterable.instance();
- }
-
- public int getXmlnsSize() {
- return 0;
- }
-
- public XmlNsAnnotation xmlnsAt(int index) {
- return null;
- }
-
- public XmlNsAnnotation addXmlns(int index) {
- return this.addAnnotation().addXmlns(index);
- }
-
- public void moveXmlns(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlns(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
deleted file mode 100644
index 848b54d55f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class NullXmlTypeAnnotation
- extends NullAnnotation
- implements XmlTypeAnnotation
-{
- protected NullXmlTypeAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- @Override
- protected XmlTypeAnnotation addAnnotation() {
- return (XmlTypeAnnotation) super.addAnnotation();
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factory class
- public String getFactoryClass() {
- return null;
- }
-
- public String getFullyQualifiedFactoryClassName() {
- return null;
- }
-
- public void setFactoryClass(String factoryClass) {
- if (factoryClass != null) {
- this.addAnnotation().setFactoryClass(factoryClass);
- }
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** factory method
- public String getFactoryMethod() {
- return null;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- if (factoryMethod != null) {
- this.addAnnotation().setFactoryMethod(factoryMethod);
- }
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** name
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
- if (name != null) {
- this.addAnnotation().setName(name);
- }
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return null;
- }
-
- public void setNamespace(String namespace) {
- if (namespace != null) {
- this.addAnnotation().setNamespace(namespace);
- }
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- public ListIterable<String> getPropOrder() {
- return EmptyListIterable.instance();
- }
-
- public int getPropOrderSize() {
- return 0;
- }
-
- public void addProp(int index, String prop) {
- this.addAnnotation().addProp(index, prop);
- }
-
- public void addProp(String prop) {
- this.addAnnotation().addProp(prop);
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(String prop) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return null;
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
deleted file mode 100644
index e36e86637d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class XmlAccessorOrderAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAccessorOrderAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAccessorOrderAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAccessorOrderAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlAccessorOrderAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAccessorOrderAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
deleted file mode 100644
index ef3bea4831..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class XmlAccessorTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAccessorTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAccessorTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAccessorTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlAccessorTypeAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAccessorTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
deleted file mode 100644
index 2156137c02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class XmlAnyAttributeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAnyAttributeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAnyAttributeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyAttributeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyAttributeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
deleted file mode 100644
index 19fe6dfbb0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class XmlAnyElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAnyElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAnyElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyElementAnnotation(parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
deleted file mode 100644
index e457919225..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Attribute;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttachmentRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class XmlAttachmentRefAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAttachmentRefAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAttachmentRefAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttachmentRefAnnotation(parent, (Attribute) annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttachmentRefAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
deleted file mode 100644
index 7b4020e09f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttributeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class XmlAttributeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlAttributeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlAttributeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttributeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttributeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
deleted file mode 100644
index 47928a5ec7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class XmlElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementAnnotation.buildSourceXmlElementAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
deleted file mode 100644
index cfabd0c30f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class XmlElementDeclAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementDeclAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementDeclAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementDeclAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementDeclAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
deleted file mode 100644
index 742aa7d549..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class XmlElementRefAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementRefAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return SourceXmlElementRefAnnotation.buildSourceXmlElementRefAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
deleted file mode 100644
index c76018b384..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class XmlElementRefsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementRefsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementRefsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementRefsAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefsAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
deleted file mode 100644
index d36abe649d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class XmlElementWrapperAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementWrapperAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementWrapperAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementWrapperAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementWrapperAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
deleted file mode 100644
index 5b070a57cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class XmlElementsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlElementsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlElementsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementsAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementsAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
deleted file mode 100644
index ec80a4c62b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class XmlEnumAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlEnumAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlEnumAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
deleted file mode 100644
index 39a765fcec..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class XmlEnumValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlEnumValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlEnumValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlEnumValueAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
deleted file mode 100644
index 4f7b595d89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class XmlIDAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlIDAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlIDAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
deleted file mode 100644
index 99512ab4dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class XmlIDREFAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlIDREFAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlIDREFAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDREFAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDREFAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
deleted file mode 100644
index afcee0493a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlInlineBinaryDataAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryData
- */
-public final class XmlInlineBinaryDataAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlInlineBinaryDataAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlInlineBinaryDataAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInlineBinaryDataAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInlineBinaryDataAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
deleted file mode 100644
index 1e7751e87d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapterAnnotation
- */
-public final class XmlJavaTypeAdapterAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlJavaTypeAdapterAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlJavaTypeAdapterAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS;
- }
-
- public String getElementName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlJavaTypeAdapterAnnotation.buildSourceXmlJavaTypeAdapterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryXmlJavaTypeAdapterAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
deleted file mode 100644
index adef72670c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdaptersAnnotation
- */
-public final class XmlJavaTypeAdaptersAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlJavaTypeAdaptersAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private XmlJavaTypeAdaptersAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTERS;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
deleted file mode 100644
index 38fdba5caa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlListAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class XmlListAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlListAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlListAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlListAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlListAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
deleted file mode 100644
index ec395f8a50..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMimeTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class XmlMimeTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlMimeTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlMimeTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMimeTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMimeTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
deleted file mode 100644
index 3d5bd69be6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class XmlMixedAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlMixedAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlMixedAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMixedAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMixedAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
deleted file mode 100644
index d0b3fba4a3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRegistryAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRegistryAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class XmlRegistryAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlRegistryAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlRegistryAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRegistryAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRegistryAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
deleted file mode 100644
index 58370c5fe8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class XmlRootElementAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlRootElementAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlRootElementAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRootElementAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRootElementAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
deleted file mode 100644
index 9688c0dea1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlSchema
- */
-public class XmlSchemaAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSchemaAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSchemaAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSchemaAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlSchemaAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- // TODO
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
deleted file mode 100644
index 6fb9f98ae2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class XmlSchemaTypeAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlSchemaTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- private XmlSchemaTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return JAXB.XML_SCHEMA_TYPE;
- }
-
- public String getContainerAnnotationName() {
- return JAXB.XML_SCHEMA_TYPES;
- }
-
- public String getElementName() {
- return JAXB.XML_SCHEMA_TYPES__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlSchemaTypeAnnotation.buildSourceXmlSchemaTypeAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
deleted file mode 100644
index c2c195e18a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdaptersAnnotation
- */
-public final class XmlSchemaTypesAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSchemaTypesAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSchemaTypesAnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA_TYPES;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
deleted file mode 100644
index 65e9d6b490..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class XmlSeeAlsoAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlSeeAlsoAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlSeeAlsoAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSeeAlsoAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlSeeAlsoAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
deleted file mode 100644
index b273019abe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTransientAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class XmlTransientAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTransientAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTransientAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransientAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransientAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
deleted file mode 100644
index db0e7b5cfe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class XmlTypeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTypeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTypeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTypeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullXmlTypeAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTypeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
deleted file mode 100644
index 6339a90745..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlValueAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class XmlValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
deleted file mode 100644
index f686d90601..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class BinaryXmlAccessorOrderAnnotation
- extends BinaryAnnotation
- implements XmlAccessorOrderAnnotation
-{
- private XmlAccessOrder value;
-
-
- public BinaryXmlAccessorOrderAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- //*************** XmlAccessorOrderAnnotation implementation ****************
-
- // ***** value
- public XmlAccessOrder getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessOrder value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(XmlAccessOrder value) {
- XmlAccessOrder old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private XmlAccessOrder buildValue() {
- return XmlAccessOrder.fromJavaAnnotationValue(this.getJdtMemberValue(JAXB.XML_ACCESSOR_ORDER__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 363b4a4fad..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class BinaryXmlAccessorTypeAnnotation
- extends BinaryAnnotation
- implements XmlAccessorTypeAnnotation
-{
- private XmlAccessType value;
-
-
- public BinaryXmlAccessorTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- //*************** XmlAccessorTypeAnnotation implementation ****************
-
- // ***** value
- public XmlAccessType getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(XmlAccessType value) {
- XmlAccessType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private XmlAccessType buildValue() {
- return XmlAccessType.fromJavaAnnotationValue(this.getJdtMemberValue(JAXB.XML_ACCESSOR_TYPE__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java
deleted file mode 100644
index 06a7961529..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class BinaryXmlAnyAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAnyAttributeAnnotation
-{
-
- public BinaryXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
deleted file mode 100644
index 0410afb97e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class BinaryXmlAnyElementAnnotation
- extends BinaryAnnotation
- implements XmlAnyElementAnnotation
-{
- private Boolean lax;
- private String value;
-
-
- public BinaryXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.lax = this.buildLax();
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setLax_(this.buildLax());
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlAnyElementAnnotation implementation **********
-
- // ***** lax
- public Boolean getLax() {
- return this.lax;
- }
-
- public void setLax(Boolean lax) {
- throw new UnsupportedOperationException();
- }
-
- private void setLax_(Boolean lax) {
- Boolean old = this.lax;
- this.lax = lax;
- this.firePropertyChanged(LAX_PROPERTY, old, lax);
- }
-
- private Boolean buildLax() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ANY_ELEMENT__LAX);
- }
-
- public TextRange getLaxTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ANY_ELEMENT__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.value;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java
deleted file mode 100644
index 610dce8c81..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class BinaryXmlAttachmentRefAnnotation
- extends BinaryAnnotation
- implements XmlAttachmentRefAnnotation
-{
-
- public BinaryXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
deleted file mode 100644
index 520efc7917..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class BinaryXmlAttributeAnnotation
- extends BinaryAnnotation
- implements XmlAttributeAnnotation
-{
- private String name;
- private String namespace;
- private Boolean required;
-
-
- public BinaryXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setRequired_(this.buildRequired());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlAttributeAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ATTRIBUTE__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
deleted file mode 100644
index 72721b7d45..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class BinaryXmlElementAnnotation
- extends BinaryAnnotation
- implements XmlElementAnnotation
-{
- private String name;
- private String namespace;
- private String defaultValue;
- private Boolean nillable;
- private Boolean required;
- private String type;
-
-
- public BinaryXmlElementAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.defaultValue = this.buildDefaultValue();
- this.nillable = this.buildNillable();
- this.required = this.buildRequired();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setDefaultValue_(this.buildDefaultValue());
- this.setNillable_(this.buildNillable());
- this.setRequired_(this.buildRequired());
- this.setType_(this.buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** default value
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- private String buildDefaultValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNillable_(Boolean nillable) {
- Boolean old = this.nillable;
- this.nillable = nillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, nillable);
- }
-
- private Boolean buildNillable() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__NILLABLE);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.type;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
deleted file mode 100644
index bf1be28daf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class BinaryXmlElementDeclAnnotation
- extends BinaryAnnotation
- implements XmlElementDeclAnnotation {
-
- private String scope;
- private String namespace;
- private String name;
- private String substitutionHeadNamespace;
- private String substitutionHeadName;
- private String defaultValue;
-
-
- public BinaryXmlElementDeclAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.scope = buildScope();
- this.namespace = buildNamespace();
- this.name = buildName();
- this.substitutionHeadNamespace = buildSubstitutionHeadNamespace();
- this.substitutionHeadName = buildSubstitutionHeadName();
- this.defaultValue = buildDefaultValue();
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- @Override
- public void update() {
- super.update();
- setScope_(buildScope());
- setNamespace_(buildNamespace());
- setName_(buildName());
- setSubstitutionHeadNamespace_(buildSubstitutionHeadNamespace());
- setSubstitutionHeadName_(buildSubstitutionHeadName());
- setDefaultValue_(buildDefaultValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- throw new UnsupportedOperationException();
- }
-
- private void setScope_(String scope) {
- String old = this.scope;
- this.scope = scope;
- firePropertyChanged(SCOPE_PROPERTY, old, scope);
- firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, scope);
- }
-
- private String buildScope() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SCOPE);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedScopeClassName() {
- return this.scope;
- }
-
-
- // ***** substitutionHeadNamespace *****
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setSubstitutionHeadNamespace_(String substitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, substitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** substitutionHeadName *****
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- throw new UnsupportedOperationException();
- }
-
- private void setSubstitutionHeadName_(String substitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = substitutionHeadName;
- firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, substitutionHeadName);
- }
-
- private String buildSubstitutionHeadName() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** default value *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultValue_(String defaultValue) {
- String old = this.defaultValue;
- this.defaultValue = defaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, defaultValue);
- }
-
- private String buildDefaultValue() {
- return (String) getJdtMemberValue(JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
deleted file mode 100644
index 2a07f8ce03..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class BinaryXmlElementRefAnnotation
- extends BinaryAnnotation
- implements XmlElementRefAnnotation
-{
- private String name;
- private String namespace;
- private Boolean required;
- private String type;
-
-
- public BinaryXmlElementRefAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.required = this.buildRequired();
- this.type = this.buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setRequired_(this.buildRequired());
- this.setType_(this.buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementRefAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_REF__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.type;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java
deleted file mode 100644
index 7f6ab4b505..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-
-public class BinaryXmlElementRefsAnnotation
- extends BinaryAnnotation
- implements XmlElementRefsAnnotation {
-
- private final Vector<XmlElementRefAnnotation> xmlElementRefs;
-
-
- public BinaryXmlElementRefsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlElementRefs = this.buildXmlElementRefs();
- }
-
-
- private Vector<XmlElementRefAnnotation> buildXmlElementRefs() {
- Object[] jdtXmlElementRefs = this.getJdtMemberValues(JAXB.XML_ELEMENT_REFS__VALUE);
- Vector<XmlElementRefAnnotation> result = new Vector<XmlElementRefAnnotation>(jdtXmlElementRefs.length);
- for (Object jdtXmlElementRef : jdtXmlElementRefs) {
- result.add(new BinaryXmlElementRefAnnotation(this, (IAnnotation) jdtXmlElementRef));
- }
- return result;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() {
- return new LiveCloneListIterable<XmlElementRefAnnotation>(this.xmlElementRefs);
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefs.size();
- }
-
- public XmlElementRefAnnotation xmlElementRefAt(int index) {
- return this.xmlElementRefs.elementAt(index);
- }
-
- public XmlElementRefAnnotation addXmlElementRef(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlElementRef(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
deleted file mode 100644
index 344734465c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class BinaryXmlElementWrapperAnnotation
- extends BinaryAnnotation
- implements XmlElementWrapperAnnotation
-{
- private String name;
- private String namespace;
- private Boolean nillable;
- private Boolean required;
-
-
- public BinaryXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.nillable = this.buildNillable();
- this.required = this.buildRequired();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- this.setNillable_(this.buildNillable());
- this.setRequired_(this.buildRequired());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementWrapperAnnotation implementation **********
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNillable_(Boolean nillable) {
- Boolean old = this.nillable;
- this.nillable = nillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, nillable);
- }
-
- private Boolean buildNillable() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- throw new UnsupportedOperationException();
- }
-
- private void setRequired_(Boolean required) {
- Boolean old = this.required;
- this.required = required;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, required);
- }
-
- private Boolean buildRequired() {
- return (Boolean) this.getJdtMemberValue(JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java
deleted file mode 100644
index 47d6f1d24c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElements
- */
-public final class BinaryXmlElementsAnnotation
- extends BinaryAnnotation
- implements XmlElementsAnnotation
-{
- private final Vector<XmlElementAnnotation> xmlElements;
-
-
- public BinaryXmlElementsAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlElements = this.buildXmlElements();
- }
-
- private Vector<XmlElementAnnotation> buildXmlElements() {
- Object[] jdtXmlElements = this.getJdtMemberValues(JAXB.XML_ELEMENTS__VALUE);
- Vector<XmlElementAnnotation> result = new Vector<XmlElementAnnotation>(jdtXmlElements.length);
- for (Object jdtXmlElement : jdtXmlElements) {
- result.add(new BinaryXmlElementAnnotation(this, (IAnnotation) jdtXmlElement));
- }
- return result;
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public ListIterable<XmlElementAnnotation> getXmlElements() {
- return new LiveCloneListIterable<XmlElementAnnotation>(this.xmlElements);
- }
-
- public int getXmlElementsSize() {
- return this.xmlElements.size();
- }
-
- public XmlElementAnnotation xmlElementAt(int index) {
- return this.xmlElements.elementAt(index);
- }
-
- public XmlElementAnnotation addXmlElement(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeXmlElement(int index) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
deleted file mode 100644
index eaaff3cf5a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class BinaryXmlEnumAnnotation
- extends BinaryAnnotation
- implements XmlEnumAnnotation
-{
- private String value;
-
-
- public BinaryXmlEnumAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnum implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ENUM__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.value;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
deleted file mode 100644
index 53cc480a86..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class BinaryXmlEnumValueAnnotation
- extends BinaryAnnotation
- implements XmlEnumValueAnnotation
-{
-
- private String value;
-
- public BinaryXmlEnumValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_ENUM_VALUE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java
deleted file mode 100644
index e40dfa1388..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class BinaryXmlIDAnnotation
- extends BinaryAnnotation
- implements XmlIDAnnotation
-{
-
- public BinaryXmlIDAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java
deleted file mode 100644
index f98361154f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class BinaryXmlIDREFAnnotation
- extends BinaryAnnotation
- implements XmlIDREFAnnotation
-{
-
- public BinaryXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index 02a5486214..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class BinaryXmlInlineBinaryDataAnnotation
- extends BinaryAnnotation
- implements XmlInlineBinaryDataAnnotation {
-
- public BinaryXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 70bdd6bec8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class BinaryXmlJavaTypeAdapterAnnotation
- extends BinaryAnnotation
- implements XmlJavaTypeAdapterAnnotation {
-
- private String value;
-
- private String type;
-
-
- public BinaryXmlJavaTypeAdapterAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = buildValue();
- this.type = buildType();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- @Override
- public void update() {
- super.update();
- setValue_(buildValue());
- setType_(buildType());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlJavaTypeAdapterAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedValue() {
- return this.value;
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(String type) {
- String old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, type);
- }
-
- private String buildType() {
- return (String) this.getJdtMemberValue(JAXB.XML_JAVA_TYPE_ADAPTER__TYPE);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getFullyQualifiedType() {
- return this.type;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java
deleted file mode 100644
index 1b3f952590..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class BinaryXmlListAnnotation
- extends BinaryAnnotation
- implements XmlListAnnotation {
-
- public BinaryXmlListAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java
deleted file mode 100644
index a925f2d5b6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class BinaryXmlMimeTypeAnnotation
- extends BinaryAnnotation
- implements XmlMimeTypeAnnotation
-{
-
- private String value;
-
- public BinaryXmlMimeTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** XmlMimeTypeAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JAXB.XML_MIME_TYPE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java
deleted file mode 100644
index 618d56348b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class BinaryXmlMixedAnnotation
- extends BinaryAnnotation
- implements XmlMixedAnnotation {
-
- public BinaryXmlMixedAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java
deleted file mode 100644
index 30c963fa17..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class BinaryXmlRegistryAnnotation
- extends BinaryAnnotation
- implements XmlRegistryAnnotation
-{
-
- public BinaryXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
deleted file mode 100644
index ac2e6159fd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class BinaryXmlRootElementAnnotation
- extends BinaryAnnotation
- implements XmlRootElementAnnotation
-{
- private String name;
- private String namespace;
-
-
- public BinaryXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlRootElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_ROOT_ELEMENT__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java
deleted file mode 100644
index ce0b09154e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class BinaryXmlSeeAlsoAnnotation
- extends BinaryAnnotation
- implements XmlSeeAlsoAnnotation {
-
- private final Vector<String> classes;
-
-
- public BinaryXmlSeeAlsoAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.classes = this.buildClasses();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateClasses();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classes);
- }
-
-
- // ********** XmlSeeAlsoAnnotation implementation **********
-
- // ***** value
- public ListIterable<String> getClasses() {
- return new LiveCloneListIterable<String>(this.classes);
- }
-
- public int getClassesSize() {
- return this.classes.size();
- }
-
- private Vector<String> buildClasses() {
- Object[] jdtClasses = this.getJdtMemberValues(JAXB.XML_SEE_ALSO__VALUE);
- Vector<String> result = new Vector<String>(jdtClasses.length);
- for (Object jdtClass : jdtClasses) {
- result.add((String) jdtClass);
- }
- return result;
- }
-
- public void addClass(String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void addClass(int index, String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeClass(String clazz) {
- throw new UnsupportedOperationException();
- }
-
- public void removeClass(int index) {
- throw new UnsupportedOperationException();
- }
-
- public ListIterable<String> getFullyQualifiedClasses() {
- return getClasses();
- }
-
- // TODO
- private void updateClasses() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java
deleted file mode 100644
index 57371ddb14..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class BinaryXmlTransientAnnotation
- extends BinaryAnnotation
- implements XmlTransientAnnotation
-{
-
- public BinaryXmlTransientAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
deleted file mode 100644
index a2d08f7f2c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class BinaryXmlTypeAnnotation
- extends BinaryAnnotation
- implements XmlTypeAnnotation
-{
- private String factoryClass;
- private String factoryMethod;
- private String name;
- private String namespace;
- private final Vector<String> propOrder;
-
-
- public BinaryXmlTypeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.factoryClass = this.buildFactoryClass();
- this.factoryMethod = this.buildFactoryMethod();
- this.name = this.buildName();
- this.namespace = this.buildNamespace();
- this.propOrder = this.buildPropOrder();
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- @Override
- public void update() {
- super.update();
- this.setFactoryClass_(this.buildFactoryClass());
- this.setFactoryMethod_(this.buildFactoryMethod());
- this.setName_(this.buildName());
- this.setNamespace_(this.buildNamespace());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factoryClass
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setFactoryClass_(String factoryClass) {
- String old = this.factoryClass;
- this.factoryClass = factoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, factoryClass);
- this.firePropertyChanged(FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY, old, factoryClass);
- }
-
- private String buildFactoryClass() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_CLASS);
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified factory class name
- public String getFullyQualifiedFactoryClassName() {
- return this.factoryClass;
- }
-
- // ***** factoryMethod
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- throw new UnsupportedOperationException();
- }
-
- private void setFactoryMethod_(String factoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = factoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, factoryMethod);
- }
-
- private String buildFactoryMethod() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__FACTORY_METHOD);
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- throw new UnsupportedOperationException();
- }
-
- private void setNamespace_(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- private String buildNamespace() {
- return (String) this.getJdtMemberValue(JAXB.XML_TYPE__NAMESPACE);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** prop order
- public ListIterable<String> getPropOrder() {
- return new LiveCloneListIterable<String>(this.propOrder);
- }
-
- public int getPropOrderSize() {
- return this.propOrder.size();
- }
-
- private Vector<String> buildPropOrder() {
- Object[] jdtPropOrder = this.getJdtMemberValues(JAXB.XML_TYPE__PROP_ORDER);
- Vector<String> result = new Vector<String>(jdtPropOrder.length);
- for (Object jdtProp : jdtPropOrder) {
- result.add((String) jdtProp);
- }
- return result;
- }
-
- public void addProp(String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void addProp(int index, String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(String propOrder) {
- throw new UnsupportedOperationException();
- }
-
- public void removeProp(int index) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java
deleted file mode 100644
index d619f38f2d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class BinaryXmlValueAnnotation
- extends BinaryAnnotation
- implements XmlValueAnnotation
-{
-
- public BinaryXmlValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java
deleted file mode 100644
index 5ae3119058..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorOrder
- */
-public final class SourceXmlAccessorOrderAnnotation
- extends SourceAnnotation
- implements XmlAccessorOrderAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_ORDER);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private XmlAccessOrder value;
-
-
- public SourceXmlAccessorOrderAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(annotatedElement, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_ORDER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- //*************** XmlAccessorOrderAnnotation implementation ****************
-
- // ***** value
- public XmlAccessOrder getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessOrder value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(XmlAccessOrder.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(XmlAccessOrder astValue) {
- XmlAccessOrder old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private XmlAccessOrder buildValue(CompilationUnit astRoot) {
- return XmlAccessOrder.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- //remove the XmlAccessorOrder annotation when the value element is removed.
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ACCESSOR_ORDER__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java
deleted file mode 100644
index 1c3b0bbd08..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAccessorType
- */
-public final class SourceXmlAccessorTypeAnnotation
- extends SourceAnnotation
- implements XmlAccessorTypeAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private XmlAccessType value;
-
-
- public SourceXmlAccessorTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(annotatedElement, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ACCESSOR_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- //*************** XmlAccessorTypeAnnotation implementation ****************
-
- // ***** value
- public XmlAccessType getValue() {
- return this.value;
- }
-
- public void setValue(XmlAccessType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(XmlAccessType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(XmlAccessType astValue) {
- XmlAccessType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private XmlAccessType buildValue(CompilationUnit astRoot) {
- return XmlAccessType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- //remove the XmlAccessorType annotation when the value element is removed.
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ACCESSOR_TYPE__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java
deleted file mode 100644
index 0a70fa9786..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyAttribute
- */
-public final class SourceXmlAnyAttributeAnnotation
- extends SourceAnnotation
- implements XmlAnyAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ATTRIBUTE);
-
- public SourceXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ATTRIBUTE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
deleted file mode 100644
index 43e13bcd7d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAnyElement
- */
-public final class SourceXmlAnyElementAnnotation
- extends SourceAnnotation
- implements XmlAnyElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ELEMENT);
-
- private final DeclarationAnnotationElementAdapter<Boolean> laxDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> laxAdapter;
- private Boolean lax;
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private String fullyQualifiedValueClassName;
-
-
- // ********** constructors **********
- public SourceXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAnyElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.laxDeclarationAdapter = this.buildLaxAdapter(daa);
- this.laxAdapter = this.buildShortCircuitBooleanElementAdapter(this.laxDeclarationAdapter);
- this.valueDeclarationAdapter = this.buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildLaxAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ANY_ELEMENT__LAX);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_ANY_ELEMENT__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ANY_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.lax = this.buildLax(astRoot);
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncLax(this.buildLax(astRoot));
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlAnyElementAnnotation implementation **********
-
- // ***** lax
- public Boolean getLax() {
- return this.lax;
- }
-
- public void setLax(Boolean lax) {
- if (this.attributeValueHasChanged(this.lax, lax)) {
- this.lax = lax;
- this.laxAdapter.setValue(lax);
- }
- }
-
- private void syncLax(Boolean astLax) {
- Boolean old = this.lax;
- this.lax = astLax;
- this.firePropertyChanged(LAX_PROPERTY, old, astLax);
- }
-
- private Boolean buildLax(CompilationUnit astRoot) {
- return this.laxAdapter.getValue(astRoot);
- }
-
- public TextRange getLaxTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.laxDeclarationAdapter, astRoot);
- }
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
- }
-
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java
deleted file mode 100644
index aeaddd91d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttachmentRef
- */
-public final class SourceXmlAttachmentRefAnnotation
- extends SourceAnnotation
- implements XmlAttachmentRefAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTACHMENT_REF);
-
- public SourceXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTACHMENT_REF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
deleted file mode 100644
index 43d942ec92..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlAttribute
- */
-public final class SourceXmlAttributeAnnotation
- extends SourceAnnotation
- implements XmlAttributeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTRIBUTE);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
-
- // ********** constructors **********
- public SourceXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ATTRIBUTE__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ATTRIBUTE__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ATTRIBUTE__REQUIRED);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ATTRIBUTE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.required = this.buildRequired(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlAttributeAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
deleted file mode 100644
index 5cb7f6007b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElement
- */
-public final class SourceXmlElementAnnotation
- extends SourceAnnotation
- implements XmlElementAnnotation {
-
- private static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT);
-
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nillableAdapter;
- private Boolean nillable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
- private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedTypeName;
-
-
- public static SourceXmlElementAnnotation buildSourceXmlElementAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement) {
-
- return new SourceXmlElementAnnotation(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementAnnotation buildNestedSourceXmlElementAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceXmlElementAnnotation(parent, annotatedElement, idaa);
- }
-
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- private SourceXmlElementAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- }
-
- private SourceXmlElementAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa,
- AnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nillableDeclarationAdapter = this.buildNillableAdapter(daa);
- this.nillableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nillableDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- this.defaultValueDeclarationAdapter = this.buildDefaultValueAdapter(daa);
- this.defaultValueAdapter = this.buildAnnotationElementAdapter(this.defaultValueDeclarationAdapter);
- this.typeDeclarationAdapter = this.buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNillableAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT__NILLABLE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT__REQUIRED);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultValueAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT__DEFAULT_VALUE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_ELEMENT__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.nillable = this.buildNillable(astRoot);
- this.required = this.buildRequired(astRoot);
- this.defaultValue = this.buildDefaultValue(astRoot);
- this.type = this.buildType(astRoot);
- this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncNillable(this.buildNillable(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- this.syncDefaultValue(this.buildDefaultValue(astRoot));
- this.syncType(this.buildType(astRoot));
- this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- if (this.attributeValueHasChanged(this.nillable, nillable)) {
- this.nillable = nillable;
- this.nillableAdapter.setValue(nillable);
- }
- }
-
- private void syncNillable(Boolean astNillable) {
- Boolean old = this.nillable;
- this.nillable = astNillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, astNillable);
- }
-
- private Boolean buildNillable(CompilationUnit astRoot) {
- return this.nillableAdapter.getValue(astRoot);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-
- // ***** defaultValue
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (this.attributeValueHasChanged(this.defaultValue, defaultValue)) {
- this.defaultValue = defaultValue;
- this.defaultValueAdapter.setValue(defaultValue);
- }
- }
-
- private void syncDefaultValue(String astDefaultValue) {
- String old = this.defaultValue;
- this.defaultValue = astDefaultValue;
- this.firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, astDefaultValue);
- }
-
- private String buildDefaultValue(CompilationUnit astRoot) {
- return this.defaultValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.fullyQualifiedTypeName;
- }
-
- private void syncFullyQualifiedTypeName(String name) {
- String old = this.fullyQualifiedTypeName;
- this.fullyQualifiedTypeName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTypeName(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
deleted file mode 100644
index 92745cb0f9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementDecl
- */
-public final class SourceXmlElementDeclAnnotation
- extends SourceAnnotation
- implements XmlElementDeclAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_DECL);
-
- private final DeclarationAnnotationElementAdapter<String> scopeDeclarationAdapter;
- private final AnnotationElementAdapter<String> scopeAdapter;
- private String scope;
- private String fullyQualifiedScopeClassName;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> substitutionHeadNamespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> substitutionHeadNamespaceAdapter;
- private String substitutionHeadNamespace;
-
- private final DeclarationAnnotationElementAdapter<String> substitutionHeadNameDeclarationAdapter;
- private final AnnotationElementAdapter<String> substitutionHeadNameAdapter;
- private String substitutionHeadName;
-
- private final DeclarationAnnotationElementAdapter<String> defaultValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultValueAdapter;
- private String defaultValue;
-
-
- // ********** constructors **********
-
- public SourceXmlElementDeclAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- this.scopeDeclarationAdapter = buildScopeDeclarationAdapter();
- this.scopeAdapter = buildAnnotationElementAdapter(this.scopeDeclarationAdapter);
- this.namespaceDeclarationAdapter = buildNamespaceDeclarationAdapter();
- this.namespaceAdapter = buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nameDeclarationAdapter = buildNameDeclarationAdapter();
- this.nameAdapter = buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.substitutionHeadNamespaceDeclarationAdapter = buildSubstitutionHeadNamespaceDeclarationAdapter();
- this.substitutionHeadNamespaceAdapter = buildAnnotationElementAdapter(this.substitutionHeadNamespaceDeclarationAdapter);
- this.substitutionHeadNameDeclarationAdapter = buildSubstitutionHeadNameDeclarationAdapter();
- this.substitutionHeadNameAdapter = buildAnnotationElementAdapter(this.substitutionHeadNameDeclarationAdapter);
- this.defaultValueDeclarationAdapter = buildDefaultValueDeclarationAdapter();
- this.defaultValueAdapter = buildAnnotationElementAdapter(this.defaultValueDeclarationAdapter);
- }
-
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildScopeDeclarationAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SCOPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildSubstitutionHeadNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_DECL;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.scope = buildScope(astRoot);
- this.fullyQualifiedScopeClassName = buildFullyQualifiedScopeClassName(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.name = buildName(astRoot);
- this.substitutionHeadNamespace = buildSubstitutionHeadNamespace(astRoot);
- this.substitutionHeadName = buildSubstitutionHeadName(astRoot);
- this.defaultValue = buildDefaultValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncScope(buildScope(astRoot));
- syncFullyQualifiedScopeClassName(buildFullyQualifiedScopeClassName(astRoot));
- syncNamespace(buildNamespace(astRoot));
- syncName(buildName(astRoot));
- syncSubstitutionHeadNamespace(buildSubstitutionHeadNamespace(astRoot));
- syncSubstitutionHeadName(buildSubstitutionHeadName(astRoot));
- syncDefaultValue(buildDefaultValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ***** scope *****
-
- public String getScope() {
- return this.scope;
- }
-
- public void setScope(String scope) {
- if (attributeValueHasChanged(this.scope, scope)) {
- this.scope = scope;
- this.scopeAdapter.setValue(scope);
- }
- }
-
- private void syncScope(String astScope) {
- String old = this.scope;
- this.scope = astScope;
- firePropertyChanged(SCOPE_PROPERTY, old, astScope);
- }
-
- private String buildScope(CompilationUnit astRoot) {
- return this.scopeAdapter.getValue(astRoot);
- }
-
- public TextRange getScopeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.scopeDeclarationAdapter, astRoot);
- }
-
-
- // ***** fully-qualified scope class name *****
-
- public String getFullyQualifiedScopeClassName() {
- return this.fullyQualifiedScopeClassName;
- }
-
- private void syncFullyQualifiedScopeClassName(String name) {
- String old = this.fullyQualifiedScopeClassName;
- this.fullyQualifiedScopeClassName = name;
- firePropertyChanged(FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedScopeClassName(CompilationUnit astRoot) {
- return (this.scope == null) ? null : ASTTools.resolveFullyQualifiedName(this.scopeAdapter.getExpression(astRoot));
- }
-
-
- // ***** namespace *****
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** name *****
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** substitutionHeadNamespace *****
-
- public String getSubstitutionHeadNamespace() {
- return this.substitutionHeadNamespace;
- }
-
- public void setSubstitutionHeadNamespace(String substitutionHeadNamespace) {
- if (attributeValueHasChanged(this.substitutionHeadNamespace, substitutionHeadNamespace)) {
- this.substitutionHeadNamespace = substitutionHeadNamespace;
- this.substitutionHeadNamespaceAdapter.setValue(substitutionHeadNamespace);
- }
- }
-
- private void syncSubstitutionHeadNamespace(String astSubstitutionHeadNamespace) {
- String old = this.substitutionHeadNamespace;
- this.substitutionHeadNamespace = astSubstitutionHeadNamespace;
- firePropertyChanged(SUBSTITUTION_HEAD_NAMESPACE_PROPERTY, old, astSubstitutionHeadNamespace);
- }
-
- private String buildSubstitutionHeadNamespace(CompilationUnit astRoot) {
- return this.substitutionHeadNamespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNamespaceDeclarationAdapter, astRoot);
- }
-
- public boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNamespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** substitutionHeadName *****
-
- public String getSubstitutionHeadName() {
- return this.substitutionHeadName;
- }
-
- public void setSubstitutionHeadName(String substitutionHeadName) {
- if (attributeValueHasChanged(this.substitutionHeadName, substitutionHeadName)) {
- this.substitutionHeadName = substitutionHeadName;
- this.substitutionHeadNameAdapter.setValue(substitutionHeadName);
- }
- }
-
- private void syncSubstitutionHeadName(String astSubstitutionHeadName) {
- String old = this.substitutionHeadName;
- this.substitutionHeadName = astSubstitutionHeadName;
- firePropertyChanged(SUBSTITUTION_HEAD_NAME_PROPERTY, old, astSubstitutionHeadName);
- }
-
- private String buildSubstitutionHeadName(CompilationUnit astRoot) {
- return this.substitutionHeadNameAdapter.getValue(astRoot);
- }
-
- public TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.substitutionHeadNameDeclarationAdapter, astRoot);
- }
-
- public boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.substitutionHeadNameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** defaultValue *****
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- if (attributeValueHasChanged(this.defaultValue, defaultValue)) {
- this.defaultValue = defaultValue;
- this.defaultValueAdapter.setValue(defaultValue);
- }
- }
-
- private void syncDefaultValue(String astDefaultValue) {
- String old = this.defaultValue;
- this.defaultValue = astDefaultValue;
- firePropertyChanged(DEFAULT_VALUE_PROPERTY, old, astDefaultValue);
- }
-
- private String buildDefaultValue(CompilationUnit astRoot) {
- return this.defaultValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultValueTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.defaultValueDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
deleted file mode 100644
index ac108d4d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRef
- */
-public final class SourceXmlElementRefAnnotation
- extends SourceAnnotation
- implements XmlElementRefAnnotation {
-
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REF);
-
-
- private String fullyQualifiedTypeName;
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
-
-
- public static SourceXmlElementRefAnnotation buildSourceXmlElementRefAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement) {
-
- return new SourceXmlElementRefAnnotation(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceXmlElementRefAnnotation buildNestedSourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceXmlElementRefAnnotation(parent, annotatedElement, idaa);
- }
-
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa) {
-
- this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- this(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- }
-
- private SourceXmlElementRefAnnotation(
- JavaResourceNode parent,
- AnnotatedElement annotatedElement,
- DeclarationAnnotationAdapter daa,
- AnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameDeclarationAdapter();
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceDeclarationAdapter();
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- this.typeDeclarationAdapter = this.buildTypeDeclarationAdapter();
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JAXB.XML_ELEMENT_REF__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, JAXB.XML_ELEMENT_REF__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_REF__REQUIRED);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeDeclarationAdapter() {
- return buildAnnotationElementAdapter(this.daa, JAXB.XML_ELEMENT_REF__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.required = this.buildRequired(astRoot);
- this.type = this.buildType(astRoot);
- this.fullyQualifiedTypeName = this.buildFullyQualifiedTypeName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- this.syncType(this.buildType(astRoot));
- this.syncFullyQualifiedTypeName(this.buildFullyQualifiedTypeName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementRefAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- // ***** fully-qualified type name
- public String getFullyQualifiedTypeName() {
- return this.fullyQualifiedTypeName;
- }
-
- private void syncFullyQualifiedTypeName(String name) {
- String old = this.fullyQualifiedTypeName;
- this.fullyQualifiedTypeName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTypeName(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java
deleted file mode 100644
index d17b57fb22..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementRefs
- */
-public class SourceXmlElementRefsAnnotation
- extends SourceAnnotation
- implements XmlElementRefsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REFS);
-
-
- private final XmlElementRefsAnnotationContainer xmlElementRefsContainer
- = new XmlElementRefsAnnotationContainer();
-
-
- public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementRefsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_REFS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementRefsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.xmlElementRefsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
-
- // **************** xml element refs **************************************
-
- public ListIterable<XmlElementRefAnnotation> getXmlElementRefs() {
- return this.xmlElementRefsContainer.getNestedAnnotations();
- }
-
- public int getXmlElementRefsSize() {
- return this.xmlElementRefsContainer.getNestedAnnotationsSize();
- }
-
- public XmlElementRefAnnotation xmlElementRefAt(int index) {
- return this.xmlElementRefsContainer.getNestedAnnotation(index);
- }
-
- public XmlElementRefAnnotation addXmlElementRef(int index) {
- return this.xmlElementRefsContainer.addNestedAnnotation(index);
- }
-
- private XmlElementRefAnnotation buildXmlElementRef(int index) {
- return SourceXmlElementRefAnnotation.buildNestedSourceXmlElementRefAnnotation(
- this, this.annotatedElement, buildXmlElementRefIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlElementRefIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_ELEMENT_REFS__VALUE, index, JAXB.XML_ELEMENT_REF);
- }
-
- public void moveXmlElementRef(int targetIndex, int sourceIndex) {
- this.xmlElementRefsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlElementRef(int index) {
- this.xmlElementRefsContainer.removeNestedAnnotation(index);
- }
-
-
- class XmlElementRefsAnnotationContainer
- extends AnnotationContainer<XmlElementRefAnnotation> {
-
- @Override
- protected String getNestedAnnotationsListName() {
- return XML_ELEMENT_REFS_LIST;
- }
-
- @Override
- protected String getElementName() {
- return JAXB.XML_ELEMENT_REFS__VALUE;
- }
-
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_ELEMENT_REF;
- }
-
- @Override
- protected XmlElementRefAnnotation buildNestedAnnotation(int index) {
- return SourceXmlElementRefsAnnotation.this.buildXmlElementRef(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
deleted file mode 100644
index 8f02178031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElementWrapper
- */
-public final class SourceXmlElementWrapperAnnotation
- extends SourceAnnotation
- implements XmlElementWrapperAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_WRAPPER);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<Boolean> nillableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nillableAdapter;
- private Boolean nillable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> requiredDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> requiredAdapter;
- private Boolean required;
-
-
- // ********** constructors **********
- public SourceXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(annotatedElement, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlElementWrapperAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = this.buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.nillableDeclarationAdapter = this.buildNillableAdapter(daa);
- this.nillableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nillableDeclarationAdapter);
- this.requiredDeclarationAdapter = this.buildRequiredAdapter(daa);
- this.requiredAdapter = this.buildShortCircuitBooleanElementAdapter(this.requiredDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_WRAPPER__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_ELEMENT_WRAPPER__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildNillableAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_WRAPPER__NILLABLE);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildRequiredAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, JAXB.XML_ELEMENT_WRAPPER__REQUIRED);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENT_WRAPPER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.nillable = this.buildNillable(astRoot);
- this.required = this.buildRequired(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncNillable(this.buildNillable(astRoot));
- this.syncRequired(this.buildRequired(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlElementWrapperAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** nillable
- public Boolean getNillable() {
- return this.nillable;
- }
-
- public void setNillable(Boolean nillable) {
- if (this.attributeValueHasChanged(this.nillable, nillable)) {
- this.nillable = nillable;
- this.nillableAdapter.setValue(nillable);
- }
- }
-
- private void syncNillable(Boolean astNillable) {
- Boolean old = this.nillable;
- this.nillable = astNillable;
- this.firePropertyChanged(NILLABLE_PROPERTY, old, astNillable);
- }
-
- private Boolean buildNillable(CompilationUnit astRoot) {
- return this.nillableAdapter.getValue(astRoot);
- }
-
- public TextRange getNillableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nillableDeclarationAdapter, astRoot);
- }
-
- // ***** required
- public Boolean getRequired() {
- return this.required;
- }
-
- public void setRequired(Boolean required) {
- if (this.attributeValueHasChanged(this.required, required)) {
- this.required = required;
- this.requiredAdapter.setValue(required);
- }
- }
-
- private void syncRequired(Boolean astRequired) {
- Boolean old = this.required;
- this.required = astRequired;
- this.firePropertyChanged(REQUIRED_PROPERTY, old, astRequired);
- }
-
- private Boolean buildRequired(CompilationUnit astRoot) {
- return this.requiredAdapter.getValue(astRoot);
- }
-
- public TextRange getRequiredTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.requiredDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java
deleted file mode 100644
index aa20592bf7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlElements
- */
-public class SourceXmlElementsAnnotation
- extends SourceAnnotation
- implements XmlElementsAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENTS);
-
-
- private final XmlElementsAnnotationContainer xmlElementsContainer = new XmlElementsAnnotationContainer();
-
- public SourceXmlElementsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlElementsAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ELEMENTS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlElementsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.xmlElementsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
-
- // **************** xmlns *************************************************
-
- public ListIterable<XmlElementAnnotation> getXmlElements() {
- return this.xmlElementsContainer.getNestedAnnotations();
- }
-
- public int getXmlElementsSize() {
- return this.xmlElementsContainer.getNestedAnnotationsSize();
- }
-
- public XmlElementAnnotation xmlElementAt(int index) {
- return this.xmlElementsContainer.getNestedAnnotation(index);
- }
-
- public XmlElementAnnotation addXmlElement(int index) {
- return this.xmlElementsContainer.addNestedAnnotation(index);
- }
-
- private XmlElementAnnotation buildXmlElement(int index) {
- return SourceXmlElementAnnotation.buildNestedSourceXmlElementAnnotation(this, this.annotatedElement, buildXmlElementIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlElementIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_ELEMENTS__VALUE, index, JAXB.XML_ELEMENT);
- }
-
- public void moveXmlElement(int targetIndex, int sourceIndex) {
- this.xmlElementsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlElement(int index) {
- this.xmlElementsContainer.removeNestedAnnotation(index);
- }
-
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class XmlElementsAnnotationContainer
- extends AnnotationContainer<XmlElementAnnotation>
- {
- @Override
- protected String getNestedAnnotationsListName() {
- return XML_ELEMENTS_LIST;
- }
- @Override
- protected String getElementName() {
- return JAXB.XML_ELEMENTS__VALUE;
- }
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_ELEMENT;
- }
- @Override
- protected XmlElementAnnotation buildNestedAnnotation(int index) {
- return SourceXmlElementsAnnotation.this.buildXmlElement(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
deleted file mode 100644
index f2dcbaf5d5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnum
- */
-public final class SourceXmlEnumAnnotation
- extends SourceAnnotation
- implements XmlEnumAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- private String fullyQualifiedValueClassName;
-
- public SourceXmlEnumAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedValueClassName = this.buildFullyQualifiedValueClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedValueClassName(this.buildFullyQualifiedValueClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnumAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified value class name
- public String getFullyQualifiedValueClassName() {
- return this.fullyQualifiedValueClassName;
- }
-
- private void syncFullyQualifiedValueClassName(String name) {
- String old = this.fullyQualifiedValueClassName;
- this.fullyQualifiedValueClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedValueClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ENUM__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
deleted file mode 100644
index f7b4421461..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlEnumValue
- */
-public final class SourceXmlEnumValueAnnotation
- extends SourceAnnotation
- implements XmlEnumValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlEnumValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ENUM_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlEnumValueAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(VALUE_ADAPTER, pos, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ENUM_VALUE__VALUE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java
deleted file mode 100644
index dd54b7d5bc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlID
- */
-public final class SourceXmlIDAnnotation
- extends SourceAnnotation
- implements XmlIDAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ID);
-
- public SourceXmlIDAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ID;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java
deleted file mode 100644
index e2632aab22..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlIDREF
- */
-public final class SourceXmlIDREFAnnotation
- extends SourceAnnotation
- implements XmlIDREFAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_IDREF);
-
- public SourceXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_IDREF;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index 0c9f6b99ae..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation
- */
-public final class SourceXmlInlineBinaryDataAnnotation
- extends SourceAnnotation
- implements XmlInlineBinaryDataAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_INLINE_BINARY_DATA);
-
-
- public SourceXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return JAXB.XML_INLINE_BINARY_DATA;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 8a723c6430..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-/**
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- */
-public final class SourceXmlJavaTypeAdapterAnnotation
- extends SourceAnnotation
- implements XmlJavaTypeAdapterAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTER);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTERS);
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private String fullyQualifiedValue;
-
- /*
- * We want this event fired when the fq class changes by itself, not as a result
- * of the non-fq class changing.
- */
- private boolean suppressFQValueEventNotification = false;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
- /*
- * We want this event fired when the fq class changes by itself, not as a result
- * of the non-fq class changing.
- */
- private boolean suppressFQTypeEventNotification = false;
-
-
- // ********** constructors **********
- public static SourceXmlJavaTypeAdapterAnnotation buildSourceXmlJavaTypeAdapterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildXmlJavaTypeAdapterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlJavaTypeAdapterAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlJavaTypeAdapterAnnotation(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
- private SourceXmlJavaTypeAdapterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, annotatedElement, daa, annotationAdapter);
- this.valueDeclarationAdapter = buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- this.typeDeclarationAdapter = buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_JAVA_TYPE_ADAPTER;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = buildValue(astRoot);
- this.fullyQualifiedValue = buildFullyQualifiedValue(astRoot);
- this.type = buildType(astRoot);
- this.fullyQualifiedType = buildFullyQualifiedType(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncValue(buildValue(astRoot));
- syncType(buildType(astRoot));
- syncFullyQualifiedValue(buildFullyQualifiedValue(astRoot));
- syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
-
- this.suppressFQValueEventNotification = false;
- this.suppressFQTypeEventNotification = false;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlJavaTypeAdapterAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.suppressFQValueEventNotification = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.suppressFQValueEventNotification |= StringTools.stringsAreEqual(old, astValue);
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedValue() {
- return this.fullyQualifiedValue;
- }
-
- private void syncFullyQualifiedValue(String name) {
- String old = this.fullyQualifiedValue;
- this.fullyQualifiedValue = name;
- if (! this.suppressFQValueEventNotification) {
- this.firePropertyChanged(FULLY_QUALIFIED_VALUE_PROPERTY, old, name);
- }
- }
-
- private String buildFullyQualifiedValue(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.suppressFQTypeEventNotification = true;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.suppressFQTypeEventNotification |= StringTools.stringsAreEqual(old, astType);
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedType() {
- return this.fullyQualifiedType;
- }
-
- private void syncFullyQualifiedType(String name) {
- String old = this.fullyQualifiedType;
- this.fullyQualifiedType = name;
- if (! this.suppressFQTypeEventNotification) {
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
- }
- }
-
- private String buildFullyQualifiedType(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlJavaTypeAdapterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlJavaTypeAdapterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_JAVA_TYPE_ADAPTER);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java
deleted file mode 100644
index db44733f1d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlList
- */
-public final class SourceXmlListAnnotation
- extends SourceAnnotation
- implements XmlListAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_LIST);
-
- public SourceXmlListAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_LIST;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
deleted file mode 100644
index 5bcdba75b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMimeType
- */
-public final class SourceXmlMimeTypeAnnotation
- extends SourceAnnotation
- implements XmlMimeTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIME_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- public SourceXmlMimeTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIME_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** XmlMimeTypeAnnotation implementation **********
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_MIME_TYPE__VALUE);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java
deleted file mode 100644
index 9d469b2db2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlMixed
- */
-public final class SourceXmlMixedAnnotation
- extends SourceAnnotation
- implements XmlMixedAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIXED);
-
- public SourceXmlMixedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_MIXED;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
deleted file mode 100644
index 890f2fb793..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-
-
-public class SourceXmlNsAnnotation
- extends SourceAnnotation
- implements XmlNsAnnotation {
-
- private final DeclarationAnnotationElementAdapter<String> namespaceURIDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceURIAdapter;
- private String namespaceURI;
-
- private final DeclarationAnnotationElementAdapter<String> prefixDeclarationAdapter;
- private final AnnotationElementAdapter<String> prefixAdapter;
- private String prefix;
-
-
- public SourceXmlNsAnnotation(JavaResourceNode parent, AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, annotatedElement, idaa, new ElementIndexedAnnotationAdapter(annotatedElement, idaa));
- this.namespaceURIDeclarationAdapter = this.buildNamespaceURIDeclarationAdapter(idaa);
- this.namespaceURIAdapter = this.buildAdapter(this.namespaceURIDeclarationAdapter);
- this.prefixDeclarationAdapter = this.buildPrefixDeclarationAdapter(idaa);
- this.prefixAdapter = buildAdapter(this.prefixDeclarationAdapter);
- }
-
-
- protected DeclarationAnnotationElementAdapter<String> buildNamespaceURIDeclarationAdapter(
- DeclarationAnnotationAdapter daa) {
-
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_NS__NAMESPACE_URI);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildPrefixDeclarationAdapter(
- DeclarationAnnotationAdapter daa) {
-
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_NS__PREFIX);
- }
-
- private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_NS;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.namespaceURI = buildNamespaceURI(astRoot);
- this.prefix = buildPrefix(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncNamespaceURI(buildNamespaceURI(astRoot));
- syncPrefix(buildPrefix(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namespaceURI);
- }
-
-
- // ***** namespace *****
-
- public String getNamespaceURI() {
- return this.namespaceURI;
- }
-
- public void setNamespaceURI(String namespaceURI) {
- if (attributeValueHasChanged(this.namespaceURI, namespaceURI)) {
- this.namespaceURI = namespaceURI;
- this.namespaceURIAdapter.setValue(namespaceURI);
- }
- }
-
- private String buildNamespaceURI(CompilationUnit astRoot) {
- return this.namespaceURIAdapter.getValue(astRoot);
- }
-
- private void syncNamespaceURI(String namespaceURI) {
- String old = this.namespaceURI;
- this.namespaceURI = namespaceURI;
- firePropertyChanged(NAMESPACE_URI_PROPERTY, old, namespaceURI);
- }
-
- public TextRange getNamespaceURITextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.namespaceURIDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceURITouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceURIDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** prefix *****
-
- public String getPrefix() {
- return this.prefix;
- }
-
- public void setPrefix(String prefix) {
- if (attributeValueHasChanged(this.prefix, prefix)) {
- this.prefix = prefix;
- this.prefixAdapter.setValue(prefix);
- }
- }
-
- private String buildPrefix(CompilationUnit astRoot) {
- return this.prefixAdapter.getValue(astRoot);
- }
-
- private void syncPrefix(String prefix) {
- String old = this.prefix;
- this.prefix = prefix;
- firePropertyChanged(PREFIX_PROPERTY, old, prefix);
- }
-
- public TextRange getPrefixTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.prefixDeclarationAdapter, astRoot);
- }
-
- public boolean prefixTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.prefixDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** NestableAnnotation impl *****
-
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java
deleted file mode 100644
index a450bba3ec..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRegistry
- */
-public final class SourceXmlRegistryAnnotation
- extends SourceAnnotation
- implements XmlRegistryAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_REGISTRY);
-
- public SourceXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_REGISTRY;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
deleted file mode 100644
index c6dd697b8c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlRootElement
- */
-public final class SourceXmlRootElementAnnotation
- extends SourceAnnotation
- implements XmlRootElementAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ROOT_ELEMENT);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- public SourceXmlRootElementAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_ROOT_ELEMENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlRootElementAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ROOT_ELEMENT__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_ROOT_ELEMENT__NAMESPACE);
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
deleted file mode 100644
index 592bd9c78c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-
-public class SourceXmlSchemaAnnotation
- extends SourceAnnotation
- implements XmlSchemaAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> ATTRIBUTE_FORM_DEFAULT_ADAPTER =
- buildAttributeFormDefaultAdapter();
- private final AnnotationElementAdapter<String> attributeFormDefaultAdapter;
- private XmlNsForm attributeFormDefault;
-
- private static final DeclarationAnnotationElementAdapter<String> ELEMENT_FORM_DEFAULT_ADAPTER =
- buildElementFormDefaultAdapter();
- private final AnnotationElementAdapter<String> elementFormDefaultAdapter;
- private XmlNsForm elementFormDefault;
-
- private static final DeclarationAnnotationElementAdapter<String> LOCATION_ADAPTER =
- buildLocationAdapter();
- private final AnnotationElementAdapter<String> locationAdapter;
- private String location;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER =
- buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final XmlnsAnnotationContainer xmlnsContainer = new XmlnsAnnotationContainer();
-
-
- private static DeclarationAnnotationElementAdapter<String> buildAttributeFormDefaultAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT); //remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildElementFormDefaultAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT); // remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildLocationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__LOCATION); // remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SCHEMA__NAMESPACE); // remove annotation when empty
- }
-
-
- public SourceXmlSchemaAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- this(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceXmlSchemaAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) {
- super(parent, annotatedElement, daa);
- this.attributeFormDefaultAdapter = buildAnnotationElementAdapter(ATTRIBUTE_FORM_DEFAULT_ADAPTER);
- this.elementFormDefaultAdapter = buildAnnotationElementAdapter(ELEMENT_FORM_DEFAULT_ADAPTER);
- this.locationAdapter = buildAnnotationElementAdapter(LOCATION_ADAPTER);
- this.namespaceAdapter = buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- }
-
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.attributeFormDefault = buildAttributeFormDefault(astRoot);
- this.elementFormDefault = buildElementFormDefault(astRoot);
- this.location = buildLocation(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.xmlnsContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncAttributeFormDefault(buildAttributeFormDefault(astRoot));
- syncElementFormDefault(buildElementFormDefault(astRoot));
- syncLocation(buildLocation(astRoot));
- syncNamespace(buildNamespace(astRoot));
- this.xmlnsContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namespace);
- }
-
-
- // **************** attribute form default ********************************
-
- public XmlNsForm getAttributeFormDefault() {
- return this.attributeFormDefault;
- }
-
- public void setAttributeFormDefault(XmlNsForm attributeFormDefault) {
- if (attributeValueHasChanged(this.attributeFormDefault, attributeFormDefault)) {
- this.attributeFormDefault = attributeFormDefault;
- this.attributeFormDefaultAdapter.setValue(XmlNsForm.toJavaAnnotationValue(attributeFormDefault));
- }
- }
-
- private XmlNsForm buildAttributeFormDefault(CompilationUnit astRoot) {
- return XmlNsForm.fromJavaAnnotationValue(this.attributeFormDefaultAdapter.getValue(astRoot));
- }
-
- private void syncAttributeFormDefault(XmlNsForm attributeFormDefault) {
- XmlNsForm old = this.attributeFormDefault;
- this.attributeFormDefault = attributeFormDefault;
- firePropertyChanged(ATTRIBUTE_FORM_DEFAULT_PROPERTY, old, attributeFormDefault);
- }
-
- public TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ATTRIBUTE_FORM_DEFAULT_ADAPTER, astRoot);
- }
-
-
- // **************** element form default ********************************
-
- public XmlNsForm getElementFormDefault() {
- return this.elementFormDefault;
- }
-
- public void setElementFormDefault(XmlNsForm elementFormDefault) {
- if (attributeValueHasChanged(this.elementFormDefault, elementFormDefault)) {
- this.elementFormDefault = elementFormDefault;
- this.elementFormDefaultAdapter.setValue(XmlNsForm.toJavaAnnotationValue(elementFormDefault));
- }
- }
-
- private XmlNsForm buildElementFormDefault(CompilationUnit astRoot) {
- return XmlNsForm.fromJavaAnnotationValue(this.elementFormDefaultAdapter.getValue(astRoot));
- }
-
- private void syncElementFormDefault(XmlNsForm elementFormDefault) {
- XmlNsForm old = this.elementFormDefault;
- this.elementFormDefault = elementFormDefault;
- firePropertyChanged(ELEMENT_FORM_DEFAULT_PROPERTY, old, elementFormDefault);
- }
-
- public TextRange getElementFormDefaultTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ELEMENT_FORM_DEFAULT_ADAPTER, astRoot);
- }
-
-
- // **************** location **********************************************
-
- public String getLocation() {
- return this.location;
- }
-
- public void setLocation(String location) {
- if (attributeValueHasChanged(this.location, location)) {
- this.location = location;
- this.locationAdapter.setValue(location);
- }
- }
-
- private String buildLocation(CompilationUnit astRoot) {
- return this.locationAdapter.getValue(astRoot);
- }
-
- private void syncLocation(String location) {
- String old = this.location;
- this.location = location;
- firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- public TextRange getLocationTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(LOCATION_ADAPTER, astRoot);
- }
-
-
- // **************** namespace *********************************************
-
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- private void syncNamespace(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- // **************** xmlns *************************************************
-
- public ListIterable<XmlNsAnnotation> getXmlns() {
- return this.xmlnsContainer.getNestedAnnotations();
- }
-
- public int getXmlnsSize() {
- return this.xmlnsContainer.getNestedAnnotationsSize();
- }
-
- public XmlNsAnnotation xmlnsAt(int index) {
- return this.xmlnsContainer.getNestedAnnotation(index);
- }
-
- public XmlNsAnnotation addXmlns(int index) {
- return this.xmlnsContainer.addNestedAnnotation(index);
- }
-
- private XmlNsAnnotation buildXmlns(int index) {
- return new SourceXmlNsAnnotation(
- this, this.annotatedElement, buildXmlnsIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildXmlnsIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, JAXB.XML_SCHEMA__XMLNS, index, JAXB.XML_NS);
- }
-
- public void moveXmlns(int targetIndex, int sourceIndex) {
- this.xmlnsContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeXmlns(int index) {
- this.xmlnsContainer.removeNestedAnnotation(index);
- }
-
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class XmlnsAnnotationContainer
- extends AnnotationContainer<XmlNsAnnotation>
- {
- @Override
- protected String getNestedAnnotationsListName() {
- return XMLNS_LIST;
- }
- @Override
- protected String getElementName() {
- return JAXB.XML_SCHEMA__XMLNS;
- }
- @Override
- protected String getNestedAnnotationName() {
- return JAXB.XML_NS;
- }
- @Override
- protected XmlNsAnnotation buildNestedAnnotation(int index) {
- return SourceXmlSchemaAnnotation.this.buildXmlns(index);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
deleted file mode 100644
index 9ad6a7c39a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSchemaType
- */
-public class SourceXmlSchemaTypeAnnotation
- extends SourceAnnotation
- implements XmlSchemaTypeAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPE);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPES);
-
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> namespaceDeclarationAdapter;
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final DeclarationAnnotationElementAdapter<String> typeDeclarationAdapter;
- private final AnnotationElementAdapter<String> typeAdapter;
- private String type;
- private String fullyQualifiedType;
-
-
- // ********** constructors **********
-
- public static SourceXmlSchemaTypeAnnotation buildSourceXmlSchemaTypeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- int index) {
-
- IndexedDeclarationAnnotationAdapter idaa = buildXmlSchemaTypeDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlSchemaTypeAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlSchemaTypeAnnotation(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
- private SourceXmlSchemaTypeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.nameDeclarationAdapter = buildNameAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.namespaceDeclarationAdapter = buildNamespaceAdapter(daa);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(this.namespaceDeclarationAdapter);
- this.typeDeclarationAdapter = buildTypeAdapter(daa);
- this.typeAdapter = this.buildAnnotationElementAdapter(this.typeDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_SCHEMA_TYPE__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daa, JAXB.XML_SCHEMA_TYPE__NAMESPACE);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, JAXB.XML_SCHEMA_TYPE__TYPE,
- SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName,
- ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(
- annotationAdapter, elementName, converter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SCHEMA_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = buildName(astRoot);
- this.namespace = buildNamespace(astRoot);
- this.type = buildType(astRoot);
- this.fullyQualifiedType = buildFullyQualifiedType(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncName(buildName(astRoot));
- syncNamespace(buildNamespace(astRoot));
- syncType(buildType(astRoot));
- syncFullyQualifiedType(buildFullyQualifiedType(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // **************** XmlSchemaTypeAnnotation impl **************************
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.namespaceDeclarationAdapter, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.namespaceDeclarationAdapter, pos, astRoot);
- }
-
- // ***** type
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(type);
- }
- }
-
- private void syncType(String astType) {
- String old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private String buildType(CompilationUnit astRoot) {
- return this.typeAdapter.getValue(astRoot);
- }
-
- public TextRange getTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.typeDeclarationAdapter, astRoot);
- }
-
- public String getFullyQualifiedType() {
- return this.fullyQualifiedType;
- }
-
- private void syncFullyQualifiedType(String name) {
- String old = this.fullyQualifiedType;
- this.fullyQualifiedType = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TYPE_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedType(CompilationUnit astRoot) {
- return (this.type == null) ? null : ASTTools.resolveFullyQualifiedName(this.typeAdapter.getExpression(astRoot));
- }
-
-
- //*********** NestableAnnotation implementation ****************
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlSchemaTypeAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlSchemaTypeDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- JAXB.XML_SCHEMA_TYPE);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
deleted file mode 100644
index 348e508f5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlSeeAlso
- */
-public final class SourceXmlSeeAlsoAnnotation
- extends SourceAnnotation
- implements XmlSeeAlsoAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SEE_ALSO);
-
- private final DeclarationAnnotationElementAdapter<String[]> valueDeclarationAdapter;
-
- private final AnnotationElementAdapter<String[]> valueAdapter;
-
- private final Vector<String> classes;
-
- /*
- * We want this event fired when the fq classes change by themselves, not as a result
- * of the value changing.
- */
- private boolean suppressFQClassesEventNotification = false;
-
- private final Vector<String> fullyQualifiedClasses;
-
-
- public SourceXmlSeeAlsoAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.valueDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SEE_ALSO__VALUE);
- this.valueAdapter = this.buildArrayAnnotationElementAdapter(this.valueDeclarationAdapter);
- this.classes = new Vector<String>();
- this.fullyQualifiedClasses = new Vector<String>();
- }
-
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_SEE_ALSO;
- }
-
- public void initialize(CompilationUnit astRoot) {
- for (String astClass : this.valueAdapter.getValue(astRoot)) {
- this.classes.add(astClass);
- }
- CollectionTools.addAll(this.fullyQualifiedClasses, buildFullyQualifiedClasses(astRoot));
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- String[] astClasses = this.valueAdapter.getValue(astRoot);
- synchronizeList(Arrays.asList(astClasses), this.classes, CLASSES_LIST);
-
- if (this.suppressFQClassesEventNotification) {
- this.fullyQualifiedClasses.clear();
- CollectionTools.addAll(this.fullyQualifiedClasses, buildFullyQualifiedClasses(astRoot));
- this.suppressFQClassesEventNotification = false;
- }
- else {
- synchronizeList(buildFullyQualifiedClasses(astRoot), this.fullyQualifiedClasses, FULLY_QUALIFIED_CLASSES_LIST);
- }
- }
-
- protected Iterable<String> buildFullyQualifiedClasses(final CompilationUnit astRoot) {
- Expression expression = this.valueAdapter.getExpression(astRoot);
- if (expression == null) {
- return EmptyIterable.<String>instance();
- }
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- return new SingleElementIterable<String>(ASTTools.resolveFullyQualifiedName(expression));
- }
- else {
- return ASTTools.resolveFullyQualifiedNames(expression);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classes);
- }
-
-
- // ********** XmlSeeAlsoAnnotation implementation **********
-
- // ***** classes
- public ListIterable<String> getClasses() {
- return new LiveCloneListIterable<String>(this.classes);
- }
-
- public int getClassesSize() {
- return this.classes.size();
- }
-
- public void addClass(String clazz) {
- this.addClass(this.classes.size(), clazz);
- }
-
- public void addClass(int index, String clazz) {
- this.classes.add(index, clazz);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public void moveClass(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.classes, targetIndex, sourceIndex);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public void removeClass(int index) {
- this.classes.remove(index);
- this.suppressFQClassesEventNotification = true;
- this.writeClasses();
- }
-
- public ListIterable<String> getFullyQualifiedClasses() {
- return new LiveCloneListIterable<String>(this.fullyQualifiedClasses);
- }
-
- private void writeClasses() {
- this.valueAdapter.setValue(this.classes.toArray(new String[this.classes.size()]));
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forTypes());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, converter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java
deleted file mode 100644
index dc17b833e6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlTransient
- */
-public final class SourceXmlTransientAnnotation
- extends SourceAnnotation
- implements XmlTransientAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TRANSIENT);
-
- public SourceXmlTransientAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TRANSIENT;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
deleted file mode 100644
index 5f03152908..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.IndexedConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedExpressionConverter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlType
- */
-public final class SourceXmlTypeAnnotation
- extends SourceAnnotation
- implements XmlTypeAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TYPE);
-
- private static final DeclarationAnnotationElementAdapter<String> FACTORY_CLASS_ADAPTER = buildFactoryClassAdapter();
- private final AnnotationElementAdapter<String> factoryClassAdapter;
- private String factoryClass;
-
- private String fullyQualifiedFactoryClassName;
-
- private static final DeclarationAnnotationElementAdapter<String> FACTORY_METHOD_ADAPTER = buildFactoryMethodAdapter();
- private final AnnotationElementAdapter<String> factoryMethodAdapter;
- private String factoryMethod;
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private static final DeclarationAnnotationElementAdapter<String> NAMESPACE_ADAPTER = buildNamespaceAdapter();
- private final AnnotationElementAdapter<String> namespaceAdapter;
- private String namespace;
-
- private final IndexedDeclarationAnnotationElementAdapter<String> propOrderDeclarationAdapter;
- private final AnnotationElementAdapter<String[]> propOrderAdapter;
- private final Vector<String> propOrder = new Vector<String>();
-
- public SourceXmlTypeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- this.factoryClassAdapter = this.buildAnnotationElementAdapter(FACTORY_CLASS_ADAPTER);
- this.factoryMethodAdapter = this.buildAnnotationElementAdapter(FACTORY_METHOD_ADAPTER);
- this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
- this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
- this.propOrderDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__PROP_ORDER);
- this.propOrderAdapter = this.buildArrayAnnotationElementAdapter(this.propOrderDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- private static IndexedDeclarationAnnotationElementAdapter<String> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static IndexedDeclarationAnnotationElementAdapter<String> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, IndexedExpressionConverter<String> converter) {
- return new IndexedConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_TYPE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.factoryClass = this.buildFactoryClass(astRoot);
- this.fullyQualifiedFactoryClassName = this.buildFullyQualifiedFactoryClassName(astRoot);
- this.factoryMethod = this.buildFactoryMethod(astRoot);
- this.name = this.buildName(astRoot);
- this.namespace = this.buildNamespace(astRoot);
- this.initializePropOrder(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFactoryClass(this.buildFactoryClass(astRoot));
- this.syncFullyQualifiedFactoryClassName(this.buildFullyQualifiedFactoryClassName(astRoot));
- this.syncFactoryMethod(this.buildFactoryMethod(astRoot));
- this.syncName(this.buildName(astRoot));
- this.syncNamespace(this.buildNamespace(astRoot));
- this.syncPropOrder(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** XmlTypeAnnotation implementation **********
-
- // ***** factoryClass
- public String getFactoryClass() {
- return this.factoryClass;
- }
-
- public void setFactoryClass(String factoryClass) {
- if (this.attributeValueHasChanged(this.factoryClass, factoryClass)) {
- this.factoryClass = factoryClass;
- this.factoryClassAdapter.setValue(factoryClass);
- }
- }
-
- private void syncFactoryClass(String astFactoryClass) {
- String old = this.factoryClass;
- this.factoryClass = astFactoryClass;
- this.firePropertyChanged(FACTORY_CLASS_PROPERTY, old, astFactoryClass);
- }
-
- private String buildFactoryClass(CompilationUnit astRoot) {
- return this.factoryClassAdapter.getValue(astRoot);
- }
-
- public TextRange getFactoryClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_CLASS_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified factory class name
- public String getFullyQualifiedFactoryClassName() {
- return this.fullyQualifiedFactoryClassName;
- }
-
- private void syncFullyQualifiedFactoryClassName(String name) {
- String old = this.fullyQualifiedFactoryClassName;
- this.fullyQualifiedFactoryClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedFactoryClassName(CompilationUnit astRoot) {
- return (this.factoryClass == null) ? null : ASTTools.resolveFullyQualifiedName(this.factoryClassAdapter.getExpression(astRoot));
- }
-
- // ***** factoryMethod
- public String getFactoryMethod() {
- return this.factoryMethod;
- }
-
- public void setFactoryMethod(String factoryMethod) {
- if (this.attributeValueHasChanged(this.factoryMethod, factoryMethod)) {
- this.factoryMethod = factoryMethod;
- this.factoryMethodAdapter.setValue(factoryMethod);
- }
- }
-
- private void syncFactoryMethod(String astFactoryMethod) {
- String old = this.factoryMethod;
- this.factoryMethod = astFactoryMethod;
- this.firePropertyChanged(FACTORY_METHOD_PROPERTY, old, astFactoryMethod);
- }
-
- private String buildFactoryMethod(CompilationUnit astRoot) {
- return this.factoryMethodAdapter.getValue(astRoot);
- }
-
- public TextRange getFactoryMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FACTORY_METHOD_ADAPTER, astRoot);
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return getElementTextRange(NAME_ADAPTER, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ***** namespace
- public String getNamespace() {
- return this.namespace;
- }
-
- public void setNamespace(String namespace) {
- if (this.attributeValueHasChanged(this.namespace, namespace)) {
- this.namespace = namespace;
- this.namespaceAdapter.setValue(namespace);
- }
- }
-
- private void syncNamespace(String astNamespace) {
- String old = this.namespace;
- this.namespace = astNamespace;
- this.firePropertyChanged(NAMESPACE_PROPERTY, old, astNamespace);
- }
-
- private String buildNamespace(CompilationUnit astRoot) {
- return this.namespaceAdapter.getValue(astRoot);
- }
-
- public TextRange getNamespaceTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(NAMESPACE_ADAPTER, astRoot);
- }
-
- public boolean namespaceTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(NAMESPACE_ADAPTER, pos, astRoot);
- }
-
-
- // ***** prop order *****
-
- public ListIterable<String> getPropOrder() {
- return new LiveCloneListIterable<String>(this.propOrder);
- }
-
- public int getPropOrderSize() {
- return this.propOrder.size();
- }
-
- public void addProp(String prop) {
- this.addProp(this.propOrder.size(), prop);
- }
-
- public void addProp(int index, String prop) {
- this.propOrder.add(index, prop);
- this.writePropOrder();
- }
-
- public void moveProp(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.propOrder, targetIndex, sourceIndex);
- this.writePropOrder();
- }
-
- public void removeProp(String prop) {
- this.propOrder.remove(prop);
- this.writePropOrder();
- }
-
- public void removeProp(int index) {
- this.propOrder.remove(index);
- this.writePropOrder();
- }
-
- private void writePropOrder() {
- this.propOrderAdapter.setValue(this.propOrder.toArray(new String[this.propOrder.size()]));
- }
-
- private void initializePropOrder(CompilationUnit astRoot) {
- String[] astPropOrder = this.propOrderAdapter.getValue(astRoot);
- for (int i = 0; i < astPropOrder.length; i++) {
- this.propOrder.add(astPropOrder[i]);
- }
- }
-
- private void syncPropOrder(CompilationUnit astRoot) {
- String[] astPropOrder = this.propOrderAdapter.getValue(astRoot);
- this.synchronizeList(Arrays.asList(astPropOrder), this.propOrder, PROP_ORDER_LIST);
- }
-
- public TextRange getPropOrderTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.propOrderDeclarationAdapter, astRoot);
- }
-
- public boolean propOrderTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.propOrderDeclarationAdapter, pos, astRoot);
- }
-
- public TextRange getPropTextRange(int index, CompilationUnit astRoot) {
- return getElementTextRange(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, index, astRoot), astRoot);
- }
-
- public boolean propTouches(int index, int pos, CompilationUnit astRoot) {
- return textRangeTouches(this.selectAnnotationElementTextRange(this.propOrderDeclarationAdapter, index, astRoot), pos);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildFactoryClassAdapter() {
- return buildAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__FACTORY_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFactoryMethodAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__FACTORY_METHOD);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildNamespaceAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_TYPE__NAMESPACE);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java
deleted file mode 100644
index a6f5d45501..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-/**
- * javax.xml.bind.annotation.XmlValue
- */
-public final class SourceXmlValueAnnotation
- extends SourceAnnotation
- implements XmlValueAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_VALUE);
-
- public SourceXmlValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return JAXB.XML_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- //no-op
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- //no-op
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
deleted file mode 100644
index 4e17fb10e4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.resource.AbstractJaxbFileResourceModel;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-/**
- * JAXB index
- */
-public class JaxbIndexResourceImpl
- extends AbstractJaxbFileResourceModel<Vector<String>>
- implements JaxbIndexResource
-{
- public JaxbIndexResourceImpl(IFile file) {
- super(file);
- }
-
- @Override
- protected Vector<String> buildState() {
- return new Vector<String>();
- }
-
- @Override
- protected void reload() {
- this.state.clear();
- super.reload();
- }
-
- @Override
- protected void load(InputStream stream) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
- String line = reader.readLine();
- while (line != null) {
- this.state.add(line.trim());
- line = reader.readLine();
- }
- }
-
- public Iterable<String> getFullyQualifiedClassNames() {
- return (this.packageName == null) ?
- this.getSimpleClassNames() :
- this.getPrefixedClassNames();
- }
-
- protected Iterable<String> getSimpleClassNames() {
- return new SnapshotCloneIterable<String>(this.state);
- }
-
- protected Iterable<String> getPrefixedClassNames() {
- return new TransformationIterable<String, String>(
- this.getSimpleClassNames(),
- new PrefixTransformer(this.packageName + '.')
- );
- }
-
- protected class PrefixTransformer
- implements Transformer<String, String>
- {
- protected final String prefix;
- protected PrefixTransformer(String prefix) {
- super();
- this.prefix = prefix;
- }
- public String transform(String string) {
- return this.prefix + string;
- }
- }
-
- public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_INDEX_RESOURCE_TYPE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
deleted file mode 100644
index f1600741da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbindex/JaxbIndexResourceModelProvider.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-
-public class JaxbIndexResourceModelProvider
- implements JaxbResourceModelProvider {
-
- // singleton
- private static final JaxbIndexResourceModelProvider INSTANCE = new JaxbIndexResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JaxbIndexResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- private final Map<IFile, JaxbIndexResourceImpl> models = new HashMap<IFile, JaxbIndexResourceImpl>();
-
- private final IResourceChangeListener resourceChangeListener;
-
-
- /**
- * Enforce singleton usage
- */
- private JaxbIndexResourceModelProvider() {
- super();
- this.resourceChangeListener = buildResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- }
-
-
- protected IResourceChangeListener buildResourceChangeListener() {
- return new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- handleResourceChangeEvent(event);
- }
- };
- }
-
- public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_INDEX_CONTENT_TYPE;
- }
-
- public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return buildResourceModel(file);
- }
-
- public JaxbIndexResource buildResourceModel(IFile file) {
- JaxbIndexResourceImpl resource = this.models.get(file);
- if (resource != null) {
- return resource;
- }
- resource = new JaxbIndexResourceImpl(file);
- this.models.put(file, resource);
- return resource;
- }
-
- protected void handleResourceChangeEvent(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE :
- removeProjectResources((IProject) event.getResource());
- return;
-
- case IResourceChangeEvent.POST_CHANGE :
- updateResources(event.getDelta());
- }
- }
-
- protected void removeProjectResources(IProject removedProject) {
- for (IFile file : new SnapshotCloneIterable<IFile>(this.models.keySet())) {
- if (file.getProject().equals(removedProject)) {
- removeResource(file);
- }
- }
- }
-
- protected void updateResources(IResourceDelta delta) {
- try {
- delta.accept(new ResourceDeltaVisitor());
- }
- catch (CoreException ce) {
- // shouldn't happen
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void removeResource(IFile file) {
- this.models.remove(file);
- }
-
- protected void updateResource(IFile file) {
- JaxbIndexResourceImpl resource = this.models.get(file);
- if (resource != null) {
- resource.update();
- }
- }
-
-
- protected class ResourceDeltaVisitor
- implements IResourceDeltaVisitor {
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (deltaKind == IResourceDelta.REMOVED) {
- JaxbIndexResourceModelProvider.this.removeResource(file);
- }
- else if (deltaKind == IResourceDelta.CHANGED) {
- JaxbIndexResourceModelProvider.this.updateResource(file);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
deleted file mode 100644
index be6842c4aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.resource.AbstractJaxbFileResourceModel;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-/**
- * JAXB index
- */
-public class JaxbPropertiesResourceImpl
- extends AbstractJaxbFileResourceModel<Properties>
- implements JaxbPropertiesResource
-{
- public JaxbPropertiesResourceImpl(IFile file) {
- super(file);
- }
-
- @Override
- protected Properties buildState() {
- return new Properties();
- }
-
- @Override
- protected void reload() {
- this.state.clear();
- super.reload();
- }
-
- @Override
- protected void load(InputStream stream) throws IOException {
- this.state.load(stream);
- }
-
- public String getProperty(String propertyName) {
- return this.state.getProperty(propertyName);
- }
-
- public JptResourceType getResourceType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_RESOURCE_TYPE;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
deleted file mode 100644
index d2b2e72c72..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/jaxbprops/JaxbPropertiesResourceModelProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceModel;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPropertiesResourceModelProvider
- implements JaxbResourceModelProvider {
-
- // singleton
- private static final JaxbPropertiesResourceModelProvider INSTANCE = new JaxbPropertiesResourceModelProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPropertiesResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- private final Map<IFile, JaxbPropertiesResourceImpl> models = new HashMap<IFile, JaxbPropertiesResourceImpl>();
-
- private final IResourceChangeListener resourceChangeListener;
-
-
- /**
- * Enforce singleton usage
- */
- private JaxbPropertiesResourceModelProvider() {
- super();
- this.resourceChangeListener = buildResourceChangeListener();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener);
- }
-
-
- protected IResourceChangeListener buildResourceChangeListener() {
- return new IResourceChangeListener() {
- public void resourceChanged(IResourceChangeEvent event) {
- handleResourceChangeEvent(event);
- }
- };
- }
-
- public IContentType getContentType() {
- return JptJaxbCorePlugin.JAXB_PROPERTIES_CONTENT_TYPE;
- }
-
- public JptResourceModel buildResourceModel(JaxbProject jaxbProject, IFile file) {
- return buildResourceModel(file);
- }
-
- public JaxbPropertiesResource buildResourceModel(IFile file) {
- JaxbPropertiesResourceImpl resource = this.models.get(file);
- if (resource != null) {
- return resource;
- }
- resource = new JaxbPropertiesResourceImpl(file);
- this.models.put(file, resource);
- return resource;
- }
-
- protected void handleResourceChangeEvent(IResourceChangeEvent event) {
- switch (event.getType()) {
- case IResourceChangeEvent.PRE_CLOSE :
- case IResourceChangeEvent.PRE_DELETE :
- removeProjectResources((IProject) event.getResource());
- return;
-
- case IResourceChangeEvent.POST_CHANGE :
- updateResources(event.getDelta());
- }
- }
-
- protected void removeProjectResources(IProject removedProject) {
- for (IFile file : new SnapshotCloneIterable<IFile>(this.models.keySet())) {
- if (file.getProject().equals(removedProject)) {
- removeResource(file);
- }
- }
- }
-
- protected void updateResources(IResourceDelta delta) {
- try {
- delta.accept(new ResourceDeltaVisitor());
- }
- catch (CoreException ce) {
- // shouldn't happen
- JptJaxbCorePlugin.log(ce);
- }
- }
-
- protected void removeResource(IFile file) {
- this.models.remove(file);
- }
-
- protected void updateResource(IFile file) {
- JaxbPropertiesResourceImpl resource = this.models.get(file);
- if (resource != null) {
- resource.update();
- }
- }
-
-
- protected class ResourceDeltaVisitor
- implements IResourceDeltaVisitor {
-
- public boolean visit(IResourceDelta delta) {
- IResource res = delta.getResource();
- switch (res.getType()) {
- case IResource.ROOT :
- return true; // visit children
- case IResource.PROJECT :
- return true; // visit children
- case IResource.FOLDER :
- return true; // visit children
- case IResource.FILE :
- fileChanged((IFile) res, delta.getKind());
- return false; // no children
- default :
- return false; // no children (probably shouldn't get here...)
- }
- }
-
- protected void fileChanged(IFile file, int deltaKind) {
- if (deltaKind == IResourceDelta.REMOVED) {
- JaxbPropertiesResourceModelProvider.this.removeResource(file);
- }
- else if (deltaKind == IResourceDelta.CHANGED) {
- JaxbPropertiesResourceModelProvider.this.updateResource(file);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
deleted file mode 100644
index d79d040b3e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/DefaultValidationMessages.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class DefaultValidationMessages {
-
- private static String[] DEFAULT_PARMS = new String[0];
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JaxbNode targetObject) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JaxbNode targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JaxbNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JaxbNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, textRange, MESSAGE_FACTORY);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange, MessageFactory messageFactory) {
- IMessage message = messageFactory.buildMessage(defaultSeverity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
- if (textRange == null) {
- textRange = DEFAULT_TEXT_RANGE;
- // log the exception but allow the message to still be used
- JptJaxbCorePlugin.log(new NullPointerException("Null text range for message ID: " + messageId)); //$NON-NLS-1$
- }
- int lineNumber = textRange.getLineNumber();
- message.setLineNo(lineNumber);
- if (lineNumber == IMessage.LINENO_UNSET) {
- message.setAttribute(IMarker.LOCATION, " "); //$NON-NLS-1$
- }
- message.setOffset(textRange.getOffset());
- message.setLength(textRange.getLength());
- return message;
- }
-
-
- private DefaultValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** message factory **********
-
- /**
- * Allow clients to specify a message factory so the message can load the
- * appropriate resource bundle.
- */
- public interface MessageFactory {
- IMessage buildMessage(int severity, String messageId, String[] parms, IResource targetObject);
- }
-
- private static final MessageFactory MESSAGE_FACTORY = new GenericMessageFactory();
-
- /* CU private */ static class GenericMessageFactory
- implements MessageFactory
- {
- public IMessage buildMessage(int severity, String messageId, String[] parms, IResource targetObject) {
- // TODO check for preference override
-// int prefSeverity = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
-// if (prefSeverity != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
-// severity = prefSeverity;
-// }
- IMessage message = new Message(JaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
- return message;
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
deleted file mode 100644
index 04a0816a10..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-@SuppressWarnings("nls")
-public interface JaxbValidationMessages {
-
- // bundle name
- String BUNDLE_NAME = "jaxb_validation";
-
- // validation on project
-
- String NO_JAXB_PROJECT = "NO_JAXB_PROJECT";
- String PROJECT_INVALID_LIBRARY_PROVIDER = "PROJECT_INVALID_LIBRARY_PROVIDER";
- String PROJECT__UNRESOLVED_SCHEMA = "PROJECT__UNRESOLVED_SCHEMA";
- String PROJECT__DUPLICATE_NAMESPACE = "PROJECT__DUPLICATE_NAMESPACE";
-
-
- // validation on package
-
- String PACKAGE_NO_SCHEMA_FOR_NAMESPACE = "PACKAGE_NO_SCHEMA_FOR_NAMESPACE";
- String PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED = "PACKAGE_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_SPECIFIED";
-
- String XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT = "XML_SCHEMA__MISMATCHED_ATTRIBUTE_FORM_DEFAULT";
- String XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT = "XML_SCHEMA__MISMATCHED_ELEMENT_FORM_DEFAULT";
-
-
- // validation on type
-
- String XML_ENUM__NON_SIMPLE_SCHEMA_TYPE = "XML_ENUM__NON_SIMPLE_SCHEMA_TYPE";
-
- String XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE = "XML_TYPE__UNMATCHING_NAMESPACE_FOR_ANONYMOUS_TYPE";
- String XML_TYPE__UNSPECIFIED_FACTORY_METHOD = "XML_TYPE__UNSPECIFIED_FACTORY_METHOD";
- String XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR = "XML_TYPE__NO_PUBLIC_OR_PROTECTED_CONSTRUCTOR";
- String XML_TYPE__DUPLICATE_PROP = "XML_TYPE__DUPLICATE_PROP";
- String XML_TYPE__MISSING_PROP = "XML_TYPE__MISSING_PROP";
- String XML_TYPE__NONEXISTENT_PROP = "XML_TYPE__NONEXISTENT_PROP";
- String XML_TYPE__TRANSIENT_PROP = "XML_TYPE__TRANSIENT_PROP";
- String XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM = "XML_TYPE__FACTORY_CLASS_IGNORED_FOR_ENUM";
- String XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM = "XML_TYPE__FACTORY_METHOD_IGNORED_FOR_ENUM";
- String XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM = "XML_TYPE__PROP_ORDER_IGNORED_FOR_ENUM";
-
- String XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE = "XML_ROOT_ELEMENT_TYPE_CONFLICTS_WITH_XML_TYPE";
-
-
- // validation on enum constant
-
- String XML_ENUM_VALUE__INVALID_LEXICAL_VALUE = "XML_ENUM_VALUE__INVALID_LEXICAL_VALUE";
-
-
- // validation on attribute
-
- String ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION = "ATTRIBUTE_MAPPING__UNSUPPORTED_ANNOTATION";
- String ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED = "ATTRIBUTE_MAPPING_XML_JAVA_TYPE_ADAPTER_TYPE_NOT_DEFINED";
- String XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION = "XML_ELEMENT_WRAPPER_DEFINED_ON_NON_ARRAY_NON_COLLECTION";
-
- String XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED = "XML_ANY_ATTRIBUTE__MULTIPLE_MAPPINGS_DEFINED";
- String XML_ANY_ATTRIBUTE__NON_MAP_TYPE = "XML_ANY_ATTRIBUTE__NON_MAP_TYPE";
-
- String XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED = "XML_ANY_ELEMENT__MULTIPLE_MAPPINGS_DEFINED";
-
- String XML_ATTRIBUTE__INVALID_SCHEMA_TYPE = "XML_ATTRIBUTE__INVALID_SCHEMA_TYPE";
-
- String XML_ELEMENT__UNSPECIFIED_TYPE = "XML_ELEMENT__UNSPECIFIED_TYPE";
- String XML_ELEMENT__ILLEGAL_TYPE = "XML_ELEMENT__ILLEGAL_TYPE";
- String XML_ELEMENT__INVALID_SCHEMA_TYPE = "XML_ELEMENT__INVALID_SCHEMA_TYPE";
-
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE";
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_PARAM";
- String XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME = "XML_ELEMENT_DECL__SUBST_HEAD_NAME_EQUALS_NAME";
- String XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL = "XML_ELEMENT_DECL__SUBST_HEAD_NO_MATCHING_ELEMENT_DECL";
-
- String XML_ELEMENT_REF__UNSPECIFIED_TYPE = "XML_ELEMENT_REF__UNSPECIFIED_TYPE";
- String XML_ELEMENT_REF__ILLEGAL_TYPE = "XML_ELEMENT_REF__ILLEGAL_TYPE";
- String XML_ELEMENT_REF__NO_ROOT_ELEMENT = "XML_ELEMENT_REF__NO_ROOT_ELEMENT";
- String XML_ELEMENT_REF__NO_REGISTRY = "XML_ELEMENT_REF__NO_REGISTRY";
- String XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL = "XML_ELEMENT_REF__NO_MATCHING_ELEMENT_DECL";
-
- String XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE = "XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_TYPE";
- String XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME = "XML_ELEMENT_REFS__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE = "XML_ELEMENTS__DUPLICATE_XML_ELEMENT_TYPE";
- String XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME = "XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_ID__MULTIPLE_MAPPINGS_DEFINED = "XML_ID__MULTIPLE_MAPPINGS_DEFINED";
- String XML_ID__ATTRIBUTE_TYPE_NOT_STRING = "XML_ID__ATTRIBUTE_TYPE_NOT_STRING";
- String XML_ID__SCHEMA_TYPE_NOT_ID = "XML_ID__SCHEMA_TYPE_NOT_ID";
-
- String XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID = "XML_ID_REF__TYPE_DOES_NOT_CONTAIN_XML_ID";
- String XML_ID_REF__SCHEMA_TYPE_NOT_IDREF = "XML_ID_REF__SCHEMA_TYPE_NOT_IDREF";
-
- String XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE = "XML_LIST__ATTRIBUTE_NOT_COLLECTION_TYPE";
- String XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE = "XML_LIST__ITEM_TYPE_NOT_MAPPED_TO_VALID_SCHEMA_TYPE";
-
- String XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE = "XML_REGISTRY__MULTIPLE_XML_REGISTRIES_FOR_PACKAGE";
- String XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME = "XML_REGISTRY__DUPLICATE_XML_ELEMENT_QNAME";
-
- String XML_VALUE__MULTIPLE_MAPPINGS_DEFINED = "XML_VALUE__MULTIPLE_MAPPINGS_DEFINED";
- String XML_VALUE__NO_TEXT_CONTENT = "XML_VALUE__NO_TEXT_CONTENT";
- String XML_VALUE__INVALID_SCHEMA_TYPE = "XML_VALUE__INVALID_SCHEMA_TYPE";
-
- String XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED = "XML_VALUE_MAPPING_WITH_NON_XML_ATTRIBUTE_MAPPING_DEFINED";
-
-
- // general validation
-
- String XML_SCHEMA_TYPE__NON_SIMPLE_TYPE = "XML_SCHEMA_TYPE__NON_SIMPLE_TYPE";
- String XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE = "XML_SCHEMA_TYPE__TYPE_NOT_SPECIFIED_ON_PACKAGE";
- String XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE = "XML_SCHEMA_TYPE__TYPE_SPECIFIED_ON_ATTRIBUTE";
-
- String QNAME__MISSING_NAME = "QNAME__MISSING_NAME";
- String QNAME__UNRESOLVED_COMPONENT = "QNAME__UNRESOLVED_COMPONENT";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
deleted file mode 100644
index 7ae65d3882..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidator.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.internal.validation;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IProjectValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-/**
- * This class is referenced in the JAXB extension for the
- * WTP validator extension point.
- */
-public class JaxbValidator
- extends AbstractValidator
- implements IValidator {
-
- public JaxbValidator() {
- super();
- }
-
-
- // ********** IValidator implementation **********
-
- public void validate(IValidationContext context, IReporter reporter) {
- this.validate(reporter, ((IProjectValidationContext) context).getProject());
- }
-
- public void cleanup(IReporter reporter) {
- // nothing to do
- }
-
-
- // ********** AbstractValidator implementation **********
-
- @Override
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor) {
- if (resource.getType() != IResource.FILE) {
- return null;
- }
- ValidationResult result = new ValidationResult();
- IReporter reporter = result.getReporter(monitor);
- IProject project = resource.getProject();
- this.clearMarkers(project);
- result.setSuspendValidation(project);
- this.validate(reporter, project);
- return result;
- }
-
-
- // ********** internal **********
-
- private void clearMarkers(IProject project) {
- try {
- this.clearMarkers_(project);
- } catch (CoreException ex) {
- JptJaxbCorePlugin.log(ex);
- }
- }
-
- private void clearMarkers_(IProject project) throws CoreException {
- IMarker[] markers = project.findMarkers(JptJaxbCorePlugin.VALIDATION_MARKER_ID, true, IResource.DEPTH_INFINITE);
- for (IMarker marker : markers) {
- marker.delete();
- }
- }
-
- private void validate(IReporter reporter, IProject project) {
- for (IMessage message : this.buildValidationMessages(reporter, project)) {
- // TODO check preferences for IGNORE
-// if (JpaValidationPreferences.problemIsNotIgnored(project, message.getId())) {
- reporter.addMessage(this, message);
-// }
-
- }
- }
-
- private Iterable<IMessage> buildValidationMessages(IReporter reporter, IProject project) {
- JaxbProject jaxbProject = JptJaxbCorePlugin.getJaxbProject(project);
- if (jaxbProject != null) {
- return jaxbProject.getValidationMessages(reporter);
- }
- return new SingleElementIterable<IMessage>(
- DefaultValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JaxbValidationMessages.NO_JAXB_PROJECT,
- project));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java
deleted file mode 100644
index 0790fca4b1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/libprov/JaxbLibraryProviderInstallOperationConfig.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.libprov;
-
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-
-
-public interface JaxbLibraryProviderInstallOperationConfig
- extends JptLibraryProviderInstallOperationConfig {
-
- public static final String PROP_JAXB_PLATFORM = "JAXB_PLATFORM"; //$NON-NLS-1$
-
- JaxbPlatformDescription getJaxbPlatform();
-
- void setJaxbPlatform(JaxbPlatformDescription jaxbPlatform);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
deleted file mode 100644
index 0bd885ac84..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbFile;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-/**
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatform {
-
- JaxbPlatformDescription getDescription();
-
- JaxbPlatformDefinition getDefinition();
-
-
- // ********** factory **********
-
- /**
- * Return a factory responsible for creating core (e.g. JaxbProject), resource
- * (e.g. PersistenceResource), and context (e.g. PersistenceUnit) model
- * objects
- */
- JaxbFactory getFactory();
-
-
- // ********** JAXB files **********
-
- /**
- * Return a JAXB file corresponding to the specified Eclipse file.
- * Return null if the file's content is unsupported.
- */
- JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file);
-
-
- // ********** Java annotations **********
-
- /**
- * Return an annotation provider responsible for determining what Java
- * annotations are supported and constructing java resource model objects.
- */
- AnnotationProvider getAnnotationProvider();
-
- /**
- * Return a formatter that can clean up the Java annotations added to source
- * code.
- */
- AnnotationEditFormatter getAnnotationEditFormatter();
-
-
- // ********** Java attribute mappings **********
-
- Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions();
-
- Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions();
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} that describes the interpretation of the attribute
- * as it exists, complete with annotations. It is assumed that the attribute's default mapping
- * has already been determined.
- * This may not be null (@see {@link NullSpecifiedJavaAttributeMappingDefinition},) else
- * an {@link IllegalStateException} is thrown.
- *
- * @param attribute The persistent attribute to analyze
- * @return The mapping definition describing the annotated state of the attribute
- */
- JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(JaxbPersistentAttribute attribute);
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} for the given mapping key.
- * Throw an {@link IllegalArgumentException} if the key is not supported by the platform.
- */
- JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
deleted file mode 100644
index c1ae7dc1c0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-
-/**
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDefinition {
-
- JaxbPlatformDescription getDescription();
-
- // ***** platform-y questions *****
-
- /**
- * Return the built in schema type name mapped by the given (fully qualified) java type name
- */
- String getSchemaTypeMapping(String javaTypeName);
-
-
- JaxbFactory getFactory();
-
- AnnotationDefinition[] getAnnotationDefinitions();
-
- NestableAnnotationDefinition[] getNestableAnnotationDefinitions();
-
- /**
- * Return the resource model providers that apply to this platform.
- */
- ListIterable<JaxbResourceModelProvider> getResourceModelProviders();
-
- /**
- * Return the most recent resource type for the given content type supported by this platform
- */
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType);
-
-// /**
-// * Return the resource definitions supported by this platform.
-// */
-// ListIterator<ResourceDefinition> resourceDefinitions();
-
- /**
- * Return the mapping definitions to use for default java attribute mappings for this platform.
- */
- Iterable<DefaultJavaAttributeMappingDefinition> getDefaultJavaAttributeMappingDefinitions();
-
- /**
- * Return the mapping definitions to use for specified java attribute mappings for this platform.
- */
- Iterable<JavaAttributeMappingDefinition> getSpecifiedJavaAttributeMappingDefinitions();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java
deleted file mode 100644
index c27161a036..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinitionFactory.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-/**
- * This interface is to be implemented by a JAXB vendor to build a
- * {@link JaxbPlatformDefinition}.
- * <p>
- * See the <code>org.eclipse.jpt.jaxb.core.jaxbPlatforms</code> extension point.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDefinitionFactory {
-
- JaxbPlatformDefinition buildJaxbPlatformDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java
deleted file mode 100644
index 93fc5e47c5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDescription.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Contains metadata that describes a JAXB platform. Not intended to be implemented by clients.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformDescription {
-
- public String getId();
-
- public String getPluginId();
-
- public String getLabel();
-
- public String getFactoryClassName();
-
- public boolean supportsJaxbFacetVersion(IProjectFacetVersion jpaFacetVersion);
-
- public boolean isDefault();
-
- public JaxbPlatformGroupDescription getGroup();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java
deleted file mode 100644
index 607c120a51..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformGroupDescription.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-/**
- * Contains metadata that describes a JAXB platform group. Not intended to be implemented by clients.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformGroupDescription {
-
- public String getId();
-
- public String getPluginId();
-
- public String getLabel();
-
- public Iterable<JaxbPlatformDescription> getPlatforms();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java
deleted file mode 100644
index 1dca3072c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.platform;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Entry point to the "jaxbPlatforms" extension point
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JaxbPlatformManager {
-
- Iterable<JaxbPlatformGroupDescription> getJaxbPlatformGroups();
-
- JaxbPlatformGroupDescription getJaxbPlatformGroup(String groupId);
-
- Iterable<JaxbPlatformDescription> getJaxbPlatforms();
-
- JaxbPlatformDescription getJaxbPlatform(String platformId);
-
- /**
- * Returns the first JAXB platform registered as a default platform and which supports the given
- * JAXB facet version.
- * Returns null if there are no such registered platforms.
- */
- JaxbPlatformDescription getDefaultJaxbPlatform(IProjectFacetVersion jaxbFacetVersion);
-
- JaxbPlatformDefinition buildJaxbPlatformDefinition(IProject project);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
deleted file mode 100644
index 98b9150153..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JAXB.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * JAXB Java-related stuff (annotations etc.)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-@SuppressWarnings("nls")
-public interface JAXB {
-
- // JAXB packages
-
- String JAXB_PACKAGE = "javax.xml.bind";
- String JAXB_PACKAGE_ = JAXB_PACKAGE + '.';
-
- String JAXB_ANNOTATION_PACKAGE = "javax.xml.bind.annotation";
- String JAXB_ANNOTATION_PACKAGE_ = JAXB_ANNOTATION_PACKAGE + '.';
-
- String JAXB_ADAPTERS_PACKAGE = JAXB_ANNOTATION_PACKAGE_ + "adapters";
- String JAXB_ADAPTERS_PACKAGE_ = JAXB_ADAPTERS_PACKAGE + '.';
-
-
- // JAXB annotations
-
- String DEFAULT_STRING = "##default";
-
- String XML_ATTACHMENT_REF = JAXB_ANNOTATION_PACKAGE_ + "XmlAttachmentRef";
-
- String XML_ACCESSOR_ORDER = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessorOrder";
- String XML_ACCESSOR_ORDER__VALUE = "value";
-
- String XML_ACCESSOR_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessorType";
- String XML_ACCESSOR_TYPE__VALUE = "value";
-
- String XML_ANY_ATTRIBUTE = JAXB_ANNOTATION_PACKAGE_ + "XmlAnyAttribute";
-
- String XML_ANY_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlAnyElement";
- String XML_ANY_ELEMENT__LAX = "lax";
- String XML_ANY_ELEMENT__VALUE = "value";
-
- String XML_ATTRIBUTE = JAXB_ANNOTATION_PACKAGE_ + "XmlAttribute";
- String XML_ATTRIBUTE__NAME = "name";
- String XML_ATTRIBUTE__NAMESPACE = "namespace";
- String XML_ATTRIBUTE__REQUIRED = "required";
-
- String XML_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlElement";
- String XML_ELEMENT__NAME = "name";
- String XML_ELEMENT__NAMESPACE = "namespace";
- String XML_ELEMENT__DEFAULT_VALUE = "defaultValue";
- String XML_ELEMENT__NILLABLE = "nillable";
- String XML_ELEMENT__REQUIRED = "required";
- String XML_ELEMENT__TYPE = "type";
-
- String XML_ELEMENT_DECL = JAXB_ANNOTATION_PACKAGE_ + "XmlElementDecl";
- String XML_ELEMENT_DECL__NAME = "name";
- String XML_ELEMENT_DECL__NAMESPACE = "namespace";
- String XML_ELEMENT_DECL__DEFAULT_VALUE = "defaultValue";
- String XML_ELEMENT_DECL__SCOPE = "scope";
- String XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME = "substitutionHeadName";
- String XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE = "substitutionHeadNamespace";
-
- String XML_ELEMENTS = JAXB_ANNOTATION_PACKAGE_ + "XmlElements";
- String XML_ELEMENTS__VALUE = "value";
-
- String XML_ELEMENT_REF = JAXB_ANNOTATION_PACKAGE_ + "XmlElementRef";
- String XML_ELEMENT_REF__NAME = "name";
- String XML_ELEMENT_REF__NAMESPACE = "namespace";
- String XML_ELEMENT_REF__REQUIRED = "required";
- String XML_ELEMENT_REF__TYPE = "type";
-
- String XML_ELEMENT_REFS = JAXB_ANNOTATION_PACKAGE_ + "XmlElementRefs";
- String XML_ELEMENT_REFS__VALUE = "value";
-
- String XML_ELEMENT_WRAPPER = JAXB_ANNOTATION_PACKAGE_ + "XmlElementWrapper";
- String XML_ELEMENT_WRAPPER__NAME = "name";
- String XML_ELEMENT_WRAPPER__NAMESPACE = "namespace";
- String XML_ELEMENT_WRAPPER__NILLABLE = "nillable";
- String XML_ELEMENT_WRAPPER__REQUIRED = "required";
-
- String XML_ENUM = JAXB_ANNOTATION_PACKAGE_ + "XmlEnum";
- String XML_ENUM__VALUE = "value";
-
- String XML_ENUM_VALUE = JAXB_ANNOTATION_PACKAGE_ + "XmlEnumValue";
- String XML_ENUM_VALUE__VALUE = "value";
-
- String XML_INLINE_BINARY_DATA = JAXB_ANNOTATION_PACKAGE_ + "XmlInlineBinaryData";
-
- String XML_ID = JAXB_ANNOTATION_PACKAGE_ + "XmlID";
-
- String XML_IDREF = JAXB_ANNOTATION_PACKAGE_ + "XmlIDREF";
-
- String XML_JAVA_TYPE_ADAPTER = JAXB_ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapter";
- String XML_JAVA_TYPE_ADAPTER__TYPE = "type";
- String XML_JAVA_TYPE_ADAPTER__VALUE = "value";
-
- String XML_JAVA_TYPE_ADAPTERS = JAXB_ADAPTERS_PACKAGE_ + "XmlJavaTypeAdapters";
- String XML_JAVA_TYPE_ADAPTERS__VALUE = "value";
-
- String XML_LIST = JAXB_ANNOTATION_PACKAGE_ + "XmlList";
-
- String XML_MIME_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlMimeType";
- String XML_MIME_TYPE__VALUE = "value";
-
- String XML_MIXED = JAXB_ANNOTATION_PACKAGE_ + "XmlMixed";
-
- String XML_NS = JAXB_ANNOTATION_PACKAGE_ + "XmlNs";
- String XML_NS__NAMESPACE_URI = "namespaceURI";
- String XML_NS__PREFIX = "prefix";
-
- String XML_REGISTRY = JAXB_ANNOTATION_PACKAGE_ + "XmlRegistry";
-
- String XML_ROOT_ELEMENT = JAXB_ANNOTATION_PACKAGE_ + "XmlRootElement";
- String XML_ROOT_ELEMENT__NAME = "name";
- String XML_ROOT_ELEMENT__NAMESPACE = "namespace";
-
- String XML_SCHEMA = JAXB_ANNOTATION_PACKAGE_ + "XmlSchema";
- String XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT = "attributeFormDefault";
- String XML_SCHEMA__ELEMENT_FORM_DEFAULT = "elementFormDefault";
- String XML_SCHEMA__LOCATION = "location";
- String XML_SCHEMA__NAMESPACE = "namespace";
- String XML_SCHEMA__XMLNS = "xmlns";
-
- String XML_SCHEMA_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlSchemaType";
- String XML_SCHEMA_TYPE__NAME = "name";
- String XML_SCHEMA_TYPE__NAMESPACE = "namespace";
- String XML_SCHEMA_TYPE__TYPE = "type";
-
- String XML_SCHEMA_TYPES = JAXB_ANNOTATION_PACKAGE_ + "XmlSchemaTypes";
- String XML_SCHEMA_TYPES__VALUE = "value";
-
- String XML_SEE_ALSO = JAXB_ANNOTATION_PACKAGE_ + "XmlSeeAlso";
- String XML_SEE_ALSO__VALUE = "value";
-
- String XML_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlType";
- String XML_TYPE__FACTORY_CLASS = "factoryClass";
- String XML_TYPE__FACTORY_METHOD = "factoryMethod";
- String XML_TYPE__NAME = "name";
- String XML_TYPE__NAMESPACE = "namespace";
- String XML_TYPE__PROP_ORDER = "propOrder";
- String XML_TYPE__DEFAULT_FACTORY_CLASS = XML_TYPE + ".DEFAULT";
-
- String XML_TRANSIENT = JAXB_ANNOTATION_PACKAGE_ + "XmlTransient";
-
- String XML_VALUE = JAXB_ANNOTATION_PACKAGE_ + "XmlValue";
-
-
- // JAXB enums
-
- String XML_ACCESS_ORDER = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessOrder";
- String XML_ACCESS_ORDER_ = XML_ACCESS_ORDER + '.';
- String XML_ACCESS_ORDER__ALPHABETICAL = XML_ACCESS_ORDER_ + "ALPHABETICAL";
- String XML_ACCESS_ORDER__UNDEFINED = XML_ACCESS_ORDER_ + "UNDEFINED";
-
- String XML_ACCESS_TYPE = JAXB_ANNOTATION_PACKAGE_ + "XmlAccessType";
- String XML_ACCESS_TYPE_ = XML_ACCESS_TYPE + '.';
- String XML_ACCESS_TYPE__FIELD = XML_ACCESS_TYPE_ + "FIELD";
- String XML_ACCESS_TYPE__NONE = XML_ACCESS_TYPE_ + "NONE";
- String XML_ACCESS_TYPE__PROPERTY = XML_ACCESS_TYPE_ + "PROPERTY";
- String XML_ACCESS_TYPE__PUBLIC_MEMBER = XML_ACCESS_TYPE_ + "PUBLIC_MEMBER";
-
- String XML_NS_FORM = JAXB_ANNOTATION_PACKAGE_ + "XmlNsForm";
- String XML_NS_FORM_ = XML_NS_FORM + ".";
- String XML_NS_FORM__QUALIFIED = XML_NS_FORM_ + "QUALIFIED";
- String XML_NS_FORM__UNQUALIFIED = XML_NS_FORM_ + "UNQUALIFIED";
- String XML_NS_FORM__UNSET = XML_NS_FORM_ + "UNSET";
-
-
- // Other JAXB types
-
- String JAXB_ELEMENT = JAXB_PACKAGE_ + "JAXBElement";
-
- String XML_ADAPTER = JAXB_ADAPTERS_PACKAGE_ + "XmlAdapter";
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
deleted file mode 100644
index 5dd3b0d7de..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Super-interface for {@link XmlAttributeAnnotation} and {@link XmlElementAnnotation}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public interface JaxbBasicSchemaComponentAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'required' element of the XmlAttribute annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of the XmlAttribute annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the XmlAttribute annotation.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
deleted file mode 100644
index d87da74fbe..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to JAXB annotations with namespace and name fields
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.?
- */
-public interface QNameAnnotation
- extends Annotation {
-
- /**
- * Constant associated with changes to the 'namespace' property
- */
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespace' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespace();
-
- /**
- * Corresponds to the 'namespace' element of the annotation.
- * Set to null to remove the element.
- */
- void setNamespace(String namespace);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespace' element.
- * Return false if the element does not exist.
- */
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Constant associated with changes to the 'name' property
- */
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
-
- /**
- * Corresponds to the 'name' element of the annotation.
- * Set to null to remove the element.
- */
- void setName(String name);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'name' element.
- * Return false if the element does not exist.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java
deleted file mode 100644
index a7cbac73b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessOrder.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlAccessOrder
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessOrder {
-
- ALPHABETICAL(JAXB.XML_ACCESS_ORDER__ALPHABETICAL),
- UNDEFINED (JAXB.XML_ACCESS_ORDER__UNDEFINED);
-
-
- private String javaAnnotationValue;
-
- XmlAccessOrder(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessOrder fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlAccessOrder fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlAccessOrder accessType : XmlAccessOrder.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlAccessOrder accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java
deleted file mode 100644
index c3b3bd0967..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlAccessType
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlAccessType {
-
- FIELD(JAXB.XML_ACCESS_TYPE__FIELD),
- NONE(JAXB.XML_ACCESS_TYPE__NONE),
- PROPERTY(JAXB.XML_ACCESS_TYPE__PROPERTY),
- PUBLIC_MEMBER(JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
-
-
- private String javaAnnotationValue;
-
- XmlAccessType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlAccessType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlAccessType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlAccessType accessType : XmlAccessType.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlAccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
deleted file mode 100644
index 5eb213ca01..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAccessorOrder
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessorOrderAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorOrder annotation.
- * Return null if the element does not exist in Java.
- */
- XmlAccessOrder getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorOrder annotation.
- * Set to null to remove the element.
- */
- void setValue(XmlAccessOrder value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAccessorOrder annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
deleted file mode 100644
index b10dbac4b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAccessorType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAccessorTypeAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorType annotation.
- * Return null if the element does not exist in Java.
- */
- XmlAccessType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAccessorType annotation.
- * Set to null to remove the element.
- */
- void setValue(XmlAccessType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAccessorType annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java
deleted file mode 100644
index 627356b2dc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAnyAttribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyAttributeAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
deleted file mode 100644
index caf679c903..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAnyElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAnyElementAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'lax' element of the XmlAnyElement annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getLax();
- String LAX_PROPERTY = "lax"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'lax' element of the XmlAnyElement annotation.
- * Set to null to remove the element.
- */
- void setLax(Boolean lax);
-
- /**
- * Return the {@link TextRange} for the 'lax' element. If the element
- * does not exist return the {@link TextRange} for the XmlAnyElement annotation.
- */
- TextRange getLaxTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'value' element of the XmlAnyElement annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlAnyElement(value=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlAnyElement annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlAnyElement annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlAnyElement(value=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java
deleted file mode 100644
index 356c771be3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAttachmentRef
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttachmentRefAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
deleted file mode 100644
index 5fd86552fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010,2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlAttribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlAttributeAnnotation
- extends JaxbBasicSchemaComponentAnnotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
deleted file mode 100644
index c57b458d6a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementAnnotation
- extends JaxbBasicSchemaComponentAnnotation, NestableAnnotation {
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultValue();
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setDefaultValue(String defaultValue);
-
- /**
- * Return the {@link TextRange} for the 'defaultValue' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'nillable' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNillable();
- String NILLABLE_PROPERTY = "nillable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nillable' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setNillable(Boolean nillable);
-
- /**
- * Return the {@link TextRange} for the 'nillable' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getNillableTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'type' element of the XmlElement annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElement(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlElement annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlElement annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElement(type=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedTypeName();
- String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
deleted file mode 100644
index 9b3a83eaea..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementDecl
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementDeclAnnotation
- extends QNameAnnotation {
-
- // ***** scope *****
-
- /**
- * String associated with "scope" property changes.
- */
- String SCOPE_PROPERTY = "scope"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'scope' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElementDecl(type=XmlElementDecl.GLOBAL.class)
- * </pre>
- * will return "XmlElementDecl.GLOBAL"
- */
- String getScope();
-
- /**
- * Corresponds to the 'scope' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setScope(String scope);
-
- /**
- * Return the {@link TextRange} for the 'scope' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getScopeTextRange(CompilationUnit astRoot);
-
- /**
- * String associated with "fullyQualifiedScopeClassName" property changes.
- */
- String FULLY_QUALIFIED_SCOPE_CLASS_NAME_PROPERTY = "fullyQualifiedScopeClassName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified scope class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElementDecl(type=XmlElementDecl.GLOBAL.class)
- * </pre>
- * will return "javax.xml.bind.annotation.XmlElementDecl.GLOBAL"
- */
- String getFullyQualifiedScopeClassName();
-
-
- // ***** substitution head namespace *****
-
- /**
- * String associated with "substitutionHeadNamespace" property changes.
- */
- String SUBSTITUTION_HEAD_NAMESPACE_PROPERTY = "substitutionHeadNamespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadNamespace();
-
- /**
- * Corresponds to the 'substitutionHeadNamespace' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setSubstitutionHeadNamespace(String substitutionHeadNamespace);
-
- /**
- * Return the {@link TextRange} for the 'substitutionHeadNamespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getSubstitutionHeadNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'substitutionHeadNamespace' element.
- * Return false if the element does not exist.
- */
- boolean substitutionHeadNamespaceTouches(int pos, CompilationUnit astRoot);
-
-
- // ***** substitution head name *****
-
- /**
- * String associated with "substitutionHeadName" property changes.
- */
- String SUBSTITUTION_HEAD_NAME_PROPERTY = "substitutionHeadName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getSubstitutionHeadName();
-
- /**
- * Corresponds to the 'substitutionHeadName' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setSubstitutionHeadName(String substitutionHeadName);
-
- /**
- * Return the {@link TextRange} for the 'substitutionHeadName' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getSubstitutionHeadNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'substitutionHeadName' element.
- * Return false if the element does not exist.
- */
- boolean substitutionHeadNameTouches(int pos, CompilationUnit astRoot);
-
-
- // ***** default value *****
-
- /**
- * String associated with "defaultValue" property changes.
- */
- String DEFAULT_VALUE_PROPERTY = "defaultValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultValue();
-
- /**
- * Corresponds to the 'defaultValue' element of the XmlElementDecl annotation.
- * Set to null to remove the element.
- */
- void setDefaultValue(String defaultValue);
-
- /**
- * Return the {@link TextRange} for the 'defaultValue' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementDecl annotation.
- */
- TextRange getDefaultValueTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
deleted file mode 100644
index 6b6d9b873c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementRef
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementRefAnnotation
- extends QNameAnnotation, NestableAnnotation {
-
- // ***** required *****
-
- /**
- * String associated with changes to the 'required' property of this annotation.
- */
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of this annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
-
- /**
- * Corresponds to the 'required' element of this annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-
-
- // ***** type *****
-
- /**
- * String associated with changes to the 'type' property of this annotation.
- */
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of this annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlElementRef(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
-
- /**
- * Corresponds to the 'type' element of this annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the annotation itself.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * String associated with changes to the 'fullyQualifiedName' property of this annotation.
- */
- String FULLY_QUALIFIED_TYPE_NAME_PROPERTY = "fullyQualifiedTypeName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlElementRef(type=Foo.class)
- * </pre>
- * will return "model.Foo" if there is an import for model.Foo.
- * @return
- */
- String getFullyQualifiedTypeName();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java
deleted file mode 100644
index 3b10f27f39..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementRefs
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementRefsAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlElementRefAnnotation> getXmlElementRefs();
- String XML_ELEMENT_REFS_LIST = "xmlElementRefs"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- int getXmlElementRefsSize();
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- XmlElementRefAnnotation xmlElementRefAt(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- XmlElementRefAnnotation addXmlElementRef(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- void moveXmlElementRef(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlElementRefs annotation.
- */
- void removeXmlElementRef(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
deleted file mode 100644
index aaacd081a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElementWrapper
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementWrapperAnnotation
- extends QNameAnnotation {
-
- /**
- * Corresponds to the 'nillable' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNillable();
- String NILLABLE_PROPERTY = "nillable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nillable' element of the XmlElementWrapper annotation.
- * Set to null to remove the element.
- */
- void setNillable(Boolean nillable);
-
- /**
- * Return the {@link TextRange} for the 'nillable' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
- */
- TextRange getNillableTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'required' element of the XmlElementWrapper annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRequired();
- String REQUIRED_PROPERTY = "required"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'required' element of the XmlElementWrapper annotation.
- * Set to null to remove the element.
- */
- void setRequired(Boolean required);
-
- /**
- * Return the {@link TextRange} for the 'required' element. If the element
- * does not exist return the {@link TextRange} for the XmlElementWrapper annotation.
- */
- TextRange getRequiredTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java
deleted file mode 100644
index 016d1806b4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlElementsAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlElementAnnotation> getXmlElements();
- String XML_ELEMENTS_LIST = "xmlElements"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- int getXmlElementsSize();
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- XmlElementAnnotation xmlElementAt(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- XmlElementAnnotation addXmlElement(int index);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- void moveXmlElement(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlElements annotation.
- */
- void removeXmlElement(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
deleted file mode 100644
index 1afc8ca88e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlEnum
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlEnumAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlEnum annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlEnum(value=EnumClass.class)
- * </pre>
- * will return "EnumClass"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlEnum annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlEnum annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified value class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlEnum(value=EnumClass.class)
- * </pre>
- * will return "model.EnumClass" if there is an import for model.EnumClass.
- * @return
- */
- String getFullyQualifiedValueClassName();
- String FULLY_QUALIFIED_VALUE_CLASS_NAME_PROPERTY = "fullyQualifiedValueClassName"; //$NON-NLS-1$
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
deleted file mode 100644
index 6d70a2843c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlEnumValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlEnumValueAnnotation
- extends Annotation {
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
-
- /**
- * Corresponds to the 'value' element of the XmlEnumValue annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlEnumValue annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the given position touches the 'value' element value.
- */
- boolean valueTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java
deleted file mode 100644
index e783bd107a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlID
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java
deleted file mode 100644
index c6cfad2def..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlIDREF
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlIDREFAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java
deleted file mode 100644
index c299919dbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlInlineBinaryData
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlInlineBinaryDataAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
deleted file mode 100644
index 3abc2cdead..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlJavaTypeAdapterAnnotation
- extends NestableAnnotation {
-
- /**
- * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(value=FooAdapter.class)
- * </pre>
- * will return "FooAdapter"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the value's fully-qualified class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlJavaTypeAdapter(FooAdapter.class)
- * </pre>
- * will return "example.FooAdapter" if there is an import for example.FooAdapter.
- */
- String getFullyQualifiedValue();
- String FULLY_QUALIFIED_VALUE_PROPERTY = "fullyQualifiedValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlJavaTypeAdapter annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlJavaTypeAdapter(type=Foo.class)
- * </pre>
- * will return "Foo"
- */
- String getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlJavaTypeAdapter annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlJavaTypeAdapter annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- /**
- * Return the type's fully-qualified class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlJavaTypeAdapter(type=Foo.class)
- * </pre>
- * will return "example.Foo" if there is an import for example.Foo.
- */
- String getFullyQualifiedType();
- String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java
deleted file mode 100644
index 5446e4681f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlList
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlListAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
deleted file mode 100644
index 773ade4495..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlMimeType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMimeTypeAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'value' element of the XmlMimeType annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlMimeType annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the XmlMimeType annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java
deleted file mode 100644
index a792c4215f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlMixed
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlMixedAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
deleted file mode 100644
index fc9a9d8232..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlNs
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlNsAnnotation
- extends NestableAnnotation {
-
- // ***** namespaceURI *****
-
- String NAMESPACE_URI_PROPERTY = "namespaceURI"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespaceURI();
-
- /**
- * Corresponds to the 'namespaceURI' element of the XmlNs annotation.
- * Set to null to remove the element.
- */
- void setNamespaceURI(String namespaceURI);
-
- /**
- * Return the {@link TextRange} for the 'namespaceURI' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getNamespaceURITextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespaceURI' element.
- * Return false if the element does not exist.
- */
- boolean namespaceURITouches(int pos, CompilationUnit astRoot);
-
-
- // ***** prefix *****
-
- String PREFIX_PROPERTY = "prefix"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Return null if the element does not exist in Java.
- */
- String getPrefix();
-
- /**
- * Corresponds to the 'prefix' element of the XmlNs annotation.
- * Set to null to remove the element.
- */
- void setPrefix(String prefix);
-
- /**
- * Return the {@link TextRange} for the 'prefix' element. If the element
- * does not exist return the {@link TextRange} for the XmlNs annotation.
- */
- TextRange getPrefixTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'prefix' element.
- * Return false if the element does not exist.
- */
- boolean prefixTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
deleted file mode 100644
index 4d73541c8f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsForm.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-/**
- * Corresponds to the JAXB enum
- * javax.xml.bind.annotation.XmlNsForm
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public enum XmlNsForm {
-
- QUALIFIED(JAXB.XML_NS_FORM__QUALIFIED),
- UNQUALIFIED(JAXB.XML_NS_FORM__UNQUALIFIED),
- UNSET(JAXB.XML_NS_FORM__UNSET);
-
-
- private String javaAnnotationValue;
-
- XmlNsForm(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static XmlNsForm fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static XmlNsForm fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (XmlNsForm nsForm : XmlNsForm.values()) {
- if (nsForm.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return nsForm;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(XmlNsForm nsForm) {
- return (nsForm == null) ? null : nsForm.getJavaAnnotationValue();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java
deleted file mode 100644
index 07e6aef4d2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlRegistry
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRegistryAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java
deleted file mode 100644
index e18fc961e2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlRootElement
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlRootElementAnnotation
- extends QNameAnnotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
deleted file mode 100644
index 0908506c0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSchema
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaAnnotation
- extends Annotation {
-
- /**
- * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- XmlNsForm getAttributeFormDefault();
- String ATTRIBUTE_FORM_DEFAULT_PROPERTY = "attributeFormDefault"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setAttributeFormDefault(XmlNsForm attributeFormDefault);
-
- /**
- * Return the {@link TextRange} for the 'attributeFormDefault' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getAttributeFormDefaultTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- XmlNsForm getElementFormDefault();
- String ELEMENT_FORM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'elementFormDefault' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setElementFormDefault(XmlNsForm elementFormDefault);
-
- /**
- * Return the {@link TextRange} for the 'elementFormDefault' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getElementFormDefaultTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'location' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- String getLocation();
- String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'location' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setLocation(String location);
-
- /**
- * Return the {@link TextRange} for the 'location' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getLocationTextRange(CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchema annotation.
- * Return null if the element does not exist in Java.
- */
- String getNamespace();
- String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'namespace' element of the XmlSchema annotation.
- * Set to null to remove the element.
- */
- void setNamespace(String namespace);
-
- /**
- * Return the {@link TextRange} for the 'namespace' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchema annotation.
- */
- TextRange getNamespaceTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'namespace' element.
- * Return false if the element does not exist.
- */
- boolean namespaceTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<XmlNsAnnotation> getXmlns();
- String XMLNS_LIST = "xmlns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- int getXmlnsSize();
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annnotation.
- */
- XmlNsAnnotation xmlnsAt(int index);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- XmlNsAnnotation addXmlns(int index);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- void moveXmlns(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'xmlns' element of the XmlSchema annotation.
- */
- void removeXmlns(int index);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
deleted file mode 100644
index f6a255e72c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSchemaType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSchemaTypeAnnotation
- extends QNameAnnotation, NestableAnnotation {
-
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the XmlSchemaType annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
- * </pre>
- * will return "XMLGregorianCalendar"
- */
- String getType();
-
- /**
- * Corresponds to the 'type' element of the XmlSchemaType annotation.
- * Set to null to remove the element.
- */
- void setType(String type);
-
- /**
- * Return the {@link TextRange} for the 'type' element. If the element
- * does not exist return the {@link TextRange} for the XmlSchemaType annotation.
- */
- TextRange getTypeTextRange(CompilationUnit astRoot);
-
- String FULLY_QUALIFIED_TYPE_PROPERTY = "fullyQualifiedType"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified type name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlSchemaType(name="date", type=XMLGregorianCalendar.class)
- * </pre>
- * will return "javax.xml.datatype.XMLGregorianCalendar" if there is an import for
- * javax.xml.datatype.XMLGregorianCalendar.
- * @return
- */
- String getFullyQualifiedType();
-
- /**
- * The default type when none is specified
- */
- String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
deleted file mode 100644
index 102f86401e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlSeeAlso
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlSeeAlsoAnnotation
- extends Annotation {
-
- /**
- * Change notification constant associated with the value element
- */
- String CLASSES_LIST = "classes"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- * Return an empty iterator if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlSeeAlso({Foo.class, Bar.class})
- * </pre>
- * will return and iterable containing: "Foo", "Bar"
- */
- ListIterable<String> getClasses();
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- int getClassesSize();
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void addClass(String clazz);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void addClass(int index, String clazz);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void moveClass(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'value' element of the XmlSeeAlso annotation.
- */
- void removeClass(int index);
-
- /**
- * Change notification constant associated with the fully qualified classes.
- * Changes should occur whenever changes occur to the "classes" list, but
- * may also occur with changes to the classes resolution state (import changes, e.g.)
- */
- String FULLY_QUALIFIED_CLASSES_LIST = "fullyQualifiedClasses"; //$NON-NLS-1$
-
- /**
- * Return the value elements resolved to fully qualified class names
- */
- ListIterable<String> getFullyQualifiedClasses();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java
deleted file mode 100644
index f2d67206d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlTransient
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlTransientAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
deleted file mode 100644
index 781cde998e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.?
- * @since 3.0
- */
-public interface XmlTypeAnnotation
- extends QNameAnnotation {
-
- // ***** factory class *****
-
- String FACTORY_CLASS_PROPERTY = "factoryClass"; //$NON-NLS-1$
-
- String DEFAULT_FACTORY_CLASS = JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS;
-
- /**
- * Corresponds to the 'factoryClass' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class)
- * </pre>
- * will return "USAddressFactory"
- */
- String getFactoryClass();
-
- /**
- * Corresponds to the 'factoryClass' element of the XmlType annotation.
- * Set to null to remove the element.
- */
- void setFactoryClass(String factoryClass);
-
- /**
- * Return the {@link TextRange} for the 'factoryClass' element. If the element
- * does not exist return the {@link TextRange} for the XmlType annotation.
- */
- TextRange getFactoryClassTextRange(CompilationUnit astRoot);
-
- String FULLY_QUALIFIED_FACTORY_CLASS_NAME_PROPERTY = "fullyQualifiedFactoryClassName"; //$NON-NLS-1$
-
- /**
- * Return the fully-qualified factory class name as resolved by the AST's bindings.
- * <pre>
- * &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class)
- * </pre>
- * will return "model.USAddressFactory" if there is an import for model.USAddressFactory.
- * @return
- */
- String getFullyQualifiedFactoryClassName();
-
-
- // ***** factory method *****
-
- String FACTORY_METHOD_PROPERTY = "factoryMethod"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Return null if the element does not exist in Java.
- */
- String getFactoryMethod();
-
- /**
- * Corresponds to the 'factoryMethod' element of the XmlType annotation.
- * Set to null to remove the element.
- */
- void setFactoryMethod(String factoryMethod);
-
- /**
- * Return the {@link TextRange} for the 'factoryMethod' element. If the element
- * does not exist return the {@link TextRange} for the XmlType annotation.
- */
- TextRange getFactoryMethodTextRange(CompilationUnit astRoot);
-
-
- // ***** prop order *****
-
- String PROP_ORDER_LIST = "propOrder"; //$NON-NLS-1$
-
- /**
- * A single element empty string array should be interpreted as unspecified
- */
- String[] DEFAULT_PROP_ORDER = new String[] { "" };
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<String> getPropOrder();
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- int getPropOrderSize();
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void addProp(String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void addProp(int index, String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void moveProp(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void removeProp(String prop);
-
- /**
- * Corresponds to the 'propOrder' element of the XmlType annotation.
- */
- void removeProp(int index);
-
- /**
- * Return the text range of the 'propOrder' element of the XmlType annotation.
- */
- TextRange getPropOrderTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'propOrder' element.
- * Return false if the element does not exist.
- */
- boolean propOrderTouches(int pos, CompilationUnit astRoot);
-
- /**
- * Return the text range of the prop at the specified index
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- TextRange getPropTextRange(int index, CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the prop at the specified index.
- * @throws ArrayIndexOutOfBoundsException if the index is out of range
- */
- boolean propTouches(int index, int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java
deleted file mode 100644
index b1936550e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the JAXB annotation
- * javax.xml.bind.annotation.XmlValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface XmlValueAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
deleted file mode 100644
index 22275336cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbindex/JaxbIndexResource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.jaxbindex;
-
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-
-public interface JaxbIndexResource
- extends JptResourceModel {
-
- String getPackageName();
-
- Iterable<String> getFullyQualifiedClassNames();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
deleted file mode 100644
index 8d0931ae4e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/jaxbprops/JaxbPropertiesResource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.resource.jaxbprops;
-
-import org.eclipse.jpt.common.core.JptResourceModel;
-
-
-public interface JaxbPropertiesResource
- extends JptResourceModel {
-
- String getPackageName();
-
- String getProperty(String propertyName);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java
deleted file mode 100644
index 81c7a42a80..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XSDNodeVisitor.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.util.Stack;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDComponent;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.util.XSDSwitch;
-
-
-public class XSDNodeVisitor {
-
- private Stack<XSDComponent> visitedNodeStack = new Stack<XSDComponent>();
-
- protected boolean visitChildren = true;
-
- protected boolean visitChildren() {
- return this.visitChildren;
- }
-
- public void visitNode(XSDComponent node) {
- if (node != null && ! visitedNodeStack.contains(node)) {
- visitedNodeStack.push(node);
- XSDSwitch xsdSwitch = new XSDSwitch() {
- @Override
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
- visitXSDAttributeDeclaration(object);
- return null;
- }
-
- @Override
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
- visitXSDAttributeGroupDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDAttributeUse(XSDAttributeUse object) {
- visitXSDAttributeUse(object);
- return null;
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- visitXSDComplexTypeDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- visitXSDElementDeclaration(object);
- return null;
- }
-
- @Override
- public Object caseXSDModelGroup(XSDModelGroup object) {
- visitXSDModelGroup(object);
- return null;
- }
-
- @Override
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
- visitXSDModelGroupDefinition(object);
- return null;
- }
-
- @Override
- public Object caseXSDParticle(XSDParticle object) {
- visitXSDParticle(object);
- return null;
- }
-
- @Override
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- visitXSDSimpleTypeDefinition(object);
- return null;
- }
- };
- xsdSwitch.doSwitch(node);
- visitedNodeStack.pop();
- }
- }
-
- public void visitXSDAttributeDeclaration(XSDAttributeDeclaration node) {}
-
- public void visitXSDAttributeGroupDefinition(XSDAttributeGroupDefinition node) {
- if (visitChildren()) {
- for (XSDAttributeUse attrUse : node.getAttributeUses()) {
- visitNode(attrUse);
- }
- }
- }
-
- public void visitXSDAttributeUse(XSDAttributeUse node) {}
-
- public void visitXSDComplexTypeDefinition(XSDComplexTypeDefinition node) {
- if (node.getBaseType() != null) {
- visitNode(node.getBaseType());
- }
-
- if (visitChildren()) {
- for (XSDAttributeUse attrUse : node.getAttributeUses()) {
- visitNode(attrUse);
- }
-
- if (node.getContent() != null) {
- visitNode(node.getContent());
- }
- }
- }
-
- public void visitXSDElementDeclaration(XSDElementDeclaration node) {
- for (XSDElementDeclaration element : node.getSubstitutionGroup()) {
- visitNode(element);
- }
-
- if (visitChildren()) {
- if (node.getTypeDefinition() != null) {
- visitNode(node.getTypeDefinition());
- }
- }
- }
-
- public void visitXSDModelGroup(XSDModelGroup node) {
- if (visitChildren()) {
- for (XSDParticle particle : node.getParticles()) {
- visitNode(particle);
- }
- }
- }
-
- public void visitXSDModelGroupDefinition(XSDModelGroupDefinition node) {
- if (node.getModelGroup() != null) {
- visitNode(node.getModelGroup());
- }
- }
-
- public void visitXSDParticle(XSDParticle node) {
- if (node.getTerm() != null) {
- visitNode(node.getTerm());
- }
- }
-
- public void visitXSDSimpleTypeDefinition(XSDSimpleTypeDefinition node) {
- if (node.getBaseType() != null) {
- visitNode(node.getBaseType());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java
deleted file mode 100644
index df54aa1b8a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeDeclaration.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-
-public class XsdAttributeDeclaration
- extends XsdFeature<XSDAttributeDeclaration> {
-
- XsdAttributeDeclaration(XSDAttributeDeclaration xsdAttributeDeclaration) {
- super(xsdAttributeDeclaration);
- }
-
-
- @Override
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = getXSDComponent().getType();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-
- @Override
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType) {
- return getType().typeIsValid(xsdType, isItemType);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java
deleted file mode 100644
index 3feb1b3778..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeGroupDefinition.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-
-
-public class XsdAttributeGroupDefinition
- extends XsdComponent<XSDAttributeGroupDefinition> {
-
- XsdAttributeGroupDefinition(XSDAttributeGroupDefinition xsdAttributeGroupDefinition) {
- super(xsdAttributeGroupDefinition);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java
deleted file mode 100644
index 059cfd3654..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdAttributeUse.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeUse;
-
-
-public class XsdAttributeUse
- extends XsdComponent<XSDAttributeUse> {
-
-
- XsdAttributeUse(XSDAttributeUse xsdAttributeUse) {
- super(xsdAttributeUse);
- }
-
-
- public XsdAttributeDeclaration getAttributeDeclaration() {
- XSDAttributeDeclaration xsdAttribute = getXSDComponent().getAttributeDeclaration();
- return (xsdAttribute == null) ? null : (XsdAttributeDeclaration) XsdUtil.getAdapter(xsdAttribute);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
deleted file mode 100644
index 2102907758..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComplexTypeDefinition.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDContentTypeCategory;
-import org.eclipse.xsd.XSDElementDeclaration;
-
-
-public class XsdComplexTypeDefinition
- extends XsdTypeDefinition<XSDComplexTypeDefinition> {
-
- XsdComplexTypeDefinition(XSDComplexTypeDefinition xsdComplexTypeDefinition) {
- super(xsdComplexTypeDefinition);
- }
-
-
- @Override
- public org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition.Kind getKind() {
- return Kind.COMPLEX;
- }
-
- @Override
- public boolean hasTextContent() {
- return getXSDComponent().getContentTypeCategory() == XSDContentTypeCategory.SIMPLE_LITERAL;
- }
-
- @Override
- public XsdAttributeUse getAttribute(String namespace, String name) {
- for (XsdAttributeUse attrUse : getAttributeUses(namespace)) {
- if (attrUse.getXSDComponent().getAttributeDeclaration().getName().equals(name)) {
- return attrUse;
- }
- }
- return null;
- }
-
- @Override
- public Iterable<String> getAttributeNames(String namespace) {
- return new TransformationIterable<XsdAttributeUse, String>(getAttributeUses(namespace)) {
- @Override
- protected String transform(XsdAttributeUse attrUse) {
- return attrUse.getXSDComponent().getAttributeDeclaration().getName();
- }
- };
- }
-
- protected Iterable<XsdAttributeUse> getAttributeUses(final String namespace) {
- return new TransformationIterable<XSDAttributeUse, XsdAttributeUse>(
- new FilteringIterable<XSDAttributeUse>(getXSDComponent().getAttributeUses()) {
- @Override
- protected boolean accept(XSDAttributeUse attrUse) {
- return XsdUtil.namespaceEquals(attrUse.getAttributeDeclaration(), namespace);
- }
- }) {
- @Override
- protected XsdAttributeUse transform(XSDAttributeUse attrUse) {
- return (XsdAttributeUse) XsdUtil.getAdapter(attrUse);
- }
- };
- }
-
- @Override
- public XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren) {
- for (XsdElementDeclaration element : getElementDeclarations(namespace, recurseChildren)) {
- if (element.getXSDComponent().getName().equals(name)) {
- return element;
- }
- }
- return null;
- }
-
- @Override
- public Iterable<String> getElementNames(String namespace, boolean recurseChildren) {
- return new TransformationIterable<XsdElementDeclaration, String>(getElementDeclarations(namespace, recurseChildren)) {
- @Override
- protected String transform(XsdElementDeclaration element) {
- return element.getXSDComponent().getName();
- }
- };
- }
-
- protected Iterable<XsdElementDeclaration> getElementDeclarations(final String namespace, boolean recurseChildren) {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(
- new FilteringIterable<XSDElementDeclaration>(getXSDElementDeclarations(recurseChildren)) {
- @Override
- protected boolean accept(XSDElementDeclaration element) {
- return XsdUtil.namespaceEquals(element, namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration element) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(element);
- }
- };
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations(boolean recurseChildren) {
- ElementFinder elementFinder = new ElementFinder(recurseChildren);
- elementFinder.visitNode(getXSDComponent());
- return elementFinder.getElements();
- }
-
-
- private class ElementFinder
- extends XSDNodeVisitor {
-
- private boolean recurseChildren;
-
- private List<XSDElementDeclaration> elements = new ArrayList<XSDElementDeclaration>();
-
-
- private ElementFinder(boolean recurseChildren) {
- this.recurseChildren = recurseChildren;
- }
-
-
- @Override
- protected boolean visitChildren() {
- return super.visitChildren() || this.recurseChildren;
- }
-
- @Override
- public void visitXSDElementDeclaration(XSDElementDeclaration node) {
- boolean cachedVisitChildren = this.visitChildren;
- this.visitChildren = false;
- super.visitXSDElementDeclaration(node);
- if (! this.elements.contains(node)) {
- elements.add(node);
- }
- this.visitChildren = cachedVisitChildren;
- }
-
- public Iterable<XSDElementDeclaration> getElements() {
- return this.elements;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java
deleted file mode 100644
index fb7fec486b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdComponent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.xsd.XSDConcreteComponent;
-
-
-public class XsdComponent<A extends XSDConcreteComponent>
- extends AdapterImpl {
-
- protected final A xsdComponent;
-
-
- protected XsdComponent(A xsdComponent) {
- super();
- this.xsdComponent = xsdComponent;
- }
-
-
- public A getXSDComponent() {
- return this.xsdComponent;
- }
-
- @Override
- public boolean isAdapterForType(Object type) {
- return type == XsdUtil.adapterFactory;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java
deleted file mode 100644
index 4f9572fb0e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdElementDeclaration.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSubstitutionGroupExclusions;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Adds API to {@link XSDElementDeclaration}.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.1
- */
-public class XsdElementDeclaration
- extends XsdFeature<XSDElementDeclaration> {
-
- XsdElementDeclaration(XSDElementDeclaration xsdElementDeclaration) {
- super(xsdElementDeclaration);
- }
-
-
- public XSDElementDeclaration getXSDElementDeclaration() {
- return getXSDFeature();
- }
-
- @Override
- public XsdTypeDefinition getType() {
- XSDTypeDefinition xsdType = getXSDElementDeclaration().getTypeDefinition();
- return (xsdType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdType);
- }
-
- @Override
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType) {
- XSDElementDeclaration xsdElement = getXSDComponent();
- boolean allowExtension = true;
- boolean allowRestriction = true;
- XSDElementDeclaration xsdSubstitutionGroupAffiliation = xsdElement.getSubstitutionGroupAffiliation();
- if (xsdSubstitutionGroupAffiliation != null) {
- EList<XSDSubstitutionGroupExclusions> xsdSubstitutionGroupExclusions
- = xsdSubstitutionGroupAffiliation.getSubstitutionGroupExclusions();
- allowExtension = ! xsdSubstitutionGroupExclusions.contains(XSDSubstitutionGroupExclusions.EXTENSION_LITERAL);
- allowRestriction = ! xsdSubstitutionGroupExclusions.contains(XSDSubstitutionGroupExclusions.RESTRICTION_LITERAL);
- }
- return getType().typeIsValid(xsdType, isItemType, allowExtension, allowRestriction);
- }
-
- public XsdElementDeclaration getElement(String namespace, String name) {
- XsdTypeDefinition type = getType();
- return (type == null) ? null : type.getElement(namespace, name);
- }
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return getType().getElementNameProposals(namespace, filter);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java
deleted file mode 100644
index 120f69dfe9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdFeature.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDFeature;
-
-
-public abstract class XsdFeature<A extends XSDFeature>
- extends XsdComponent<A> {
-
- protected XsdFeature(A xsdFeature) {
- super(xsdFeature);
- }
-
-
- public A getXSDFeature() {
- return getXSDComponent();
- }
-
- public String getName() {
- return getXSDFeature().getName();
- }
-
- public abstract XsdTypeDefinition getType();
-
- /**
- * Return whether the given schema type is valid within the feature
- * @param isItemType determines whether the xsdType should instead be treated as an item type
- * within a list
- */
- public abstract boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java
deleted file mode 100644
index ecda07b617..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroup.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDModelGroup;
-
-
-public class XsdModelGroup
- extends XsdComponent<XSDModelGroup> {
-
- XsdModelGroup(XSDModelGroup xsdModelGroup) {
- super(xsdModelGroup);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java
deleted file mode 100644
index 7e9c2a7385..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdModelGroupDefinition.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDModelGroupDefinition;
-
-
-public class XsdModelGroupDefinition
- extends XsdComponent<XSDModelGroupDefinition> {
-
- XsdModelGroupDefinition(XSDModelGroupDefinition xsdModelGroupDefinition) {
- super(xsdModelGroupDefinition);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java
deleted file mode 100644
index 23bbf9c99e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdParticle.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.xsd.XSDParticle;
-
-
-public class XsdParticle
- extends XsdComponent<XSDParticle> {
-
- XsdParticle(XSDParticle xsdParticle) {
- super(xsdParticle);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
deleted file mode 100644
index 8fc31d0473..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSchema.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SnapshotCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDTypeDefinition;
-import org.eclipse.xsd.util.XSDUtil;
-
-public class XsdSchema
- extends XsdComponent<XSDSchema> {
-
- XsdSchema(XSDSchema xsdSchema) {
- super(xsdSchema);
- }
-
-
- public XSDSchema getXSDSchema() {
- return getXSDComponent();
- }
-
- public Iterable<String> getNamespaces() {
- Iterable<String> result = new SnapshotCloneIterable(getXSDSchema().getQNamePrefixToNamespaceMap().values());
- if (StringTools.stringIsEmpty(getXSDSchema().getTargetNamespace())) {
- result = new CompositeIterable<String>("", result);
- }
- return result;
- }
-
- public Iterable<XsdTypeDefinition> getAllTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getAllXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getDeclaredTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getDeclaredXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getBuiltInTypeDefinitions() {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getBuiltInXSDTypeDefinitions()) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdTypeDefinition> getTypeDefinitions(final String namespace) {
- return new TransformationIterable<XSDTypeDefinition, XsdTypeDefinition>(getXSDTypeDefinitions(namespace)) {
- @Override
- protected XsdTypeDefinition transform(XSDTypeDefinition o) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdSimpleTypeDefinition> getSimpleTypeDefinitions(final String namespace) {
- return new TransformationIterable<XSDSimpleTypeDefinition, XsdSimpleTypeDefinition>(
- getXSDSimpleTypeDefinitions(namespace)) {
- @Override
- protected XsdSimpleTypeDefinition transform(XSDSimpleTypeDefinition o) {
- return (XsdSimpleTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- /**
- * by default, return a type with the given name and the schema's target namespace
- */
- public XsdTypeDefinition getTypeDefinition(String name) {
- return getTypeDefinition(getXSDComponent().getTargetNamespace(), name);
- }
-
- public XsdTypeDefinition getTypeDefinition(String namespace, String name) {
- for (XSDTypeDefinition typeDefinition : getXSDTypeDefinitions(namespace)) {
- if (XsdUtil.namespaceEquals(typeDefinition, namespace) && typeDefinition.getName().equals(name)) {
- return (XsdTypeDefinition) XsdUtil.getAdapter(typeDefinition);
- }
- }
- return null;
- }
-
- protected Iterable<XSDTypeDefinition> getAllXSDTypeDefinitions() {
- return new CompositeIterable<XSDTypeDefinition>(
- getDeclaredXSDTypeDefinitions(), getBuiltInXSDTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getDeclaredXSDTypeDefinitions() {
- return new SnapshotCloneIterable(getXSDSchema().getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getBuiltInXSDTypeDefinitions() {
- return new SnapshotCloneIterable(getXSDSchema().getSchemaForSchema().getTypeDefinitions());
- }
-
- protected Iterable<XSDTypeDefinition> getXSDTypeDefinitions(final String namespace) {
- if (XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001.equals(namespace)) {
- return getBuiltInXSDTypeDefinitions();
- }
- return new FilteringIterable<XSDTypeDefinition>(getDeclaredXSDTypeDefinitions()) {
- @Override
- protected boolean accept(XSDTypeDefinition o) {
- return XsdUtil.namespaceEquals(o, namespace);
- }
- };
- }
-
- protected Iterable<XSDSimpleTypeDefinition> getXSDSimpleTypeDefinitions(String namespace) {
- return new TransformationIterable<XSDTypeDefinition, XSDSimpleTypeDefinition>(
- new FilteringIterable<XSDTypeDefinition>(getXSDTypeDefinitions(namespace)) {
- @Override
- protected boolean accept(XSDTypeDefinition o) {
- return o instanceof XSDSimpleTypeDefinition;
- }
- }) {
- @Override
- protected XSDSimpleTypeDefinition transform(XSDTypeDefinition o) {
- return (XSDSimpleTypeDefinition) o;
- }
- };
- }
-
- public Iterable<XsdElementDeclaration> getElementDeclarations() {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(getXSDElementDeclarations()) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public Iterable<XsdElementDeclaration> getElementDeclarations(final String namespace) {
- return new TransformationIterable<XSDElementDeclaration, XsdElementDeclaration>(
- new FilteringIterable<XSDElementDeclaration>(getXSDElementDeclarations()) {
- @Override
- protected boolean accept(XSDElementDeclaration o) {
- return XsdUtil.namespaceEquals(o, namespace);
- }
- }) {
- @Override
- protected XsdElementDeclaration transform(XSDElementDeclaration o) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(o);
- }
- };
- }
-
- public XsdElementDeclaration getElementDeclaration(String namespace, String name) {
- for (XSDElementDeclaration elementDeclaration : getXSDElementDeclarations()) {
- if (XsdUtil.namespaceEquals(elementDeclaration, namespace) && elementDeclaration.getName().equals(name)) {
- return (XsdElementDeclaration) XsdUtil.getAdapter(elementDeclaration);
- }
- }
- return null;
- }
-
- protected Iterable<XSDElementDeclaration> getXSDElementDeclarations() {
- return new SnapshotCloneIterable(getXSDSchema().getElementDeclarations());
- }
-
- public Iterable<String> getNamespaceProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getNamespaces(), filter));
- }
-
- public Iterable<String> getTypeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdTypeDefinition, String>(this.getTypeDefinitions(namespace)) {
- @Override
- protected String transform(XsdTypeDefinition o) {
- return o.getName();
- }
- },
- filter));
- }
-
- public Iterable<String> getSimpleTypeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdSimpleTypeDefinition, String>(this.getSimpleTypeDefinitions(namespace)) {
- @Override
- protected String transform(XsdSimpleTypeDefinition o) {
- return o.getName();
- }
- },
- filter));
- }
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XsdElementDeclaration, String>(this.getElementDeclarations(namespace)) {
- @Override
- protected String transform(XsdElementDeclaration o) {
- return o.getName();
- }
- },
- filter));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java
deleted file mode 100644
index ee467ba76f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdSimpleTypeDefinition.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.xsd.XSDEnumerationFacet;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.XSDVariety;
-
-
-public class XsdSimpleTypeDefinition
- extends XsdTypeDefinition<XSDSimpleTypeDefinition> {
-
- XsdSimpleTypeDefinition(XSDSimpleTypeDefinition xsdSimpleTypeDefinition) {
- super(xsdSimpleTypeDefinition);
- }
-
-
- @Override
- public org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition.Kind getKind() {
- return Kind.SIMPLE;
- }
-
- @Override
- public boolean hasTextContent() {
- return true;
- }
-
- @Override
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType, boolean allowExtension, boolean allowRestriction) {
- if (isItemType) {
- XsdSimpleTypeDefinition itemType = getItemType();
- return (itemType == null) ? false : itemType.typeIsValid(xsdType, false, allowExtension, allowRestriction);
- }
- if (getXSDComponent().getVariety() == XSDVariety.UNION_LITERAL) {
- if (XsdUtil.getSchemaForSchema().getTypeDefinition("string").typeIsValid(xsdType, isItemType, allowExtension, allowRestriction)) {
- return true;
- }
- }
- return super.typeIsValid(xsdType, isItemType, allowExtension, allowRestriction);
- }
-
- /**
- * If the type is of variety LIST, this will return the item type of the list
- */
- public XsdSimpleTypeDefinition getItemType() {
- XSDSimpleTypeDefinition xsdItemType = getXSDComponent().getItemTypeDefinition();
- return (xsdItemType == null) ? null : (XsdSimpleTypeDefinition) XsdUtil.getAdapter(xsdItemType);
- }
-
- /**
- * If the type is of variety UNION, this will return the member types of the union
- */
- public Iterable<XsdSimpleTypeDefinition> getMemberTypes() {
- return new TransformationIterable<XSDSimpleTypeDefinition, XsdSimpleTypeDefinition>(
- getXSDComponent().getMemberTypeDefinitions()) {
- @Override
- protected XsdSimpleTypeDefinition transform(XSDSimpleTypeDefinition o) {
- return (XsdSimpleTypeDefinition) XsdUtil.getAdapter(o);
- }
- };
- }
-
- @Override
- public XsdAttributeUse getAttribute(String namespace, String name) {
- // simple types have no attributes
- return null;
- }
-
- @Override
- public Iterable<String> getAttributeNames(String namespace) {
- // simple types have no attributes
- return EmptyIterable.instance();
- }
-
- @Override
- public XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren) {
- // simple types have no elements
- return null;
- }
-
- @Override
- public Iterable<String> getElementNames(String namespace, boolean recurseChildren) {
- // simple types have no elements
- return EmptyIterable.instance();
- }
-
- public Iterable<String> getEnumValueProposals(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<XSDEnumerationFacet, String>(getXSDComponent().getEnumerationFacets()) {
- @Override
- protected String transform(XSDEnumerationFacet enumFacet) {
- return enumFacet.getLexicalValue();
- }
- },
- filter));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java
deleted file mode 100644
index ea01a47c96..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdTypeDefinition.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.xsd.XSDTypeDefinition;
-
-/**
- * Adds API to {@link XSDTypeDefinition}.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.1
- */
-public abstract class XsdTypeDefinition<A extends XSDTypeDefinition>
- extends XsdComponent<A> {
-
- protected XsdTypeDefinition(A xsdTypeDefinition) {
- super(xsdTypeDefinition);
- }
-
-
- // for some reason, the compiler is not recognizing the XSD component of this type as extending
- // XSDTypeDefinition without implementing this method.
- @Override
- public A getXSDComponent() {
- return super.getXSDComponent();
- }
-
- public abstract Kind getKind();
-
- public String getName() {
- return getXSDComponent().getName();
- }
-
- public abstract boolean hasTextContent();
-
- public boolean matches(String namespace, String name) {
- return XsdUtil.namespaceEquals(getXSDComponent(), namespace) && StringTools.stringsAreEqual(getName(), name);
- }
-
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType) {
- return typeIsValid(xsdType, isItemType, true, true);
- }
-
- public boolean typeIsValid(XsdTypeDefinition xsdType, boolean isItemType, boolean allowExtension, boolean allowRestriction) {
- return getXSDComponent().getBadTypeDerivation(xsdType.getXSDComponent(), allowExtension, allowRestriction) == null;
- }
-
- public XsdTypeDefinition getBaseType() {
- XSDTypeDefinition xsdBaseType = getXSDComponent().getBaseType();
- return (xsdBaseType == null) ? null : (XsdTypeDefinition) XsdUtil.getAdapter(xsdBaseType);
- }
-
- public abstract XsdAttributeUse getAttribute(String namespace, String name);
-
- public Iterable<String> getAttributeNameProposals(String namespace, Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getAttributeNames(namespace), filter));
- }
-
- public abstract Iterable<String> getAttributeNames(String namespace);
-
- public XsdElementDeclaration getElement(String namespace, String name) {
- return getElement(namespace, name, false);
- }
-
- public abstract XsdElementDeclaration getElement(String namespace, String name, boolean recurseChildren);
-
- public Iterable<String> getElementNameProposals(String namespace, Filter<String> filter) {
- return getElementNameProposals(namespace, filter, false);
- }
-
- public Iterable getElementNameProposals(String namespace, Filter<String> filter, boolean recurseChildren) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(getElementNames(namespace, recurseChildren), filter));
- }
-
- public abstract Iterable<String> getElementNames(String namespace, boolean recurseChildren);
-
- public enum Kind {
-
- /**
- * An {@link XsdTypeDefinition} of SIMPLE {@link Kind} may safely be cast to an {@link XsdSimpleTypeDefinition}
- */
- SIMPLE,
-
- /**
- * An {@link XsdTypeDefinition} of COMPLEX {@link Kind} may safely be cast to an {@link XsdComplexTypeDefinition}
- */
- COMPLEX;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
deleted file mode 100644
index af5191d2a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/xsd/XsdUtil.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * (copied mainly from org.eclipse.wst.xsd.contentmodel.internal.XSDImpl)
- * Oracle - extensions and modifications
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.xsd;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
-import org.eclipse.wst.xsd.contentmodel.internal.util.XSDSchemaLocatorAdapterFactory;
-import org.eclipse.xsd.XSDAttributeDeclaration;
-import org.eclipse.xsd.XSDAttributeGroupDefinition;
-import org.eclipse.xsd.XSDAttributeUse;
-import org.eclipse.xsd.XSDComplexTypeDefinition;
-import org.eclipse.xsd.XSDElementDeclaration;
-import org.eclipse.xsd.XSDModelGroup;
-import org.eclipse.xsd.XSDModelGroupDefinition;
-import org.eclipse.xsd.XSDNamedComponent;
-import org.eclipse.xsd.XSDParticle;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.XSDSchemaContent;
-import org.eclipse.xsd.XSDSimpleTypeDefinition;
-import org.eclipse.xsd.impl.XSDImportImpl;
-import org.eclipse.xsd.impl.XSDSchemaImpl;
-import org.eclipse.xsd.util.XSDConstants;
-import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.util.XSDSwitch;
-
-/**
- * Utility class for building XSD model and its extensions for JAXB
- */
-public class XsdUtil {
-
- static final XsdAdapterFactoryImpl adapterFactory = new XsdAdapterFactoryImpl();
-
-
- public static boolean namespaceEquals(XSDNamedComponent comp, String namespace) {
- String xsdNamespace = comp.getTargetNamespace();
- return (xsdNamespace == null) ? StringTools.stringIsEmpty(namespace) : xsdNamespace.equals(namespace);
- }
-
- public static String getResolvedUri(String location) {
- String resolvedUri = null;
-
- ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
-
- if (! StringTools.stringIsEmpty(location)) {
- try {
- resolvedUri = catalog.resolveSystem(location);
- if (resolvedUri == null) {
- resolvedUri = catalog.resolveURI(location);
- }
- if (resolvedUri == null) {
- resolvedUri = catalog.resolvePublic(location, null);
- }
- }
- catch (MalformedURLException me) {
- JptJaxbCorePlugin.log(me);
- resolvedUri = null;
- }
- catch (IOException ie) {
- JptJaxbCorePlugin.log(ie);
- resolvedUri = null;
- }
- }
-
- // if resolvedUri is null, assume the location is resolved
- return (resolvedUri != null) ? resolvedUri : location;
- }
-
-
- public static XsdSchema getSchema(XSDSchema xsdSchema) {
- return (xsdSchema == null) ? null : (XsdSchema) XsdUtil.getAdapter(xsdSchema);
- }
-
- public static XsdSchema getSchemaForSchema() {
- return getSchema(XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001));
- }
-
- /**
- * Given uri for an XML Schema document, parse the document and build
- * corresponding EMF object.
- */
- public static XSDSchema buildXSDModel(String uriString) {
- XSDSchema xsdSchema = null;
-
- // if XML Schema for Schema is requested, get it through schema model
- if (uriString.endsWith("2001/XMLSchema.xsd")) {
- xsdSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001);
- }
- else {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
-
- URI uri = URI.createURI(uriString);
-
- // CS : bug 113537 ensure we perform physical resolution before opening a stream for the resource
- String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation("", "", uriString);
- XSDResourceImpl resource = null;
- try {
- InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
- resource = (XSDResourceImpl) resourceSet.createResource(URI.createURI("*.xsd"));
- resource.setURI(uri);
- resource.load(inputStream, null);
- }
- catch (IOException e) {
- // schema does not exist or cannot be read
- // swallow the exception, and return null
- // there will be project validation to capture this error
- return null;
- }
- xsdSchema = resource.getSchema();
- }
- handleImports(xsdSchema);
- return xsdSchema;
- }
-
- private static void handleImports(XSDSchema xsdSchema) {
- if (xsdSchema != null) {
- for (XSDSchemaContent content : xsdSchema.getContents()) {
- if (content instanceof XSDImportImpl) {
- XSDImportImpl anImport = (XSDImportImpl) content;
- try {
- if (anImport.getSchemaLocation() != null) {
- anImport.importSchema();
- }
- }
- catch (Exception e) {
- JptJaxbCorePlugin.log(e);
- }
- }
- }
- }
- }
-
- public static Object getAdapter(Notifier notifier) {
- return adapterFactory.adapt(notifier);
- }
-
-
- /**
- * The Factory for the XSD adapter model. It provides a create method for each
- * non-abstract class of the model.
- */
- public static class XsdAdapterFactoryImpl
- extends AdapterFactoryImpl {
-
- @Override
- public Adapter createAdapter(Notifier target) {
- XSDSwitch xsdSwitch = new XSDSwitch() {
- @Override
- public Object caseXSDSchema(XSDSchema object) {
- return new XsdSchema(object);
- }
-
- @Override
- public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
- return new XsdAttributeDeclaration(object);
- }
-
- @Override
- public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
- return new XsdAttributeGroupDefinition(object);
- }
-
- @Override
- public Object caseXSDAttributeUse(XSDAttributeUse object) {
- return new XsdAttributeUse(object);
- }
-
- @Override
- public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
- return new XsdComplexTypeDefinition(object);
- }
-
- @Override
- public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
- return new XsdElementDeclaration(object);
- }
-
- @Override
- public Object caseXSDModelGroup(XSDModelGroup object) {
- return new XsdModelGroup(object);
- }
-
- @Override
- public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
- return new XsdModelGroupDefinition(object);
- }
-
- @Override
- public Object caseXSDParticle(XSDParticle object) {
- return new XsdParticle(object);
- }
-
- @Override
- public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
- return new XsdSimpleTypeDefinition(object);
- }
- };
-
- Object o = xsdSwitch.doSwitch((EObject) target);
- Adapter result = null;
- if (o instanceof Adapter) {
- result = (Adapter) o;
- }
- return result;
- }
-
- public Adapter adapt(Notifier target) {
- return adapt(target, this);
- }
- }
-}
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 c4be45699a..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.2.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 f38c7c0a88..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 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 304e86186a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.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.eclipselink.core.schemagen/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
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/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4204445996..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:53 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.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 6094e17a01..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-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind,
- org.eclipse.persistence.jaxb
-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 d535c6112b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core.schemagen/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
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
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.eclipselink.core/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
deleted file mode 100644
index ba29ee4b87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.classpath
+++ /dev/null
@@ -1,19 +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="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/model/listener/awt/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/model/value/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/swing/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project
deleted file mode 100644
index d899a36e49..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.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.eclipselink.core/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 30eb0fcac5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:45 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 07c7256bee..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,40 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.JptJaxbEclipseLinkCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.300,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.core;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.eclipselink.core;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.j2ee;bundle-version="[1.1.500,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.300,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.8.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core,
- org.eclipse.jpt.jaxb.eclipselink.core.context.java,
- org.eclipse.jpt.jaxb.eclipselink.core.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_4;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.internal.validation;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.resource.java
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.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.eclipselink.core/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties
deleted file mode 100644
index b7fe1216e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/build.properties
+++ /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
-################################################################################
-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.eclipselink.core/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties
deleted file mode 100644
index 52ad60c72e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# 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 - Core
-providerName = Eclipse Web Tools Platform
-
-ECLIPSELINK_PLATFORM_GROUP_LABEL = EclipseLink
-ECLIPSELINK_2_1_PLATFORM_LABEL = EclipseLink 2.1.x
-ECLIPSELINK_2_2_PLATFORM_LABEL = EclipseLink 2.2.x
-ECLIPSELINK_2_3_PLATFORM_LABEL = EclipseLink 2.3.x
-ECLIPSELINK_2_4_PLATFORM_LABEL = EclipseLink 2.4.x
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml
deleted file mode 100644
index 28efc2f92f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2011, 2012 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
-
- <propertyTester
- id="org.eclipse.jpt.jaxb.eclipselink.core.propertyTester.jaxbPackage"
- type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"
- namespace="org.eclipse.jpt.jaxb.eclipselink.core"
- properties="hasEclipseLinkJaxbProperty"
- class="org.eclipse.jpt.jaxb.eclipselink.core.internal.context.JaxbPackageTester"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.jaxb.core.jaxbPlatforms">
-
- <jaxbPlatformGroup
- id="eclipselink"
- label="%ECLIPSELINK_PLATFORM_GROUP_LABEL"/>
-
- <jaxbPlatform
- id="eclipselink_2_1"
- label="%ECLIPSELINK_2_1_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.1"
- default="false"/>
-
- <jaxbPlatform
- id="eclipselink_2_2"
- label="%ECLIPSELINK_2_2_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- <jaxbPlatform
- id="eclipselink_2_3"
- label="%ECLIPSELINK_2_3_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3.ELJaxb_2_3_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- <jaxbPlatform
- id="eclipselink_2_4"
- label="%ECLIPSELINK_2_4_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_4.ELJaxb_2_4_PlatformDefinitionFactory"
- group="eclipselink"
- jaxbFacetVersion="2.2"
- default="false"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
-
- <libraryValidator
- id="eclipselinkUserLibraryValidator"
- class="org.eclipse.jpt.jaxb.eclipselink.core.internal.libval.ELJaxbUserLibraryValidator">
- <enablement>
- <and>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId"
- value="jaxb-user-library-provider"/>
- </with>
- <with variable="config">
- <adapt type = "org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription">
- <test property="org.eclipse.jpt.jaxb.core.jaxbPlatformGroup"
- value="eclipselink"/>
- </adapt>
- </with>
- </and>
- </enablement>
- </libraryValidator>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties
deleted file mode 100644
index b9f8f38304..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/property_files/el_jaxb_validation.properties
+++ /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
-###############################################################################
-
-PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY = Project is missing a jaxb.properties file specifying the EclipseLink JAXB context factory
-
-XML_DISCRIMINATOR_NODE__NOT_SPECIFIED = XmlDiscriminatorNode not specified.
-
-XML_DISCRIMINATOR_VALUE__NOT_SPECIFIED = XmlDiscriminatorValue not specified.
-
-XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = An element factory method must have a return type consistent with ''javax.xml.bind.JAXBElement''.
-
-XML_JOIN_NODE__XML_PATH_NOT_SPECIFIED = XmlJoinNode xmlPath not specified.
-XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_SPECIFIED = XmlJoinNode referencedXmlPath not specified.
-XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_IN_REFERENCED_CLASS_KEYS = There is no XmlKey or XmlID on the target class ''{0}'' with XPath \"{1}\".
-
-XML_JOIN_NODES__INVALID_REFERENCED_CLASS = The referenced class ''{0}'' is invalid for use with XmlJoinNodes.
-XML_JOIN_NODES__DUPLICATE_XML_PATH = Duplicate xmlPath ''{0}'' in XmlJoinNodes.
-XML_JOIN_NODES__DUPLICATE_REFERENCED_XML_PATH = Duplicate referencedXmlpath ''{0}'' in XmlJoinNodes.
-
-XML_PATH__NOT_SPECIFIED = XmlPath not specified.
-
-XML_PATH__INSUFFICIENT_XML_PATHS_FOR_XML_ELEMENTS = Insufficient XmlPaths specified. There must be an XmlPath for each XmlElement.
-XML_PATH__INSUFFICIENT_XML_ELEMENTS_FOR_XML_PATHS = There is no XmlElement to match this XmlPath. There must be an XmlElement for each Xmlpath.
-
-XML_INVERSE_REFERENCE__MAPPED_BY_NOT_SPECIFIED = The 'mappedBy' property must be specified on an XmlInverseReference.
-XML_INVERSE_REFERENCE__MAPPED_BY_NOT_RESOLVED = Cannot resolve the attribute ''{0}'' on the class ''{1}''.
-XML_INVERSE_REFERENCE__MAPPED_BY_ILLEGAL_MAPPING_TYPE = The attribute ''{0}'' on the class ''{1}'' must be mapped as XmlElement, XmlElements, XmlAttribute, or XmlValue.j
-
-XPATH__INVALID_FORM_ILLEGAL_SEGMENT = Illegal XPath step \"{0}\".
-XPATH__ROOT_NOT_SUPPORTED = Root XPath is not supported in this context.
-XPATH__SELF_SEGMENT_MUST_BE_FIRST_SEGMENT = Self XPath step must be first step.
-XPATH__TEXT_SEGMENT_MUST_BE_LAST_SEGMENT = Text XPath step must be last step.
-XPATH__ATTRIBUTE_SEGMENT_MUST_BE_LAST_SEGMENT = An attribute XPath step must be the last step.
-XPATH__INVALID_NS_PREFIX = Cannot resolve a namespace for the prefix \"{0}\".
-XPATH__UNRESOLVED_ELEMENT = Cannot resolve element with namespace \"{0}\" and local name \"{1}\" in this context.
-XPATH__UNRESOLVED_ATTRIBUTE = Cannot resolve attribute with namespace \"{0}\" and local name \"{1}\" in this context.
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.java
deleted file mode 100644
index 4622278de2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbMappingKeys.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.eclipselink.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
- */
-public interface ELJaxbMappingKeys {
-
- String XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY = "xml-inverse-reference";
- String XML_JOIN_NODES_ATTRIBUTE_MAPPING_KEY = "xml-join-nodes";
- String XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY = "xml-transformation";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.java
deleted file mode 100644
index d229bdafda..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/ELJaxbPlatform.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.eclipselink.core;
-
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-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 ELJaxbPlatform {
-
- public static final JaxbPlatformGroupDescription GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("eclipselink"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_1
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_1"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_2
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_2"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_3
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_3"); //$NON-NLS-1$
-
- public static final JaxbPlatformDescription VERSION_2_4
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatform("eclipselink_2_4"); //$NON-NLS-1$
-
-
- public static JaxbPlatformDescription getDefaultPlatform(IProjectFacetVersion jaxbVersion) {
- if (jaxbVersion.equals(JaxbFacet.VERSION_2_1)) {
- return VERSION_2_1;
- }
- return VERSION_2_4;
- }
-
-
- /**
- * Not for instantiation
- */
- private ELJaxbPlatform() {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java
deleted file mode 100644
index e69681806f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/JptJaxbEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-public class JptJaxbEclipseLinkCorePlugin
- extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.core"; //$NON-NLS-1$
-
-
- // ********** singleton **********
- private static JptJaxbEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT EclipseLink plug-in.
- */
- public static JptJaxbEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
- /**
- * 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 JptJaxbEclipseLinkCorePlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELClassMapping.java
deleted file mode 100644
index 253472585f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELClassMapping.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-
-/**
- * EclipseLink extensions to JaxbClassMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELClassMapping
- extends JaxbClassMapping {
-
- // ***** XmlDiscriminatorNode *****
-
- String XML_DISCRIMINATOR_NODE_PROPERTY = "xmlDiscriminatorNode"; //$NON-NLS-1$
-
- ELXmlDiscriminatorNode getXmlDiscriminatorNode();
-
- ELXmlDiscriminatorNode addXmlDiscriminatorNode();
-
- void removeXmlDiscriminatorNode();
-
-
- // ***** XmlDiscriminatorValue *****
-
- String XML_DISCRIMINATOR_VALUE_PROPERTY = "xmlDiscriminatorValue"; //$NON-NLS-1$
-
- ELXmlDiscriminatorValue getXmlDiscriminatorValue();
-
- ELXmlDiscriminatorValue addXmlDiscriminatorValue();
-
- void removeXmlDiscriminatorValue();
-
-
- // ***** misc *****
-
- /**
- * Return an {@link Iterable} of XPaths that represent the attributes annotated with XmlID or
- * XmlKey. (Includes those attributes that are not annotated with XmlPath - those XPaths
- * will be calculated.)
- */
- Iterable<String> getKeyXPaths();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyAttributeMapping.java
deleted file mode 100644
index 5d371a79db..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-
-/**
- * EclipseLink extensions to XmlAnyAttributeMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlAnyAttributeMapping
- extends XmlAnyAttributeMapping, ELXmlPathMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyElementMapping.java
deleted file mode 100644
index 56f02ceb92..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAnyElementMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-
-/**
- * EclipseLink extensions to XmlAnyElementMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlAnyElementMapping
- extends XmlAnyElementMapping, ELXmlPathMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAttributeMapping.java
deleted file mode 100644
index 8cd1eb4449..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlAttributeMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-
-/**
- * EclipseLink extensions to XmlAttributeMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlAttributeMapping
- extends XmlAttributeMapping, ELXmlNamedNodeMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATA.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATA.java
deleted file mode 100644
index ed3bff2e59..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATA.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-
-/**
- * Corresponds to the XmlCDATA 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.2
- * @since 3.2
- */
-public interface ELXmlCDATA
- extends JaxbContextNode {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATAMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATAMapping.java
deleted file mode 100644
index 761c7fe09f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlCDATAMapping.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-/**
- * EclipseLink mappings that have an XmlCDATA
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlCDATAMapping {
-
- // ***** xmlCDATA *****
-
- /**
- * String associated with changes to the xmlCDATA property
- */
- String XML_CDATA_PROPERTY = "xmlCDATA"; ///$NON-NLS-1$
-
- /**
- * Return the xmlCDATA property value.
- * A null indicates it is not specified.
- */
- ELXmlCDATA getXmlCDATA();
-
- /**
- * Add (and return) an xmlCDATA property value.
- * (Specifies the property)
- */
- ELXmlCDATA addXmlCDATA();
-
- /**
- * Remove the xmlCDATA property value.
- * (Unspecifies the property)
- */
- void removeXmlCDATA();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorNode.java
deleted file mode 100644
index f4d211d48d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorNode.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-
-/**
- * Corresponds to XmlDiscriminatorNode 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.2
- * @since 3.2
- */
-public interface ELXmlDiscriminatorNode
- extends JaxbContextNode {
-
- // ***** value *****
-
- /**
- * String associated with changes to the value property
- */
- String VALUE_PROPERTY = "value"; ///$NON-NLS-1$
-
- /**
- * Return the value property value.
- * A null indicates it is not specified.
- */
- String getValue();
-
- /**
- * Set the value property value.
- * Null unspecifies the value.
- */
- void setValue(String value);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorValue.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorValue.java
deleted file mode 100644
index 3074d0ab89..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlDiscriminatorValue.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-/**
- * Corresponds to XmlDiscriminatorValue 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.2
- * @since 3.2
- */
-public interface ELXmlDiscriminatorValue {
-
- // ***** value *****
-
- /**
- * String associated with changes to the value property
- */
- String VALUE_PROPERTY = "value"; ///$NON-NLS-1$
-
- /**
- * Return the value property value.
- * A null indicates it is not specified.
- */
- String getValue();
-
- /**
- * Set the value property value.
- * Null unspecifies the value.
- */
- void setValue(String value);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementMapping.java
deleted file mode 100644
index 9c0df040a6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-
-/**
- * EclipseLink extensions to XmlElementMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlElementMapping
- extends XmlElementMapping, ELXmlNamedNodeMapping, ELXmlCDATAMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementsMapping.java
deleted file mode 100644
index c3fc3f1190..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlElementsMapping.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-
-/**
- * EclipseLink extensions to XmlElementsMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlElementsMapping
- extends XmlElementsMapping {
-
- // ***** xmlPaths *****
-
- /**
- * String associated with changes to the xmlPaths list
- */
- String XML_PATHS_LIST = "xmlPaths"; ///$NON-NLS-1$
-
- ListIterable<ELXmlPath> getXmlPaths();
-
- int getXmlPathsSize();
-
- ELXmlPath addXmlPath(int index);
-
- void removeXmlPath(int index);
-
- void moveXmlPath(int targetIndex, int sourceIndex);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlInverseReferenceMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlInverseReferenceMapping.java
deleted file mode 100644
index a9ea6091df..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlInverseReferenceMapping.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-
-/**
- * Represents an EclipseLink XmlInverseReference attribute mapping in either
- * java annotations or oxm 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.2
- * @since 3.2
- */
-public interface ELXmlInverseReferenceMapping
- extends JaxbAttributeMapping {
-
- // ***** mappedBy *****
-
- /**
- * String associated with changes to the mappedBy property
- */
- String MAPPED_BY_PROPERTY = "mappedBy"; ///$NON-NLS-1$
-
- /**
- * Return the mappedBy property value.
- * A null indicates it is not specified.
- */
- String getMappedBy();
-
- /**
- * Set the mappedBy property value.
- * Setting to null will unspecify it.
- */
- void setMappedBy(String mappedBy);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNode.java
deleted file mode 100644
index 0166f05684..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNode.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-
-/**
- * Represents an @XmlJoinNode, whether at top level or nested in @XmlJoinNodes
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlJoinNode
- extends JavaContextNode {
-
- // ***** xmlPath *****
-
- /**
- * String associated with changes to the xmlPath property
- */
- String XML_PATH_PROPERTY = "xmlPath"; ///$NON-NLS-1$
-
- /**
- * Return the xmlPath property value.
- * A null indicates it is not specified.
- */
- String getXmlPath();
-
- /**
- * Set the xmlPath property value.
- * Null unspecifies the value.
- */
- void setXmlPath(String value);
-
-
- // ***** referencedXmlPath *****
-
- /**
- * String associated with changes to the referencedXmlPath property
- */
- String REFERENCED_XML_PATH_PROPERTY = "referencedXmlPath"; ///$NON-NLS-1$
-
- /**
- * Return the referencedXmlPath property value.
- * A null indicates it is not specified.
- */
- String getReferencedXmlPath();
-
- /**
- * Set the referencedXmlPath property value.
- * Null unspecifies the value.
- */
- void setReferencedXmlPath(String value);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNodesMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNodesMapping.java
deleted file mode 100644
index f821fa18fb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlJoinNodesMapping.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-
-/**
- * Represents an EclipseLink XmlJoinNodes attribute mapping in either
- * java annotations or oxm 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.2
- * @since 3.2
- */
-public interface ELXmlJoinNodesMapping
- extends JaxbAttributeMapping {
-
-
- // ***** XmlJoinNodes *****
-
- String XML_JOIN_NODES_LIST = "xmlJoinNodes"; //$NON-NLS-1$
-
- ListIterable<ELXmlJoinNode> getXmlJoinNodes();
-
- int getXmlJoinNodesSize();
-
- ELXmlJoinNode addXmlJoinNode(int index);
-
- void removeXmlJoinNode(int index);
-
- void moveXmlJoinNode(int targetIndex, int sourceIndex);
-
-
- // ***** misc *****
-
- ELClassMapping getReferencedClassMapping();
-
- XsdTypeDefinition getReferencedXsdTypeDefinition();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlKey.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlKey.java
deleted file mode 100644
index 1f3c7993df..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlKey.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-
-/**
- * Corresponds to the XmlKey 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.2
- * @since 3.2
- */
-public interface ELXmlKey
- extends JaxbContextNode {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlNamedNodeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlNamedNodeMapping.java
deleted file mode 100644
index 31a59b687e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlNamedNodeMapping.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.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-
-
-/**
- * Common interface for ELXmlElementMapping and ELXmlAttributeMapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlNamedNodeMapping
- extends XmlNamedNodeMapping, ELXmlPathMapping {
-
- // ***** XmlKey *****
-
- /**
- * String associated with changes to the xmlKey property
- */
- String XML_KEY_PROPERTY = "xmlKey"; ///$NON-NLS-1$
-
- /**
- * Return the xmlKey property value.
- * A null indicates it is not specified.
- */
- ELXmlKey getXmlKey();
-
- /**
- * Add (and return) an xmlKey property value.
- * (Specifies the property)
- */
- ELXmlKey addXmlKey();
-
- /**
- * Remove the xmlKey property value.
- * (Unspecifies the property)
- */
- void removeXmlKey();
-
-
- // ***** misc *****
-
- /**
- * Return an XPath to represent this attribute mapping.
- * Return <code>null</code> if no valid XPath can be constructed.
- * (Trivial if this mapping has an XmlPath annotation)
- */
- String getXPath();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPath.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPath.java
deleted file mode 100644
index 809905c416..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPath.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-
-/**
- * Corresponds to the XmlPath 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.2
- * @since 3.2
- */
-public interface ELXmlPath
- extends JaxbContextNode {
-
- // ***** value *****
-
- /**
- * String associated with changes to the value property
- */
- String VALUE_PROPERTY = "value"; ///$NON-NLS-1$
-
- /**
- * Return the value property value.
- * A null indicates it is not specified.
- */
- String getValue();
-
- /**
- * Set the value property value.
- * Null unspecifies the value.
- */
- void setValue(String value);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPathMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPathMapping.java
deleted file mode 100644
index 6d526fc040..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlPathMapping.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-/**
- * EclipseLink mappings that have an XmlPath
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface ELXmlPathMapping {
-
- // ***** xmlPath *****
-
- /**
- * String associated with changes to the xmlPath property
- */
- String XML_PATH_PROPERTY = "xmlPath"; ///$NON-NLS-1$
-
- /**
- * Return the xmlPath property value.
- * A null indicates it is not specified.
- */
- ELXmlPath getXmlPath();
-
- /**
- * Add (and return) an xmlPath property value.
- * (Specifies the property)
- */
- ELXmlPath addXmlPath();
-
- /**
- * Remove the xmlPath property value.
- * (Unspecifies the property)
- */
- void removeXmlPath();
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlValueMapping.java
deleted file mode 100644
index a9a6f71237..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/java/ELXmlValueMapping.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-
-
-public interface ELXmlValueMapping
- extends XmlValueMapping, ELXmlCDATAMapping {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.java
deleted file mode 100644
index 5e4365cd41..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/AbstractELJaxbPlatformDefinition.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.eclipselink.core.internal;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-
-
-public abstract class AbstractELJaxbPlatformDefinition
- extends AbstractJaxbPlatformDefinition {
-
- protected AbstractELJaxbPlatformDefinition() {
- super();
- }
-
-
- protected abstract JaxbPlatformDefinition getGenericJaxbPlatformDefinition();
-
-
- @Override
- public String getSchemaTypeMapping(String javaTypeName) {
- String mapping = getGenericJaxbPlatformDefinition().getSchemaTypeMapping(javaTypeName);
- return (mapping != null) ? mapping : super.getSchemaTypeMapping(javaTypeName);
- }
-
- @Override
- protected Map<String, String> buildJavaToSchemaTypes() {
- Map<String, String> map = new HashMap<String, String>();
- map.put("java.sql.Date", "date");
- map.put("java.sql.Time", "time");
- map.put("java.sql.Timestamp", "dateTime");
- return map;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.java
deleted file mode 100644
index b162386a60..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/ELJaxbContextRoot.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.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJaxbContextRoot
- extends AbstractJaxbContextRoot {
-
-
- public ELJaxbContextRoot(JaxbProject jaxbProject) {
- super(jaxbProject);
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- validateJaxbProperties(messages, reporter);
- }
-
- protected void validateJaxbProperties(List<IMessage> messages, IReporter reporter) {
- String factoryProp = "javax.xml.bind.context.factory";
- String factoryPropValue = "org.eclipse.persistence.jaxb.JAXBContextFactory";
-
- for (JaxbPackage jp : getPackages()) {
- String pn = jp.getName();
- JaxbPropertiesResource jpr = getJaxbProject().getJaxbPropertiesResource(pn);
- if (jpr != null && StringTools.stringsAreEqual(jpr.getProperty(factoryProp), factoryPropValue)) {
- return;
- }
- }
-
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY,
- getJaxbProject()));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/JaxbPackageTester.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/JaxbPackageTester.java
deleted file mode 100644
index efc10690d3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/JaxbPackageTester.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPackageTester
- extends PropertyTester {
-
- public static final String HAS_ECLIPSELINK_JAXB_PROPERTY = "hasEclipseLinkJaxbProperty"; //$NON-NLS-1$
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof JaxbPackage) {
- return test((JaxbPackage) receiver, property, expectedValue);
- }
- return false;
- }
-
- private boolean test(JaxbPackage jaxbPackage, String property, Object expectedValue) {
- if (property.equals(HAS_ECLIPSELINK_JAXB_PROPERTY)) {
- JaxbPropertiesResource jpr =
- jaxbPackage.getJaxbProject().getJaxbPropertiesResource(jaxbPackage.getName());
-
- boolean value = jpr != null;
-
- if (value) {
- String factoryProp = "javax.xml.bind.context.factory";
- String factoryPropValue = "org.eclipse.persistence.jaxb.JAXBContextFactory";
- value = Tools.valuesAreEqual(jpr.getProperty(factoryProp), factoryPropValue);
- }
-
- return Tools.valuesAreEqual(value, expectedValue);
- }
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java
deleted file mode 100644
index 1065f4fd69..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaClassMapping.java
+++ /dev/null
@@ -1,264 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.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.NotNullFilter;
-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.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.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlDiscriminatorNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlDiscriminatorValue;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaClassMapping
- extends GenericJavaClassMapping
- implements ELClassMapping {
-
- protected ELJavaXmlDiscriminatorNode xmlDiscriminatorNode;
-
- protected ELJavaXmlDiscriminatorValue xmlDiscriminatorValue;
-
-
- public ELJavaClassMapping(JaxbClass parent) {
- super(parent);
- initXmlDiscriminatorNode();
- initXmlDiscriminatorValue();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlDiscriminatorNode();
- syncXmlDiscriminatorValue();
- }
-
- @Override
- public void update() {
- super.update();
- updateXmlDiscriminatorNode();
- updateXmlDiscriminatorValue();
- }
-
-
- // ***** xmlDiscriminatorNode *****
-
- public ELXmlDiscriminatorNode getXmlDiscriminatorNode() {
- return this.xmlDiscriminatorNode;
- }
-
- protected void setXmlDiscriminatorNode_(ELJavaXmlDiscriminatorNode xmlDiscriminatorNode) {
- ELXmlDiscriminatorNode old = this.xmlDiscriminatorNode;
- this.xmlDiscriminatorNode = xmlDiscriminatorNode;
- firePropertyChanged(XML_DISCRIMINATOR_NODE_PROPERTY, old, xmlDiscriminatorNode);
- }
-
- public ELXmlDiscriminatorNode addXmlDiscriminatorNode() {
- if (this.xmlDiscriminatorNode != null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().addAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- ELJavaXmlDiscriminatorNode xmlDiscriminatorNode = buildXmlDiscriminatorNode();
- setXmlDiscriminatorNode_(xmlDiscriminatorNode);
- return xmlDiscriminatorNode;
- }
-
- public void removeXmlDiscriminatorNode() {
- if (this.xmlDiscriminatorNode == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- setXmlDiscriminatorNode_(null);
- }
-
- public XmlDiscriminatorNodeAnnotation getXmlDiscriminatorNodeAnnotation() {
- return (XmlDiscriminatorNodeAnnotation) getJavaResourceType().getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- }
-
- protected ELJavaXmlDiscriminatorNode buildXmlDiscriminatorNode() {
- return new ELJavaXmlDiscriminatorNode(this);
- }
-
- protected void initXmlDiscriminatorNode() {
- XmlDiscriminatorNodeAnnotation annotation = getXmlDiscriminatorNodeAnnotation();
- this.xmlDiscriminatorNode = (annotation == null) ? null : buildXmlDiscriminatorNode();
- }
-
- protected void syncXmlDiscriminatorNode() {
- XmlDiscriminatorNodeAnnotation annotation = getXmlDiscriminatorNodeAnnotation();
- if (annotation != null) {
- if (this.xmlDiscriminatorNode != null) {
- this.xmlDiscriminatorNode.synchronizeWithResourceModel();
- }
- else {
- setXmlDiscriminatorNode_(buildXmlDiscriminatorNode());
- }
- }
- else {
- setXmlDiscriminatorNode_(null);
- }
- }
-
- protected void updateXmlDiscriminatorNode() {
- if (this.xmlDiscriminatorNode != null) {
- this.xmlDiscriminatorNode.update();
- }
- }
-
-
- // ***** xmlDiscriminatorValue *****
-
- public ELXmlDiscriminatorValue getXmlDiscriminatorValue() {
- return this.xmlDiscriminatorValue;
- }
-
- protected void setXmlDiscriminatorValue_(ELJavaXmlDiscriminatorValue xmlDiscriminatorValue) {
- ELXmlDiscriminatorValue old = this.xmlDiscriminatorValue;
- this.xmlDiscriminatorValue = xmlDiscriminatorValue;
- firePropertyChanged(XML_DISCRIMINATOR_VALUE_PROPERTY, old, xmlDiscriminatorValue);
- }
-
- public ELXmlDiscriminatorValue addXmlDiscriminatorValue() {
- if (this.xmlDiscriminatorValue != null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().addAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- ELJavaXmlDiscriminatorValue xmlDiscriminatorValue = buildXmlDiscriminatorValue();
- setXmlDiscriminatorValue_(xmlDiscriminatorValue);
- return xmlDiscriminatorValue;
- }
-
- public void removeXmlDiscriminatorValue() {
- if (this.xmlDiscriminatorValue == null) {
- throw new IllegalStateException();
- }
- getJavaResourceType().removeAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- setXmlDiscriminatorValue_(null);
- }
-
- public XmlDiscriminatorValueAnnotation getXmlDiscriminatorValueAnnotation() {
- return (XmlDiscriminatorValueAnnotation) getJavaResourceType().getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
-
- protected ELJavaXmlDiscriminatorValue buildXmlDiscriminatorValue() {
- return new ELJavaXmlDiscriminatorValue(this);
- }
-
- protected void initXmlDiscriminatorValue() {
- XmlDiscriminatorValueAnnotation annotation = getXmlDiscriminatorValueAnnotation();
- this.xmlDiscriminatorValue = (annotation == null) ? null : buildXmlDiscriminatorValue();
- }
-
- protected void syncXmlDiscriminatorValue() {
- XmlDiscriminatorValueAnnotation annotation = getXmlDiscriminatorValueAnnotation();
- if (annotation != null) {
- if (this.xmlDiscriminatorValue != null) {
- this.xmlDiscriminatorValue.synchronizeWithResourceModel();
- }
- else {
- setXmlDiscriminatorValue_(buildXmlDiscriminatorValue());
- }
- }
- else {
- setXmlDiscriminatorValue_(null);
- }
- }
-
- protected void updateXmlDiscriminatorValue() {
- if (this.xmlDiscriminatorValue != null) {
- this.xmlDiscriminatorValue.update();
- }
- }
-
-
- // ***** misc *****
-
- public Iterable<String> getKeyXPaths() {
- return new FilteringIterable(
- new TransformationIterable<ELXmlNamedNodeMapping, String>(getAllKeyMappings()) {
- @Override
- protected String transform(ELXmlNamedNodeMapping o) {
- return o.getXPath();
- }
- },
- NotNullFilter.instance());
- }
-
- protected Iterable<ELXmlNamedNodeMapping> getAllKeyMappings() {
- return new FilteringIterable<ELXmlNamedNodeMapping>(
- new SubIterableWrapper<JaxbAttributeMapping, ELXmlNamedNodeMapping>(
- new FilteringIterable<JaxbAttributeMapping>(
- new TransformationIterable<JaxbPersistentAttribute, JaxbAttributeMapping>(getAllAttributes()) {
- @Override
- protected JaxbAttributeMapping transform(JaxbPersistentAttribute o) {
- return o.getMapping();
- }
- }) {
- @Override
- protected boolean accept(JaxbAttributeMapping o) {
- return (o.getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY
- || o.getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- }
- })) {
- @Override
- protected boolean accept(ELXmlNamedNodeMapping o) {
- return o.getXmlID() != null || o.getXmlKey() != null;
- }
- };
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlDiscriminatorNode != null) {
- result = this.xmlDiscriminatorNode.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlDiscriminatorNode != null) {
- this.xmlDiscriminatorNode.validate(messages, reporter, astRoot);
- }
-
- if (this.xmlDiscriminatorValue != null) {
- this.xmlDiscriminatorValue.validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java
deleted file mode 100644
index 2322c545a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaElementFactoryMethod.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class ELJavaElementFactoryMethod
- extends GenericJavaElementFactoryMethod {
-
- public ELJavaElementFactoryMethod(XmlRegistry parent, JavaResourceMethod resourceMethod) {
- super(parent, resourceMethod);
- }
-
-
- @Override
- protected void validateMethodReturnType(
- JavaResourceMethod resourceMethod, List<IMessage> messages, CompilationUnit astRoot) {
-
- if (! resourceMethod.typeIsSubTypeOf(JAXB.JAXB_ELEMENT)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE,
- this,
- getValidationTextRange(astRoot)));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java
deleted file mode 100644
index dc5fc5de21..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMapping.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlAnyAttributeMapping
- extends GenericJavaXmlAnyAttributeMapping
- implements ELXmlAnyAttributeMapping {
-
- protected ELJavaXmlPath xmlPath;
-
-
- public ELJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initXmlPath();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlPath();
- }
-
-
- // ***** XmlPath *****
-
- public ELXmlPath getXmlPath() {
- return this.xmlPath;
- }
-
- protected void setXmlPath_(ELJavaXmlPath xmlPath) {
- ELJavaXmlPath old = this.xmlPath;
- this.xmlPath = xmlPath;
- firePropertyChanged(XML_PATH_PROPERTY, old, this.xmlPath);
- }
-
- public ELXmlPath addXmlPath() {
- if (this.xmlPath != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(0, ELJaxb.XML_PATH);
- ELJavaXmlPath xmlPath = buildXmlPath();
- setXmlPath_(xmlPath);
- return xmlPath;
- }
-
- public void removeXmlPath() {
- if (this.xmlPath == null) {
- throw new IllegalStateException();
- }
- while (getXmlPathAnnotation() != null) {
- getJavaResourceAttribute().removeAnnotation(0, ELJaxb.XML_PATH);
- }
- setXmlPath_(null);
- }
-
- protected void initXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- this.xmlPath = (annotation == null) ? null : buildXmlPath();
- }
-
- protected void syncXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- if (annotation != null) {
- if (this.xmlPath == null) {
- setXmlPath_(buildXmlPath());
- }
- else {
- this.xmlPath.synchronizeWithResourceModel();
- }
- }
- else {
- setXmlPath_(null);
- }
- }
-
- protected ELJavaXmlPath buildXmlPath() {
- return new ELJavaXmlPath(this, new XmlPathContext());
- }
-
- protected XmlPathAnnotation getXmlPathAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(ELJaxb.XML_PATH) > 0) {
- return (XmlPathAnnotation) getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH);
- }
- return null;
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlPath != null) {
- result = this.xmlPath.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlPath != null) {
- validateXmlPath(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.xmlPath.validate(messages, reporter, astRoot);
- }
-
-
- protected class XmlPathContext
- implements ELJavaXmlPath.Context {
-
- public XmlPathAnnotation getAnnotation() {
- return ELJavaXmlAnyAttributeMapping.this.getXmlPathAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return ELJavaXmlAnyAttributeMapping.this;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMappingDefinition.java
deleted file mode 100644
index 0735a5e3bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyAttributeMappingDefinition.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlAnyAttributeMappingDefinition
- extends JavaXmlAnyAttributeMappingDefinition {
-
- // singleton
- private static final ELJavaXmlAnyAttributeMappingDefinition INSTANCE =
- new ELJavaXmlAnyAttributeMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- ELJaxb.XML_PATH };
-
- /**
- * Return the singleton.
- */
- public static ELJavaXmlAnyAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlAnyAttributeMappingDefinition() {
- super();
- }
-
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return new CompositeIterable<String>(
- super.getSupportingAnnotationNames(),
- new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java
deleted file mode 100644
index ee8b129d95..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMapping.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefs;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlAnyElementMapping
- extends GenericJavaXmlAnyElementMapping
- implements ELXmlAnyElementMapping {
-
- protected ELJavaXmlPath xmlPath;
-
-
- public ELJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initXmlPath();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlPath();
- }
-
-
- // ***** XmlPath *****
-
- public ELXmlPath getXmlPath() {
- return this.xmlPath;
- }
-
- protected void setXmlPath_(ELJavaXmlPath xmlPath) {
- ELJavaXmlPath old = this.xmlPath;
- this.xmlPath = xmlPath;
- firePropertyChanged(XML_PATH_PROPERTY, old, this.xmlPath);
- }
-
- public ELXmlPath addXmlPath() {
- if (this.xmlPath != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(0, ELJaxb.XML_PATH);
- ELJavaXmlPath xmlPath = buildXmlPath();
- setXmlPath_(xmlPath);
- return xmlPath;
- }
-
- public void removeXmlPath() {
- if (this.xmlPath == null) {
- throw new IllegalStateException();
- }
- while (getXmlPathAnnotation() != null) {
- getJavaResourceAttribute().removeAnnotation(0, ELJaxb.XML_PATH);
- }
- setXmlPath_(null);
- }
-
- protected void initXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- this.xmlPath = (annotation == null) ? null : buildXmlPath();
- }
-
- protected void syncXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- if (annotation != null) {
- if (this.xmlPath == null) {
- setXmlPath_(buildXmlPath());
- }
- else {
- this.xmlPath.synchronizeWithResourceModel();
- }
- }
- else {
- setXmlPath_(null);
- }
- }
-
- protected ELJavaXmlPath buildXmlPath() {
- return new ELJavaXmlPath(this, new XmlPathContext());
- }
-
- protected XmlPathAnnotation getXmlPathAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(ELJaxb.XML_PATH) > 0) {
- return (XmlPathAnnotation) getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH);
- }
- return null;
- }
-
-
- // ***** misc *****
-
- @Override
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new ELJavaXmlElementWrapper(this, new XmlElementWrapperContext());
- }
-
- @Override
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- // ***** 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.xmlPath != null) {
- result = this.xmlPath.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlPath != null) {
- validateXmlPath(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.xmlPath.validate(messages, reporter, astRoot);
- }
-
-
- protected class XmlPathContext
- implements ELJavaXmlPath.Context {
-
- public XmlPathAnnotation getAnnotation() {
- return ELJavaXmlAnyElementMapping.this.getXmlPathAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return ELJavaXmlAnyElementMapping.this;
- }
- }
-
-
- protected class XmlElementWrapperContext
- implements ELJavaXmlElementWrapper.Context {
-
- public XmlElementWrapperAnnotation getAnnotation() {
- return ELJavaXmlAnyElementMapping.this.getXmlElementWrapperAnnotation();
- }
-
- public boolean hasXmlPath() {
- return ELJavaXmlAnyElementMapping.this.xmlPath != null;
- }
- }
-
-
- protected class XmlElementRefsContext
- extends GenericJavaXmlAnyElementMapping.XmlElementRefsContext {
-
- @Override
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new ELJavaXmlElementRef(parent, new GenericJavaXmlAnyElementMapping.XmlElementRefContext(annotation));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMappingDefinition.java
deleted file mode 100644
index 56a5cd9112..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAnyElementMappingDefinition.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAnyElementMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlAnyElementMappingDefinition
- extends JavaXmlAnyElementMappingDefinition {
-
- // singleton
- private static final ELJavaXmlAnyElementMappingDefinition INSTANCE =
- new ELJavaXmlAnyElementMappingDefinition();
-
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- ELJaxb.XML_PATH };
-
- /**
- * Return the singleton.
- */
- public static ELJavaXmlAnyElementMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlAnyElementMappingDefinition() {
- super();
- }
-
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return new CompositeIterable<String>(
- super.getSupportingAnnotationNames(),
- new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java
deleted file mode 100644
index 441844448c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMapping.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.StringTools;
-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.XmlID;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlKey;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlKeyAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlAttributeMapping
- extends GenericJavaXmlAttributeMapping
- implements ELXmlAttributeMapping {
-
- protected ELJavaXmlPath xmlPath;
-
- protected ELJavaXmlKey xmlKey;
-
-
- public ELJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initXmlPath();
- initXmlKey();
- }
-
-
- @Override
- protected XmlID buildXmlID(XmlIDAnnotation xmlIDAnnotation) {
- return new ELJavaXmlID(this, xmlIDAnnotation);
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlPath();
- syncXmlKey();
- }
-
-
- // ***** XmlPath *****
-
- public ELXmlPath getXmlPath() {
- return this.xmlPath;
- }
-
- protected void setXmlPath_(ELJavaXmlPath xmlPath) {
- ELJavaXmlPath old = this.xmlPath;
- this.xmlPath = xmlPath;
- firePropertyChanged(XML_PATH_PROPERTY, old, this.xmlPath);
- }
-
- public ELXmlPath addXmlPath() {
- if (this.xmlPath != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(0, ELJaxb.XML_PATH);
- ELJavaXmlPath xmlPath = buildXmlPath();
- setXmlPath_(xmlPath);
- return xmlPath;
- }
-
- public void removeXmlPath() {
- if (this.xmlPath == null) {
- throw new IllegalStateException();
- }
- while (getXmlPathAnnotation() != null) {
- getJavaResourceAttribute().removeAnnotation(0, ELJaxb.XML_PATH);
- }
- setXmlPath_(null);
- }
-
- protected void initXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- this.xmlPath = (annotation == null) ? null : buildXmlPath();
- }
-
- protected void syncXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- if (annotation != null) {
- if (this.xmlPath == null) {
- setXmlPath_(buildXmlPath());
- }
- else {
- this.xmlPath.synchronizeWithResourceModel();
- }
- }
- else {
- setXmlPath_(null);
- }
- }
-
- protected ELJavaXmlPath buildXmlPath() {
- return new ELJavaXmlPath(this, new XmlPathContext());
- }
-
- protected XmlPathAnnotation getXmlPathAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(ELJaxb.XML_PATH) > 0) {
- return (XmlPathAnnotation) getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH);
- }
- return null;
- }
-
-
- // ***** XmlKey *****
-
- public ELXmlKey getXmlKey() {
- return this.xmlKey;
- }
-
- protected void setXmlKey_(ELJavaXmlKey xmlKey) {
- ELJavaXmlKey old = this.xmlKey;
- this.xmlKey = xmlKey;
- firePropertyChanged(XML_KEY_PROPERTY, old, this.xmlKey);
- }
-
- public ELXmlKey addXmlKey() {
- if (this.xmlKey != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(ELJaxb.XML_KEY);
- ELJavaXmlKey xmlKey = buildXmlKey();
- setXmlKey_(xmlKey);
- return xmlKey;
- }
-
- public void removeXmlKey() {
- if (this.xmlKey == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(ELJaxb.XML_KEY);
- setXmlKey_(null);
- }
-
- protected void initXmlKey() {
- XmlKeyAnnotation annotation = getXmlKeyAnnotation();
- this.xmlKey = (annotation == null) ? null : buildXmlKey();
- }
-
- protected void syncXmlKey() {
- XmlKeyAnnotation annotation = getXmlKeyAnnotation();
- if (annotation != null) {
- if (this.xmlKey == null) {
- setXmlKey_(buildXmlKey());
- }
- }
- else {
- setXmlKey_(null);
- }
- }
-
- protected ELJavaXmlKey buildXmlKey() {
- return new ELJavaXmlKey(this, new XmlKeyContext());
- }
-
- protected XmlKeyAnnotation getXmlKeyAnnotation() {
- return (XmlKeyAnnotation) getJavaResourceAttribute().getAnnotation(ELJaxb.XML_KEY);
- }
-
-
- // ***** misc *****
-
- public String getXPath() {
- if (this.xmlPath != null) {
- return this.xmlPath.getValue();
- }
-
- String name = this.qName.getName();
- if (StringTools.stringIsEmpty(name)) {
- // no name is invalid
- return null;
- }
-
- String namespace = this.qName.getNamespace();
- if (StringTools.stringIsEmpty(namespace)) {
- // empty namespace means "no" namespace
- return XPath.attributeXPath(null, name);
- }
-
- String prefix = getJaxbPackage().getPackageInfo().getPrefixForNamespace(namespace);
- if (prefix == null) {
- // no prefix for non-null namespace is invalid
- return null;
- }
-
- return XPath.attributeXPath(prefix, this.qName.getName());
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- if (this.xmlPath != null) {
- result = this.xmlPath.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (this.xmlPath == null) {
- super.validateQName(messages, reporter, astRoot);
- }
- else {
- validateXmlPath(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.xmlPath.validate(messages, reporter, astRoot);
- }
-
-
- protected class XmlPathContext
- implements ELJavaXmlPath.Context {
-
- public XmlPathAnnotation getAnnotation() {
- return ELJavaXmlAttributeMapping.this.getXmlPathAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return ELJavaXmlAttributeMapping.this;
- }
- }
-
-
- protected class XmlKeyContext
- implements ELJavaXmlKey.Context {
-
- public XmlKeyAnnotation getAnnotation() {
- return ELJavaXmlAttributeMapping.this.getXmlKeyAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMappingDefinition.java
deleted file mode 100644
index 6d775a9a16..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlAttributeMappingDefinition.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.StringTokenizer;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-
-
-public class ELJavaXmlAttributeMappingDefinition
- extends JavaXmlAttributeMappingDefinition
- implements DefaultJavaAttributeMappingDefinition {
-
- // singleton
- private static final ELJavaXmlAttributeMappingDefinition INSTANCE =
- new ELJavaXmlAttributeMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- ELJaxb.XML_KEY,
- ELJaxb.XML_PATH };
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlAttributeMappingDefinition() {
- super();
- }
-
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return new CompositeIterable<String>(
- super.getSupportingAnnotationNames(),
- new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES));
- }
-
- public boolean isDefault(JaxbPersistentAttribute persistentAttribute) {
- // test whether annotated with @XmlPath, and if so, if last segment starts with "@"
- // (presence of "@" elsewhere may be a node select clause)
- XmlPathAnnotation xmlPathAnnotation = null;
- if (persistentAttribute.getJavaResourceAttribute().getAnnotationsSize(ELJaxb.XML_PATH) > 0) {
- xmlPathAnnotation = (XmlPathAnnotation) persistentAttribute.getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH);
- }
- if (xmlPathAnnotation == null) {
- return false;
- }
- String value = xmlPathAnnotation.getValue();
- if (value == null) {
- return false;
- }
- StringTokenizer tokenizer = new StringTokenizer(value, "/");
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- if (! tokenizer.hasMoreTokens()) {
- return token.startsWith("@");
- }
- }
- return false;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java
deleted file mode 100644
index f9679d350e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlCDATA.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlCDATA;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlCDATAAnnotation;
-
-
-public class ELJavaXmlCDATA
- extends AbstractJavaContextNode
- implements ELXmlCDATA {
-
- protected final Context context;
-
-
- public ELJavaXmlCDATA(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- }
-
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getAnnotation().getTextRange(astRoot);
- }
-
-
- public interface Context {
-
- XmlCDATAAnnotation getAnnotation();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java
deleted file mode 100644
index 71571095a7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorNode.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.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.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlDiscriminatorNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPathFactory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlDiscriminatorNode
- extends AbstractJavaContextNode
- implements ELXmlDiscriminatorNode {
-
- protected String value;
-
-
- public ELJavaXmlDiscriminatorNode(ELJavaClassMapping parent) {
- super(parent);
- initValue();
- }
-
-
- protected ELJavaClassMapping getClassMapping() {
- return (ELJavaClassMapping) getParent();
- }
-
- protected JaxbPackage getJaxbPackage() {
- return getClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncValue();
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- getAnnotation().setValue(value);
- setValue_(value);
- }
-
- protected void setValue_(String value) {
- String old = this.value;
- this.value = value;
- firePropertyChanged(VALUE_PROPERTY, old, this.value);
- }
-
- protected void initValue() {
- this.value = getAnnotation().getValue();
- }
-
- protected void syncValue() {
- setValue_(getAnnotation().getValue());
- }
-
- protected XmlDiscriminatorNodeAnnotation getAnnotation() {
- return getClassMapping().getXmlDiscriminatorNodeAnnotation();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- if (getAnnotation().valueTouches(pos, astRoot) && this.value != null) {
- XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.value);
- return xpath.getCompletionProposals(new XPathContext(astRoot), xsdType, pos, filter);
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (StringTools.stringIsEmpty(this.value)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_DISCRIMINATOR_NODE__NOT_SPECIFIED,
- ELJavaXmlDiscriminatorNode.this,
- getValueTextRange(astRoot)));
- return;
- }
-
- if (this.value.startsWith(XPath.DELIM)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
- ELJavaXmlDiscriminatorNode.this,
- getValueTextRange(astRoot)));
- return;
- }
-
- XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.value);
- xpath.validate(new XPathContext(astRoot), xsdType, messages);
- }
-
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
- // should never be null
- return getAnnotation().getValueTextRange(astRoot);
- }
-
-
- protected class XPathContext
- implements XPath.Context {
-
- private CompilationUnit astRoot;
-
- protected XPathContext(CompilationUnit astRoot) {
- this.astRoot = astRoot;
- }
-
-
- public JaxbNode getContextObject() {
- return ELJavaXmlDiscriminatorNode.this;
- }
-
- public JaxbPackage getJaxbPackage() {
- return ELJavaXmlDiscriminatorNode.this.getJaxbPackage();
- }
-
- public TextRange getTextRange() {
- return ELJavaXmlDiscriminatorNode.this.getValueTextRange(this.astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java
deleted file mode 100644
index e05479037a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlDiscriminatorValue.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlDiscriminatorValue;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlDiscriminatorValue
- extends AbstractJavaContextNode
- implements ELXmlDiscriminatorValue {
-
- protected String value;
-
-
- public ELJavaXmlDiscriminatorValue(ELJavaClassMapping parent) {
- super(parent);
- initValue();
- }
-
-
- protected ELJavaClassMapping getClassMapping() {
- return (ELJavaClassMapping) getParent();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncValue();
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- getAnnotation().setValue(value);
- setValue_(value);
- }
-
- protected void setValue_(String value) {
- String old = this.value;
- this.value = value;
- firePropertyChanged(VALUE_PROPERTY, old, this.value);
- }
-
- protected void initValue() {
- this.value = getAnnotation().getValue();
- }
-
- protected void syncValue() {
- setValue_(getAnnotation().getValue());
- }
-
- protected XmlDiscriminatorValueAnnotation getAnnotation() {
- return getClassMapping().getXmlDiscriminatorValueAnnotation();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (StringTools.stringIsEmpty(this.value)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_DISCRIMINATOR_VALUE__NOT_SPECIFIED,
- ELJavaXmlDiscriminatorValue.this,
- getValueTextRange(astRoot)));
- return;
- }
- }
-
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
- // should never be null
- return getAnnotation().getValueTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java
deleted file mode 100644
index 54142993e5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElement.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElement;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlElement
- extends GenericJavaXmlElement {
-
- public ELJavaXmlElement(JavaContextNode parent, Context context) {
- super(parent, context);
- }
-
-
- @Override
- protected Context getContext() {
- return (Context) super.getContext();
- }
-
- @Override
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! getContext().hasXmlPath()) {
- super.validateQName(messages, reporter, astRoot);
- }
- }
-
-
- public interface Context
- extends GenericJavaXmlElement.Context {
-
- boolean hasXmlPath();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java
deleted file mode 100644
index 3567470085..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMapping.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.StringTools;
-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.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.context.XmlID;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlCDATA;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlKey;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlCDATAAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlKeyAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlElementMapping
- extends GenericJavaXmlElementMapping
- implements ELXmlElementMapping {
-
- protected ELJavaXmlPath xmlPath;
-
- protected ELJavaXmlKey xmlKey;
-
- protected ELJavaXmlCDATA xmlCDATA;
-
-
- public ELJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initXmlPath();
- initXmlKey();
- initXmlCDATA();
- }
-
-
- @Override
- protected XmlID buildXmlID(XmlIDAnnotation xmlIDAnnotation) {
- return new ELJavaXmlID(this, xmlIDAnnotation);
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlPath();
- syncXmlKey();
- syncXmlCDATA();
- }
-
-
- // ***** XmlPath *****
-
- public ELXmlPath getXmlPath() {
- return this.xmlPath;
- }
-
- protected void setXmlPath_(ELJavaXmlPath xmlPath) {
- ELJavaXmlPath old = this.xmlPath;
- this.xmlPath = xmlPath;
- firePropertyChanged(XML_PATH_PROPERTY, old, this.xmlPath);
- }
-
- public ELXmlPath addXmlPath() {
- if (this.xmlPath != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(0, ELJaxb.XML_PATH);
- ELJavaXmlPath xmlPath = buildXmlPath();
- setXmlPath_(xmlPath);
- return xmlPath;
- }
-
- public void removeXmlPath() {
- if (this.xmlPath == null) {
- throw new IllegalStateException();
- }
- while (getXmlPathAnnotation() != null) {
- getJavaResourceAttribute().removeAnnotation(0, ELJaxb.XML_PATH);
- }
- setXmlPath_(null);
- }
-
- protected void initXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- this.xmlPath = (annotation == null) ? null : buildXmlPath();
- }
-
- protected void syncXmlPath() {
- XmlPathAnnotation annotation = getXmlPathAnnotation();
- if (annotation != null) {
- if (this.xmlPath == null) {
- setXmlPath_(buildXmlPath());
- }
- else {
- this.xmlPath.synchronizeWithResourceModel();
- }
- }
- else {
- setXmlPath_(null);
- }
- }
-
- protected ELJavaXmlPath buildXmlPath() {
- return new ELJavaXmlPath(this, new XmlPathContext());
- }
-
- protected XmlPathAnnotation getXmlPathAnnotation() {
- if (getJavaResourceAttribute().getAnnotationsSize(ELJaxb.XML_PATH) > 0) {
- return (XmlPathAnnotation) getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH);
- }
- return null;
- }
-
-
- // ***** XmlKey *****
-
- public ELXmlKey getXmlKey() {
- return this.xmlKey;
- }
-
- protected void setXmlKey_(ELJavaXmlKey xmlKey) {
- ELJavaXmlKey old = this.xmlKey;
- this.xmlKey = xmlKey;
- firePropertyChanged(XML_KEY_PROPERTY, old, this.xmlKey);
- }
-
- public ELXmlKey addXmlKey() {
- if (this.xmlKey != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(ELJaxb.XML_KEY);
- ELJavaXmlKey xmlKey = buildXmlKey();
- setXmlKey_(xmlKey);
- return xmlKey;
- }
-
- public void removeXmlKey() {
- if (this.xmlKey == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(ELJaxb.XML_KEY);
- setXmlKey_(null);
- }
-
- protected void initXmlKey() {
- XmlKeyAnnotation annotation = getXmlKeyAnnotation();
- this.xmlKey = (annotation == null) ? null : buildXmlKey();
- }
-
- protected void syncXmlKey() {
- XmlKeyAnnotation annotation = getXmlKeyAnnotation();
- if (annotation != null) {
- if (this.xmlKey == null) {
- setXmlKey_(buildXmlKey());
- }
- }
- else {
- setXmlKey_(null);
- }
- }
-
- protected ELJavaXmlKey buildXmlKey() {
- return new ELJavaXmlKey(this, new XmlKeyContext());
- }
-
- protected XmlKeyAnnotation getXmlKeyAnnotation() {
- return (XmlKeyAnnotation) getJavaResourceAttribute().getAnnotation(ELJaxb.XML_KEY);
- }
-
-
- // ***** XmlCDATA *****
-
- public ELXmlCDATA getXmlCDATA() {
- return this.xmlCDATA;
- }
-
- protected void setXmlCDATA_(ELJavaXmlCDATA xmlCDATA) {
- ELJavaXmlCDATA old = this.xmlCDATA;
- this.xmlCDATA = xmlCDATA;
- firePropertyChanged(XML_CDATA_PROPERTY, old, this.xmlCDATA);
- }
-
- public ELXmlCDATA addXmlCDATA() {
- if (this.xmlCDATA != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(ELJaxb.XML_CDATA);
- ELJavaXmlCDATA xmlCDATA = buildXmlCDATA();
- setXmlCDATA_(xmlCDATA);
- return xmlCDATA;
- }
-
- public void removeXmlCDATA() {
- if (this.xmlCDATA == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(ELJaxb.XML_CDATA);
- setXmlCDATA_(null);
- }
-
- protected void initXmlCDATA() {
- XmlCDATAAnnotation annotation = getXmlCDATAAnnotation();
- this.xmlCDATA = (annotation == null) ? null : buildXmlCDATA();
- }
-
- protected void syncXmlCDATA() {
- XmlCDATAAnnotation annotation = getXmlCDATAAnnotation();
- if (annotation != null) {
- if (this.xmlCDATA == null) {
- setXmlCDATA_(buildXmlCDATA());
- }
- }
- else {
- setXmlCDATA_(null);
- }
- }
-
- protected ELJavaXmlCDATA buildXmlCDATA() {
- return new ELJavaXmlCDATA(this, new XmlCDATAContext());
- }
-
- protected XmlCDATAAnnotation getXmlCDATAAnnotation() {
- return (XmlCDATAAnnotation) getJavaResourceAttribute().getAnnotation(ELJaxb.XML_CDATA);
- }
-
-
- // ***** misc *****
-
- @Override
- protected XmlElement buildXmlElement() {
- return new ELJavaXmlElement(this, new XmlElementContext());
- }
-
- @Override
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new ELJavaXmlElementWrapper(this, new XmlElementWrapperContext());
- }
-
- public String getXPath() {
- if (this.xmlPath != null) {
- return this.xmlPath.getValue();
- }
-
- String name = this.xmlElement.getQName().getName();
- if (StringTools.stringIsEmpty(name)) {
- // no name is invalid
- return null;
- }
-
- String namespace = this.xmlElement.getQName().getNamespace();
- if (StringTools.stringIsEmpty(namespace)) {
- // empty namespace means "no" namespace
- return XPath.elementXPath(null, name);
- }
-
- String prefix = getJaxbPackage().getPackageInfo().getPrefixForNamespace(namespace);
- if (prefix == null) {
- // no prefix for non-null namespace is invalid
- return null;
- }
-
- return XPath.elementXPath(prefix, 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 (this.xmlPath != null) {
- result = this.xmlPath.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (this.xmlPath != null) {
- validateXmlPath(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlPath(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.xmlPath.validate(messages, reporter, astRoot);
- }
-
-
- protected class XmlPathContext
- implements ELJavaXmlPath.Context {
-
- public XmlPathAnnotation getAnnotation() {
- return ELJavaXmlElementMapping.this.getXmlPathAnnotation();
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return ELJavaXmlElementMapping.this;
- }
- }
-
-
- protected class XmlKeyContext
- implements ELJavaXmlKey.Context {
-
- public XmlKeyAnnotation getAnnotation() {
- return ELJavaXmlElementMapping.this.getXmlKeyAnnotation();
- }
- }
-
-
- protected class XmlCDATAContext
- implements ELJavaXmlCDATA.Context {
-
- public XmlCDATAAnnotation getAnnotation() {
- return ELJavaXmlElementMapping.this.getXmlCDATAAnnotation();
- }
- }
-
-
- protected class XmlElementContext
- extends GenericJavaXmlElementMapping.XmlElementContext
- implements ELJavaXmlElement.Context {
-
- public boolean hasXmlPath() {
- return ELJavaXmlElementMapping.this.xmlPath != null;
- }
- }
-
-
- protected class XmlElementWrapperContext
- implements ELJavaXmlElementWrapper.Context {
-
- public XmlElementWrapperAnnotation getAnnotation() {
- return ELJavaXmlElementMapping.this.getXmlElementWrapperAnnotation();
- }
-
- public boolean hasXmlPath() {
- return ELJavaXmlElementMapping.this.xmlPath != null;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMappingDefinition.java
deleted file mode 100644
index a43ed4991b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementMappingDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlElementMappingDefinition
- extends JavaXmlElementMappingDefinition {
-
- // singleton
- private static final ELJavaXmlElementMappingDefinition INSTANCE =
- new ELJavaXmlElementMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- ELJaxb.XML_CDATA,
- ELJaxb.XML_KEY,
- ELJaxb.XML_PATH };
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlElementMappingDefinition() {
- super();
- }
-
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return new CompositeIterable<String>(
- super.getSupportingAnnotationNames(),
- new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java
deleted file mode 100644
index 889f63159a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRef.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRef;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-public class ELJavaXmlElementRef
- extends GenericJavaXmlElementRef {
-
- public ELJavaXmlElementRef(JavaContextNode parent, GenericJavaXmlElementRef.Context context) {
- super(parent, context);
- }
-
-
- @Override
- protected boolean isTypeJAXBElement() {
- String fqType = getFullyQualifiedType();
- return fqType != null && JDTTools.typeIsSubType(getJaxbProject().getJavaProject(), getFullyQualifiedType(), JAXB.JAXB_ELEMENT);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefMapping.java
deleted file mode 100644
index f4fca14dc1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefMapping;
-
-
-public class ELJavaXmlElementRefMapping
- extends GenericJavaXmlElementRefMapping {
-
- public ELJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- @Override
- protected XmlElementRef buildXmlElementRef() {
- return new ELJavaXmlElementRef(this, new GenericJavaXmlElementRefMapping.XmlElementRefContext());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefsMapping.java
deleted file mode 100644
index 056696a4ba..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementRefsMapping.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefs;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefs;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-
-public class ELJavaXmlElementRefsMapping
- extends GenericJavaXmlElementRefsMapping {
-
- public ELJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- @Override
- protected XmlElementRefs buildXmlElementRefs() {
- return new GenericJavaXmlElementRefs(this, new XmlElementRefsContext());
- }
-
-
- protected class XmlElementRefsContext
- extends GenericJavaXmlElementRefsMapping.XmlElementRefsContext {
-
- @Override
- public XmlElementRef buildXmlElementRef(JavaContextNode parent, XmlElementRefAnnotation annotation) {
- return new ELJavaXmlElementRef(parent, new GenericJavaXmlElementRefsMapping.XmlElementRefContext(annotation));
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java
deleted file mode 100644
index d92928ae5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementWrapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.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.internal.context.java.GenericJavaXmlElementWrapper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlElementWrapper
- extends GenericJavaXmlElementWrapper {
-
- public ELJavaXmlElementWrapper(JaxbAttributeMapping parent, Context context) {
- super(parent, context);
- }
-
-
- protected Context getContext() {
- return (Context) this.context;
- }
-
- @Override
- protected void validateQName(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (! getContext().hasXmlPath()) {
- super.validateQName(messages, reporter, astRoot);
- }
- }
-
- public interface Context
- extends GenericJavaXmlElementWrapper.Context {
-
- boolean hasXmlPath();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java
deleted file mode 100644
index 9f8089240a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMapping.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import javax.xml.namespace.QName;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-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.SubListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlElementsMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlElementsMapping
- extends GenericJavaXmlElementsMapping
- implements ELXmlElementsMapping {
-
- protected final ContextListContainer<ELJavaXmlPath, XmlPathAnnotation> xmlPathContainer;
-
-
- public ELJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlPathContainer = buildXmlPathContainer();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlPathContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlPathContainer.update();
- }
-
-
- // ***** xmlPaths *****
-
- public ListIterable<ELXmlPath> getXmlPaths() {
- return new SuperListIterableWrapper<ELXmlPath>(this.xmlPathContainer.getContextElements());
- }
-
- public int getXmlPathsSize() {
- return this.xmlPathContainer.getContextElementsSize();
- }
-
- public ELXmlPath addXmlPath(int index) {
- XmlPathAnnotation annotation = (XmlPathAnnotation) getJavaResourceAttribute().addAnnotation(index, ELJaxb.XML_PATH);
- return this.xmlPathContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlPath(int index) {
- getJavaResourceAttribute().removeAnnotation(index, ELJaxb.XML_PATH);
- this.xmlPathContainer.removeContextElement(index);
- }
-
- public void moveXmlPath(int targetIndex, int sourceIndex) {
- getJavaResourceAttribute().moveAnnotation(targetIndex, sourceIndex, ELJaxb.XML_PATH);
- this.xmlPathContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected ELJavaXmlPath buildXmlPath(XmlPathAnnotation xmlPathAnnotation) {
- return new ELJavaXmlPath(this, new XmlPathContext(xmlPathAnnotation));
- }
-
- protected ContextListContainer<ELJavaXmlPath, XmlPathAnnotation> buildXmlPathContainer() {
- XmlPathContainer container = new XmlPathContainer();
- container.initialize();
- return container;
- }
-
- protected ListIterable<XmlPathAnnotation> getXmlPathAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlPathAnnotation>(
- getJavaResourceAttribute().getAnnotations(ELJaxb.XML_PATH));
- }
-
-
- // ***** misc *****
-
- @Override
- protected XmlElement buildXmlElement(XmlElementAnnotation xmlElementAnnotation) {
- return new ELJavaXmlElement(this, new XmlElementContext(xmlElementAnnotation));
- }
-
- @Override
- protected XmlElementWrapper buildXmlElementWrapper() {
- return new ELJavaXmlElementWrapper(this, new XmlElementWrapperContext());
- }
-
-
- // ***** 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 (ELJavaXmlPath xmlPath : this.xmlPathContainer.getContextElements()) {
- result = xmlPath.getJavaCompletionProposals(pos, filter, astRoot);
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (getXmlPathsSize() > 0 ) {
- validateXmlPaths(messages, reporter, astRoot);
- }
- }
-
- protected void validateXmlPaths(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- Iterator<XmlElement> xmlElements = getXmlElements().iterator();
- Iterator<ELJavaXmlPath> xmlPaths = this.xmlPathContainer.getContextElements().iterator();
-
- while (xmlElements.hasNext() && xmlPaths.hasNext()) {
- xmlElements.next();
- xmlPaths.next();
- }
-
- if (xmlElements.hasNext()) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_PATH__INSUFFICIENT_XML_PATHS_FOR_XML_ELEMENTS,
- this,
- getXmlPathsTextRange(astRoot)));
- }
-
- while (xmlPaths.hasNext()) {
- ELJavaXmlPath xmlPath = xmlPaths.next();
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_PATH__INSUFFICIENT_XML_ELEMENTS_FOR_XML_PATHS,
- this,
- xmlPath.getValidationTextRange(astRoot)));
- }
-
- for (ELJavaXmlPath xmlPath : this.xmlPathContainer.getContextElements()) {
- xmlPath.validate(messages, reporter, astRoot);
- }
- }
-
- @Override
- protected void validateDuplicateQName(XmlElement xmlElement, Bag<QName> xmlElementQNames,
- List<IMessage> messages, CompilationUnit astRoot) {
-
- if (getXmlPathsSize() == 0) {
- super.validateDuplicateQName(xmlElement, xmlElementQNames, messages, astRoot);
- }
- }
-
- protected TextRange getXmlPathsTextRange(CompilationUnit astRoot) {
- Annotation annotation = getJavaResourceAttribute().getAnnotation(ELJaxb.XML_PATHS);
- if (annotation == null) {
- annotation = getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_PATH);
- }
- return annotation.getTextRange(astRoot);
- }
-
-
- protected class XmlPathContainer
- extends ContextListContainer<ELJavaXmlPath, XmlPathAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return ELXmlElementsMapping.XML_PATHS_LIST;
- }
-
- @Override
- protected ELJavaXmlPath buildContextElement(XmlPathAnnotation resourceElement) {
- return ELJavaXmlElementsMapping.this.buildXmlPath(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlPathAnnotation> getResourceElements() {
- return ELJavaXmlElementsMapping.this.getXmlPathAnnotations();
- }
-
- @Override
- protected XmlPathAnnotation getResourceElement(ELJavaXmlPath contextElement) {
- // in the context of this mapping, there will never be an ELXmlPath without an annotation
- return contextElement.getAnnotation();
- }
- }
-
-
- protected class XmlPathContext
- implements ELJavaXmlPath.Context {
-
- protected XmlPathAnnotation annotation;
-
-
- protected XmlPathContext(XmlPathAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlPathAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public JaxbAttributeMapping getAttributeMapping() {
- return ELJavaXmlElementsMapping.this;
- }
- }
-
-
- protected class XmlElementContext
- extends GenericJavaXmlElementsMapping.XmlElementContext
- implements ELJavaXmlElement.Context {
-
- protected XmlElementContext(XmlElementAnnotation annotation) {
- super(annotation);
- }
-
- public boolean hasXmlPath() {
- return ELJavaXmlElementsMapping.this.getXmlPathsSize() > 0;
- }
- }
-
- protected class XmlElementWrapperContext
- implements ELJavaXmlElementWrapper.Context {
-
- public XmlElementWrapperAnnotation getAnnotation() {
- return ELJavaXmlElementsMapping.this.getXmlElementWrapperAnnotation();
- }
-
- public boolean hasXmlPath() {
- return ELJavaXmlElementsMapping.this.getXmlPathsSize() > 0;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMappingDefinition.java
deleted file mode 100644
index 3c2ccb1d11..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlElementsMappingDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlElementsMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlElementsMappingDefinition
- extends JavaXmlElementsMappingDefinition {
-
-
- // singleton
- private static final ELJavaXmlElementsMappingDefinition INSTANCE =
- new ELJavaXmlElementsMappingDefinition();
-
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- ELJaxb.XML_PATH,
- ELJaxb.XML_PATHS };
-
- /**
- * Return the singleton.
- */
- public static ELJavaXmlElementsMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlElementsMappingDefinition() {
- super();
- }
-
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return new CompositeIterable<String>(
- super.getSupportingAnnotationNames(),
- new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java
deleted file mode 100644
index 7a158912b0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlID.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.jaxb.core.context.XmlNamedNodeMapping;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlID;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class ELJavaXmlID
- extends GenericJavaXmlID {
-
- public ELJavaXmlID(XmlNamedNodeMapping parent, XmlIDAnnotation annotation) {
- super(parent, annotation);
- }
-
-
- @Override
- protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) {
- // no op - MOXy does not require String attribute types
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
deleted file mode 100644
index 48bf63d813..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMapping.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.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.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlInverseReferenceMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlInverseReferenceMapping
- extends AbstractJavaAttributeMapping<XmlInverseReferenceAnnotation>
- implements ELXmlInverseReferenceMapping {
-
- protected String mappedBy;
-
-
- public ELJavaXmlInverseReferenceMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.mappedBy = getResourceMappedBy();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- setMappedBy_(getResourceMappedBy());
- }
-
-
- // ***** mappedBy *****
-
- public String getMappedBy() {
- return mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- getXmlInverseReferenceAnnotation().setMappedBy(mappedBy);
- setMappedBy_(mappedBy);
- }
-
- protected void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- public XmlInverseReferenceAnnotation getXmlInverseReferenceAnnotation() {
- return (XmlInverseReferenceAnnotation) getJavaResourceAttribute().getAnnotation(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
- public String getResourceMappedBy() {
- return getXmlInverseReferenceAnnotation().getMappedBy();
- }
-
-
- // ***** misc *****
-
- protected JaxbClassMapping getReferencedClassMapping() {
- String referencedClassName = getValueTypeName();
- return (referencedClassName == null) ? null : getContextRoot().getClassMapping(referencedClassName);
- }
-
- protected JaxbPersistentAttribute getReferencedAttribute() {
- String mappedBy = getMappedBy();
- if (StringTools.stringIsEmpty(mappedBy)) {
- return null;
- }
- JaxbClassMapping referencedClassMapping = getReferencedClassMapping();
- if (referencedClassMapping == null) {
- return null;
- }
- JaxbPersistentAttribute tempResult = null;
- for (JaxbPersistentAttribute attribute : referencedClassMapping.getAllLocallyDefinedAttributes()) {
- if (attribute.getName().equals(mappedBy)) {
- if (attribute.getMappingKey() == MappingKeys.XML_TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- tempResult = attribute;
- }
- else {
- return attribute;
- }
- }
- }
- return tempResult;
- }
-
-
- // ***** 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 (getXmlInverseReferenceAnnotation().mappedByTouches(pos, astRoot)) {
- result = getMappedByProposals(filter, astRoot);
- }
- if (! CollectionTools.isEmpty(result)) {
- return result;
- }
-
- return EmptyIterable.instance();
- }
-
- protected Iterable<String> getMappedByProposals(Filter<String> filter, CompilationUnit astRoot) {
- JaxbClassMapping referencedClassMapping = getReferencedClassMapping();
-
- if (referencedClassMapping == null) {
- return EmptyIterable.instance();
- }
-
- return StringTools.convertToJavaStringLiterals(
- new TransformationIterable<JaxbPersistentAttribute, String>(referencedClassMapping.getAllLocallyDefinedAttributes()) {
- @Override
- protected String transform(JaxbPersistentAttribute o) {
- return o.getName();
- }
- });
- }
-
-
- // ***** validation *****
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateMappedBy(messages, reporter, astRoot);
- }
-
- protected void validateMappedBy(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(mappedBy)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_NOT_SPECIFIED,
- this,
- getMappedByTextRange(astRoot)));
- return;
- }
-
- JaxbClassMapping referencedClassMapping = getReferencedClassMapping();
- if (referencedClassMapping == null) {
- // TODO validate?
- return;
- }
-
- JaxbPersistentAttribute referencedAttribute = getReferencedAttribute();
- if (referencedAttribute == null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_NOT_RESOLVED,
- new String[] { mappedBy, referencedClassMapping.getJaxbType().getFullyQualifiedName() },
- this,
- getMappedByTextRange(astRoot)));
- }
- else if (
- ! ArrayTools.contains(
- getValidReferencedAttributeMappingKeys(),
- referencedAttribute.getMappingKey())) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_INVERSE_REFERENCE__MAPPED_BY_ILLEGAL_MAPPING_TYPE,
- new String[] { mappedBy, referencedClassMapping.getJaxbType().getFullyQualifiedName() },
- this,
- getMappedByTextRange(astRoot)));
- }
- }
-
- protected String[] getValidReferencedAttributeMappingKeys() {
- return VALID_REFERENCED_ATTRIBUTE_MAPPING_KEYS;
- }
-
- protected static final String[] VALID_REFERENCED_ATTRIBUTE_MAPPING_KEYS = new String[] {
- MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY
- };
-
- protected TextRange getMappedByTextRange(CompilationUnit astRoot) {
- TextRange textRange = getXmlInverseReferenceAnnotation().getMappedByTextRange(astRoot);
- return (textRange != null) ? textRange : getValidationTextRange(astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java
deleted file mode 100644
index 17b1cf27c6..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlInverseReferenceMappingDefinition.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.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.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.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlInverseReferenceMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new ELJavaXmlInverseReferenceMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlInverseReferenceMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- // TODO: move to factory once API opens up again
- return new ELJavaXmlInverseReferenceMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java
deleted file mode 100644
index 8c7a989c4a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNode.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNodesMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPathFactory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlJoinNode
- extends AbstractJavaContextNode
- implements ELXmlJoinNode {
-
- protected String xmlPath;
-
- protected String referencedXmlPath;
-
- protected Context context;
-
-
- public ELJavaXmlJoinNode(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- initXmlPath();
- initReferencedXmlPath();
- }
-
-
- protected JaxbPackage getJaxbPackage() {
- return getClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlPath();
- syncReferencedXmlPath();
- }
-
-
- // ***** xmlPath *****
-
- public String getXmlPath() {
- return this.xmlPath;
- }
-
- public void setXmlPath(String xmlPath) {
- getAnnotation().setXmlPath(xmlPath);
- setXmlPath_(xmlPath);
- }
-
- protected void setXmlPath_(String xmlPath) {
- String old = this.xmlPath;
- this.xmlPath = xmlPath;
- firePropertyChanged(XML_PATH_PROPERTY, old, this.xmlPath);
- }
-
- protected void initXmlPath() {
- this.xmlPath = getAnnotation().getXmlPath();
- }
-
- protected void syncXmlPath() {
- setXmlPath_(getAnnotation().getXmlPath());
- }
-
-
- // ***** referencedXmlPath *****
-
- public String getReferencedXmlPath() {
- return this.referencedXmlPath;
- }
-
- public void setReferencedXmlPath(String referencedXmlPath) {
- getAnnotation().setReferencedXmlPath(referencedXmlPath);
- setReferencedXmlPath_(referencedXmlPath);
- }
-
- protected void setReferencedXmlPath_(String referencedXmlPath) {
- String old = this.referencedXmlPath;
- this.referencedXmlPath = referencedXmlPath;
- firePropertyChanged(REFERENCED_XML_PATH_PROPERTY, old, this.referencedXmlPath);
- }
-
- protected void initReferencedXmlPath() {
- this.referencedXmlPath = getAnnotation().getReferencedXmlPath();
- }
-
- protected void syncReferencedXmlPath() {
- setReferencedXmlPath_(getAnnotation().getReferencedXmlPath());
- }
-
-
- protected XmlJoinNodeAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
- protected ELXmlJoinNodesMapping getAttributeMapping() {
- return this.context.getAttributeMapping();
- }
-
- protected JaxbClassMapping getClassMapping() {
- return getAttributeMapping().getClassMapping();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- if (getAnnotation().xmlPathTouches(pos, astRoot) && this.xmlPath != null) {
- XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.xmlPath);
- return xpath.getCompletionProposals(new XmlPathContext(astRoot), xsdType, pos, filter);
- }
-
- if (getAnnotation().referencedXmlPathTouches(pos, astRoot) && this.referencedXmlPath != null) {
-
-
- XsdTypeDefinition xsdType = getAttributeMapping().getReferencedXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.referencedXmlPath);
- Iterable<String> result = xpath.getCompletionProposals(new ReferencedXmlPathContext(astRoot), xsdType, pos, filter);
-
- ELClassMapping referencedClassMapping = this.context.getAttributeMapping().getReferencedClassMapping();
- if (referencedClassMapping != null) {
- result = new CompositeIterable<String>(
- result,
- StringTools.convertToJavaStringLiterals(referencedClassMapping.getKeyXPaths()));
- }
-
- return CollectionTools.sortedSet(result);
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- validateXmlPath(messages, astRoot);
- validateReferencedXmlPath(messages, astRoot);
- }
-
- protected void validateXmlPath(List<IMessage> messages, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(this.xmlPath)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_JOIN_NODE__XML_PATH_NOT_SPECIFIED,
- ELJavaXmlJoinNode.this,
- getXmlPathTextRange(astRoot)));
- return;
- }
-
- if (this.xmlPath.startsWith(XPath.DELIM)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
- ELJavaXmlJoinNode.this,
- getXmlPathTextRange(astRoot)));
- return;
- }
-
- XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.xmlPath);
- xpath.validate(new XmlPathContext(astRoot), xsdType, messages);
- }
-
- protected void validateReferencedXmlPath(List<IMessage> messages, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(this.referencedXmlPath)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_SPECIFIED,
- ELJavaXmlJoinNode.this,
- getReferencedXmlPathTextRange(astRoot)));
- return;
- }
-
- if (this.referencedXmlPath.startsWith(XPath.DELIM)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
- ELJavaXmlJoinNode.this,
- getReferencedXmlPathTextRange(astRoot)));
- return;
- }
-
- ELClassMapping referencedClassMapping = this.context.getAttributeMapping().getReferencedClassMapping();
- if (referencedClassMapping != null &&
- ! CollectionTools.contains(referencedClassMapping.getKeyXPaths(), this.referencedXmlPath)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_IN_REFERENCED_CLASS_KEYS,
- new String[] { referencedClassMapping.getJaxbType().getFullyQualifiedName(), this.referencedXmlPath },
- ELJavaXmlJoinNode.this,
- getReferencedXmlPathTextRange(astRoot)));
- }
-
- XsdTypeDefinition xsdType = getAttributeMapping().getReferencedXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.referencedXmlPath);
- xpath.validate(new ReferencedXmlPathContext(astRoot), xsdType, messages);
- }
-
- protected TextRange getXmlPathTextRange(CompilationUnit astRoot) {
- // should never be null
- return getAnnotation().getXmlPathTextRange(astRoot);
- }
-
- protected TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot) {
- // should never be null
- return getAnnotation().getReferencedXmlPathTextRange(astRoot);
- }
-
-
- public interface Context {
-
- XmlJoinNodeAnnotation getAnnotation();
-
- ELXmlJoinNodesMapping getAttributeMapping();
- }
-
-
- protected abstract class XPathContext
- implements XPath.Context {
-
- protected CompilationUnit astRoot;
-
- protected XPathContext(CompilationUnit astRoot) {
- this.astRoot = astRoot;
- }
-
-
- public JaxbNode getContextObject() {
- return ELJavaXmlJoinNode.this;
- }
-
- public JaxbPackage getJaxbPackage() {
- return ELJavaXmlJoinNode.this.getJaxbPackage();
- }
- }
-
-
- protected class XmlPathContext
- extends XPathContext {
-
- protected XmlPathContext(CompilationUnit astRoot) {
- super(astRoot);
- }
-
-
- public TextRange getTextRange() {
- return ELJavaXmlJoinNode.this.getXmlPathTextRange(this.astRoot);
- }
- }
-
-
- protected class ReferencedXmlPathContext
- extends XPathContext {
-
- protected ReferencedXmlPathContext(CompilationUnit astRoot) {
- super(astRoot);
- }
-
-
- public TextRange getTextRange() {
- return ELJavaXmlJoinNode.this.getReferencedXmlPathTextRange(this.astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java
deleted file mode 100644
index 2752036b04..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMapping.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Bag;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.HashBag;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlElementsMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNodesMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlJoinNodesMapping
- extends AbstractJavaAttributeMapping
- implements ELXmlJoinNodesMapping {
-
- protected final ContextListContainer<ELJavaXmlJoinNode, XmlJoinNodeAnnotation> xmlJoinNodeContainer;
-
-
- public ELJavaXmlJoinNodesMapping(JaxbPersistentAttribute parent) {
- super(parent);
- this.xmlJoinNodeContainer = buildXmlJoinNodeContainer();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_JOIN_NODES_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return ELJaxb.XML_JOIN_NODES;
- }
-
-
- // ***** overrides *****
-
- @Override
- protected boolean buildDefault() {
- return getAnnotation() == null
- && CollectionTools.isEmpty(getPersistentAttribute().getJavaResourceAttribute().getAnnotations(ELJaxb.XML_JOIN_NODE));
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.xmlJoinNodeContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.xmlJoinNodeContainer.update();
- }
-
-
- // ***** xmlJoinNodes *****
-
- public ListIterable<ELXmlJoinNode> getXmlJoinNodes() {
- return new SuperListIterableWrapper<ELXmlJoinNode>(this.xmlJoinNodeContainer.getContextElements());
- }
-
- public int getXmlJoinNodesSize() {
- return this.xmlJoinNodeContainer.getContextElementsSize();
- }
-
- public ELXmlJoinNode addXmlJoinNode(int index) {
- XmlJoinNodeAnnotation annotation =
- (XmlJoinNodeAnnotation) getJavaResourceAttribute().addAnnotation(index, ELJaxb.XML_JOIN_NODE);
- return this.xmlJoinNodeContainer.addContextElement(index, annotation);
- }
-
- public void removeXmlJoinNode(int index) {
- getJavaResourceAttribute().removeAnnotation(index, ELJaxb.XML_JOIN_NODE);
- this.xmlJoinNodeContainer.removeContextElement(index);
- }
-
- public void moveXmlJoinNode(int targetIndex, int sourceIndex) {
- getJavaResourceAttribute().moveAnnotation(targetIndex, sourceIndex, ELJaxb.XML_JOIN_NODE);
- this.xmlJoinNodeContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected ELJavaXmlJoinNode buildXmlJoinNode(XmlJoinNodeAnnotation xmlJoinNodeAnnotation) {
- return new ELJavaXmlJoinNode(this, new XmlJoinNodeContext(xmlJoinNodeAnnotation));
- }
-
- protected ContextListContainer<ELJavaXmlJoinNode, XmlJoinNodeAnnotation> buildXmlJoinNodeContainer() {
- XmlJoinNodeContainer container = new XmlJoinNodeContainer();
- container.initialize();
- return container;
- }
-
- protected ListIterable<XmlJoinNodeAnnotation> getXmlJoinNodeAnnotations() {
- return new SubListIterableWrapper<NestableAnnotation, XmlJoinNodeAnnotation>(
- getJavaResourceAttribute().getAnnotations(ELJaxb.XML_JOIN_NODE));
- }
-
-
- // ***** misc *****
-
- public ELClassMapping getReferencedClassMapping() {
- String valueType = getValueTypeName();
- if (StringTools.stringIsEmpty(valueType)) {
- return null;
- }
-
- return (ELClassMapping) getContextRoot().getClassMapping(valueType);
- }
-
- public XsdTypeDefinition getReferencedXsdTypeDefinition() {
- JaxbClassMapping classMapping = getReferencedClassMapping();
- return (classMapping == null) ? null : classMapping.getXsdTypeDefinition();
- }
-
-
- // ***** 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 (ELJavaXmlJoinNode xmlJoinNode : this.xmlJoinNodeContainer.getContextElements()) {
- result = xmlJoinNode.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);
-
- JaxbClassMapping referencedClass = getReferencedClassMapping();
-
- if (referencedClass == null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_JOIN_NODES__INVALID_REFERENCED_CLASS,
- new String[] { getValueTypeName() },
- ELJavaXmlJoinNodesMapping.this,
- getValidationTextRange(astRoot)));
- }
-
- validateDuplicateXmlPaths(messages, reporter, astRoot);
-
- for (ELJavaXmlJoinNode xmlJoinNode : this.xmlJoinNodeContainer.getContextElements()) {
- xmlJoinNode.validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateDuplicateXmlPaths(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- Bag<String> xmlPaths = new HashBag<String>();
- Bag<String> referencedXmlPaths = new HashBag<String>();
-
- for (ELJavaXmlJoinNode joinNode : this.xmlJoinNodeContainer.getContextElements()) {
- String xmlPath = joinNode.getXmlPath();
- if (! StringTools.stringIsEmpty(xmlPath)) {
- xmlPaths.add(xmlPath);
- }
- String referencedXmlPath = joinNode.getReferencedXmlPath();
- if (! StringTools.stringIsEmpty(referencedXmlPath)) {
- referencedXmlPaths.add(referencedXmlPath);
- }
- }
-
- for (ELJavaXmlJoinNode joinNode : this.xmlJoinNodeContainer.getContextElements()) {
- validateDuplicateXmlPath(joinNode, xmlPaths, messages, astRoot);
- validateDuplicateReferencedXmlPath(joinNode, referencedXmlPaths, messages, astRoot);
- }
- }
-
- protected void validateDuplicateXmlPath(ELJavaXmlJoinNode joinNode, Bag<String> xmlPaths,
- List<IMessage> messages, CompilationUnit astRoot) {
- String xmlPath = joinNode.getXmlPath();
- if (xmlPaths.count(xmlPath) > 1) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_JOIN_NODES__DUPLICATE_XML_PATH,
- new String[] { xmlPath },
- joinNode,
- joinNode.getXmlPathTextRange(astRoot)));
- }
- }
-
- protected void validateDuplicateReferencedXmlPath(ELJavaXmlJoinNode joinNode, Bag<String> referencedXmlPaths,
- List<IMessage> messages, CompilationUnit astRoot) {
- String referencedXmlPath = joinNode.getReferencedXmlPath();
- if (referencedXmlPaths.count(referencedXmlPath) > 1) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_JOIN_NODES__DUPLICATE_REFERENCED_XML_PATH,
- new String[] { referencedXmlPath },
- joinNode,
- joinNode.getReferencedXmlPathTextRange(astRoot)));
- }
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- Annotation annotation = getAnnotation();
- if (annotation == null) {
- annotation = getJavaResourceAttribute().getAnnotation(0, ELJaxb.XML_JOIN_NODE);
- }
- return annotation.getTextRange(astRoot);
- }
-
-
- protected class XmlJoinNodeContainer
- extends ContextListContainer<ELJavaXmlJoinNode, XmlJoinNodeAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return ELXmlElementsMapping.XML_PATHS_LIST;
- }
-
- @Override
- protected ELJavaXmlJoinNode buildContextElement(XmlJoinNodeAnnotation resourceElement) {
- return ELJavaXmlJoinNodesMapping.this.buildXmlJoinNode(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlJoinNodeAnnotation> getResourceElements() {
- return ELJavaXmlJoinNodesMapping.this.getXmlJoinNodeAnnotations();
- }
-
- @Override
- protected XmlJoinNodeAnnotation getResourceElement(ELJavaXmlJoinNode contextElement) {
- // in the context of this mapping, there will never be an ELXmlJoinNode without an annotation
- return contextElement.getAnnotation();
- }
- }
-
-
- protected class XmlJoinNodeContext
- implements ELJavaXmlJoinNode.Context {
-
- protected XmlJoinNodeAnnotation annotation;
-
-
- protected XmlJoinNodeContext(XmlJoinNodeAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public XmlJoinNodeAnnotation getAnnotation() {
- return this.annotation;
- }
-
- public ELXmlJoinNodesMapping getAttributeMapping() {
- return ELJavaXmlJoinNodesMapping.this;
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMappingDefinition.java
deleted file mode 100644
index 79ee58039c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlJoinNodesMappingDefinition.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-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.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlJoinNodesMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final ELJavaXmlJoinNodesMappingDefinition INSTANCE =
- new ELJavaXmlJoinNodesMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES = { ELJaxb.XML_JOIN_NODE };
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlJoinNodesMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_JOIN_NODES_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_JOIN_NODES;
- }
-
- @Override
- public boolean isSpecified(JaxbPersistentAttribute persistentAttribute) {
- return super.isSpecified(persistentAttribute)
- || ! CollectionTools.isEmpty(persistentAttribute.getJavaResourceAttribute().getAnnotations(ELJaxb.XML_JOIN_NODE));
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return new ArrayListIterable<String>(SUPPORTING_ANNOTATION_NAMES);
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- return new ELJavaXmlJoinNodesMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java
deleted file mode 100644
index 4f0122a7bc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlKey.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.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.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlKey;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlKeyAnnotation;
-
-
-public class ELJavaXmlKey
- extends AbstractJavaContextNode
- implements ELXmlKey {
-
- protected final Context context;
-
-
- public ELJavaXmlKey(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- }
-
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.context.getAnnotation().getTextRange(astRoot);
- }
-
-
- public interface Context {
-
- XmlKeyAnnotation getAnnotation();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java
deleted file mode 100644
index 63b716e6c7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlPath.java
+++ /dev/null
@@ -1,182 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.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.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaContextNode;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java.XPathFactory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class ELJavaXmlPath
- extends AbstractJavaContextNode
- implements ELXmlPath {
-
- protected String value;
-
- protected Context context;
-
-
- public ELJavaXmlPath(JavaContextNode parent, Context context) {
- super(parent);
- this.context = context;
- initValue();
- }
-
-
- protected JaxbPackage getJaxbPackage() {
- return getClassMapping().getJaxbType().getJaxbPackage();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncValue();
- }
-
-
- // ***** value *****
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- getAnnotation().setValue(value);
- setValue_(value);
- }
-
- protected void setValue_(String value) {
- String old = this.value;
- this.value = value;
- firePropertyChanged(VALUE_PROPERTY, old, this.value);
- }
-
- protected void initValue() {
- this.value = getAnnotation().getValue();
- }
-
- protected void syncValue() {
- setValue_(getAnnotation().getValue());
- }
-
- protected XmlPathAnnotation getAnnotation() {
- return this.context.getAnnotation();
- }
-
- protected JaxbAttributeMapping getAttributeMapping() {
- return this.context.getAttributeMapping();
- }
-
- protected JaxbClassMapping getClassMapping() {
- return getAttributeMapping().getClassMapping();
- }
-
-
- // ***** content assist *****
-
- @Override
- public Iterable<String> getJavaCompletionProposals(
- int pos, Filter<String> filter, CompilationUnit astRoot) {
-
- if (getAnnotation().valueTouches(pos, astRoot) && this.value != null) {
- XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.value);
- return xpath.getCompletionProposals(new XPathContext(astRoot), xsdType, pos, filter);
- }
-
- return EmptyIterable.instance();
- }
-
-
- // ***** validation *****
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (StringTools.stringIsEmpty(this.value)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XML_PATH__NOT_SPECIFIED,
- ELJavaXmlPath.this,
- getValueTextRange(astRoot)));
- return;
- }
-
- if (this.value.startsWith(XPath.DELIM)) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__ROOT_NOT_SUPPORTED,
- ELJavaXmlPath.this,
- getValueTextRange(astRoot)));
- return;
- }
-
- XsdTypeDefinition xsdType = getClassMapping().getXsdTypeDefinition();
- XPath xpath = XPathFactory.instance().getXpath(this.value);
- xpath.validate(new XPathContext(astRoot), xsdType, messages);
- }
-
- protected TextRange getValueTextRange(CompilationUnit astRoot) {
- // should never be null
- return getAnnotation().getValueTextRange(astRoot);
- }
-
-
- public interface Context {
-
- XmlPathAnnotation getAnnotation();
-
- JaxbAttributeMapping getAttributeMapping();
- }
-
-
- protected class XPathContext
- implements XPath.Context {
-
- private CompilationUnit astRoot;
-
- protected XPathContext(CompilationUnit astRoot) {
- this.astRoot = astRoot;
- }
-
-
- public JaxbNode getContextObject() {
- return ELJavaXmlPath.this;
- }
-
- public JaxbPackage getJaxbPackage() {
- return ELJavaXmlPath.this.getJaxbPackage();
- }
-
- public TextRange getTextRange() {
- return ELJavaXmlPath.this.getValueTextRange(this.astRoot);
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.java
deleted file mode 100644
index 036908cb6c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMapping.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class ELJavaXmlTransformationMapping
- extends AbstractJavaAttributeMapping<XmlTransformationAnnotation> {
-
- public ELJavaXmlTransformationMapping(JaxbPersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.java
deleted file mode 100644
index afd05f47a2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlTransformationMappingDefinition.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.eclipselink.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.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.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlTransformationMappingDefinition
- extends AbstractJavaAttributeMappingDefinition {
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new ELJavaXmlTransformationMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlTransformationMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JaxbAttributeMapping buildMapping(JaxbPersistentAttribute parent, JaxbFactory factory) {
- // TODO: move to factory once API opens up again
- return new ELJavaXmlTransformationMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMapping.java
deleted file mode 100644
index e3521bfbbf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMapping.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlValueMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlCDATA;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlValueMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlCDATAAnnotation;
-
-
-public class ELJavaXmlValueMapping
- extends GenericJavaXmlValueMapping
- implements ELXmlValueMapping {
-
- protected ELJavaXmlCDATA xmlCDATA;
-
-
- public ELJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- super(parent);
- initXmlCDATA();
- }
-
-
- // ***** sync/update *****
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- syncXmlCDATA();
- }
-
-
- // ***** XmlCDATA *****
-
- public ELXmlCDATA getXmlCDATA() {
- return this.xmlCDATA;
- }
-
- protected void setXmlCDATA_(ELJavaXmlCDATA xmlCDATA) {
- ELJavaXmlCDATA old = this.xmlCDATA;
- this.xmlCDATA = xmlCDATA;
- firePropertyChanged(XML_CDATA_PROPERTY, old, this.xmlCDATA);
- }
-
- public ELXmlCDATA addXmlCDATA() {
- if (this.xmlCDATA != null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().addAnnotation(ELJaxb.XML_CDATA);
- ELJavaXmlCDATA xmlCDATA = buildXmlCDATA();
- setXmlCDATA_(xmlCDATA);
- return xmlCDATA;
- }
-
- public void removeXmlCDATA() {
- if (this.xmlCDATA == null) {
- throw new IllegalStateException();
- }
- getJavaResourceAttribute().removeAnnotation(ELJaxb.XML_CDATA);
- setXmlCDATA_(null);
- }
-
- protected void initXmlCDATA() {
- XmlCDATAAnnotation annotation = getXmlCDATAAnnotation();
- this.xmlCDATA = (annotation == null) ? null : buildXmlCDATA();
- }
-
- protected void syncXmlCDATA() {
- XmlCDATAAnnotation annotation = getXmlCDATAAnnotation();
- if (annotation != null) {
- if (this.xmlCDATA == null) {
- setXmlCDATA_(buildXmlCDATA());
- }
- }
- else {
- setXmlCDATA_(null);
- }
- }
-
- protected ELJavaXmlCDATA buildXmlCDATA() {
- return new ELJavaXmlCDATA(this, new XmlCDATAContext());
- }
-
- protected XmlCDATAAnnotation getXmlCDATAAnnotation() {
- return (XmlCDATAAnnotation) getJavaResourceAttribute().getAnnotation(ELJaxb.XML_CDATA);
- }
-
-
- protected class XmlCDATAContext
- implements ELJavaXmlCDATA.Context {
-
- public XmlCDATAAnnotation getAnnotation() {
- return ELJavaXmlValueMapping.this.getXmlCDATAAnnotation();
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMappingDefinition.java
deleted file mode 100644
index 8f209d1f95..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/java/ELJavaXmlValueMappingDefinition.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.context.java.JavaXmlValueMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class ELJavaXmlValueMappingDefinition
- extends JavaXmlValueMappingDefinition {
-
- // singleton
- private static final ELJavaXmlValueMappingDefinition INSTANCE =
- new ELJavaXmlValueMappingDefinition();
-
- private static final String[] SUPPORTING_ANNOTATION_NAMES =
- {
- ELJaxb.XML_CDATA };
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected ELJavaXmlValueMappingDefinition() {
- super();
- }
-
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return new CompositeIterable<String>(
- super.getSupportingAnnotationNames(),
- new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES));
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java
deleted file mode 100644
index 0415dbb21d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPath.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java;
-
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jpt.common.core.internal.utility.SimpleTextRange;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-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.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.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.xsd.XsdAttributeUse;
-import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration;
-import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessageBuilder;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.validation.ELJaxbValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class XPath {
-
- public static String DELIM = "/";
-
- public static String ATT_PREFIX = "@";
-
- public static String TEXT = "text()";
-
- public static String SELF = ".";
-
- public static String COLON = ":";
-
- public static char OPEN_BRACKET = '[';
-
- public static char CLOSE_BRACKET = ']';
-
-
- public static String attributeXPath(String prefix, String localName) {
- if (prefix == null) {
- return StringTools.concatenate(ATT_PREFIX, localName);
- }
- return StringTools.concatenate(ATT_PREFIX, prefix, COLON, localName);
- }
-
- public static String elementXPath(String prefix, String localName) {
- if (prefix == null) {
- return localName;
- }
- return StringTools.concatenate(prefix, COLON, localName);
- }
-
-
- List<Step> steps;
-
-
- XPath(String xpathString) {
- this.steps = new Vector<Step>();
- parse(xpathString);
- }
-
-
- protected int getIndex(Step step) {
- return this.steps.indexOf(step);
- }
-
- protected Step getFirstStep() {
- if (this.steps.size() > 0) {
- return this.steps.get(0);
- }
- return null;
- }
-
- protected Step getNextStep(Step step) {
- int nextIndex = getIndex(step) + 1;
- if (this.steps.size() > nextIndex) {
- return this.steps.get(nextIndex);
- }
- return null;
- }
-
- protected void parse(String xpath) {
- for (String segment : xpath.split(DELIM, -1)) {
- this.steps.add(createStep(segment));
- }
- }
-
- protected Step createStep(String stepValue) {
- if (TEXT.equals(stepValue)) {
- return new TextStep();
- }
- else if (SELF.equals(stepValue)) {
- return new SelfStep();
- }
- else if (stepValue.startsWith(ATT_PREFIX)) {
- return tryCreateAttributeStep(stepValue);
- }
- else {
- return tryCreateElementStep(stepValue);
- }
- }
-
- protected Step tryCreateAttributeStep(String stepValue) {
- // must start with "@" - already tested that
- try {
- String attributeStepValue = stepValue.substring(1);
- String[] stepParts = parseStepParts(attributeStepValue);
- return new AttributeStep(stepParts[0], stepParts[1], ArrayTools.subArray(stepParts, 2, stepParts.length));
- }
- catch (IllegalArgumentException ife) {
- return new InvalidStep(stepValue);
- }
- }
-
- protected Step tryCreateElementStep(String stepValue) {
- try {
- String[] stepParts = parseStepParts(stepValue);
- return new ElementStep(stepParts[0], stepParts[1], ArrayTools.subArray(stepParts, 2, stepParts.length));
- }
- catch (IllegalArgumentException ife) {
- return new InvalidStep(stepValue);
- }
- }
-
- protected String[] parseStepParts(String stepValue) {
- String[] predicate = new String[0];
- int predicateStart = stepValue.lastIndexOf(OPEN_BRACKET);
- while (predicateStart >= 0) {
- int predicateEnd = stepValue.lastIndexOf(CLOSE_BRACKET);
- if (predicateEnd <= predicateStart || predicateEnd != stepValue.length() - 1) {
- throw new IllegalArgumentException();
- }
- predicate = ArrayTools.add(predicate, 0, stepValue.substring(predicateStart +1, predicateEnd));
- stepValue = stepValue.substring(0, predicateStart);
- predicateStart = stepValue.lastIndexOf(OPEN_BRACKET);
- }
-
- String nsPrefix = null;
- int colon = stepValue.indexOf(COLON);
- if (colon > 0) {
- if (stepValue.indexOf(COLON, colon + 1) != -1) {
- throw new IllegalArgumentException();
- }
- nsPrefix = stepValue.substring(0, colon);
- stepValue = stepValue.substring(colon +1);
- }
-
- if (StringTools.stringIsEmpty(stepValue)
- || stepValue.indexOf(COLON) >= 0
- || stepValue.indexOf(OPEN_BRACKET) >= 0
- || stepValue.indexOf(CLOSE_BRACKET) >= 0
- || stepValue.indexOf(' ') >= 0) {
- throw new IllegalArgumentException();
- }
-
- String[] result = ArrayTools.add(new String[0], nsPrefix);
- result = ArrayTools.add(result, stepValue);
- result = ArrayTools.addAll(result, predicate);
- return result;
- }
-
-
- // ***** content assist *****
-
- public Iterable<String> getCompletionProposals(
- Context context, XsdTypeDefinition xsdType, int pos, Filter<String> filter) {
-
- return getFirstStep().getCompletionProposals(context, xsdType, StringTools.EMPTY_STRING, pos, filter);
- }
-
-
- // ***** validation *****
-
- public void validate(Context context, XsdTypeDefinition xsdType, List<IMessage> messages) {
- getFirstStep().validate(context, xsdType, messages);
- }
-
- protected TextRange buildTextRange(Context context, Step step) {
- TextRange entireTextRange = context.getTextRange();
- int start = 0;
- for (Step each : this.steps) {
- int length = each.getValue().length() + 2; // include leading/trailing " or /
- if (each == step) {
- return new SimpleTextRange(entireTextRange.getOffset() + start, length, entireTextRange.getLineNumber());
- }
- else {
- start += length - 1; // only include leading " or /
- }
- }
- throw new IllegalArgumentException("Step must be in list of this XPath's steps.");
- }
-
-
- protected class AttributeStep
- extends NamedComponentStep {
-
- protected AttributeStep(String nsPrefix, String localName, String[] predicates) {
- super(nsPrefix, localName, predicates);
- }
-
-
- @Override
- protected String getValue() {
- return ATT_PREFIX + super.getValue();
- }
-
- @Override
- protected XsdTypeDefinition resolveNextType(Context context, XsdTypeDefinition previousType) {
- String namespace = resolveNamespace(context);
- if (namespace == null) {
- return null;
- }
-
- XsdAttributeUse xsdAttribute = previousType.getAttribute(namespace, this.localName);
- return (xsdAttribute == null) ? null : xsdAttribute.getAttributeDeclaration().getType();
- }
-
- @Override
- protected void validate(
- Context context, XsdTypeDefinition previousType, List<IMessage> messages) {
-
- if (getNextStep() != null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__ATTRIBUTE_SEGMENT_MUST_BE_LAST_SEGMENT,
- context.getContextObject(),
- getTextRange(context)));
- return;
- }
-
- super.validate(context, previousType, messages);
- }
-
- @Override
- protected XsdTypeDefinition validateLocalName(
- Context context, XsdTypeDefinition previousType, String namespace, List<IMessage> messages) {
-
- XsdAttributeUse xsdAttribute= previousType.getAttribute(namespace, this.localName);
- if (xsdAttribute == null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__UNRESOLVED_ATTRIBUTE,
- new String[] { namespace, this.localName },
- context.getContextObject(),
- getTextRange(context)));
- return null;
- }
- else {
- return xsdAttribute.getAttributeDeclaration().getType();
- }
- }
-
-// @Override
-// protected TextRange buildNamespacePrefixTextRange(CompilationUnit astRoot) {
-// // assume nsPrefix != null
-// TextRange stepTextRange = ELJavaXmlPath.this.buildTextRange(this, astRoot);
-// return new SimpleTextRange(stepTextRange.getOffset() + 1, this.nsPrefix.length(), stepTextRange.getLineNumber());
-// }
- }
-
- protected class ElementStep
- extends NamedComponentStep {
-
- protected ElementStep(String nsPrefix, String localName, String[] predicates) {
- super(nsPrefix, localName, predicates);
- }
-
-
- @Override
- protected XsdTypeDefinition
- resolveNextType(Context context, XsdTypeDefinition previousType) {
-
- String namespace = resolveNamespace(context);
- if (namespace == null) {
- return null;
- }
-
- XsdElementDeclaration xsdElement = previousType.getElement(namespace, this.localName);
- return (xsdElement == null) ? null : xsdElement.getType();
- }
-
-
- @Override
- protected XsdTypeDefinition validateLocalName(
- Context context, XsdTypeDefinition previousType, String namespace, List<IMessage> messages) {
-
- XsdElementDeclaration xsdElement = previousType.getElement(namespace, this.localName);
- if (xsdElement == null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__UNRESOLVED_ELEMENT,
- new String[] { namespace, this.localName },
- context.getContextObject(),
- getTextRange(context)));
- return null;
- }
- else {
- return xsdElement.getType();
- }
- }
-
-// @Override
-// protected TextRange buildNamespacePrefixTextRange(CompilationUnit astRoot) {
-// // assume nsPrefix != null
-// TextRange stepTextRange = ELJavaXmlPath.this.buildTextRange(this, astRoot);
-// return new SimpleTextRange(stepTextRange.getOffset(), this.nsPrefix.length(), stepTextRange.getLineNumber());
-// }
- }
-
- protected class InvalidStep
- extends Step {
-
- protected String value;
-
- protected InvalidStep(String value) {
- super();
- this.value = value;
- }
-
- @Override
- protected String getValue() {
- return this.value;
- }
-
- @Override
- protected XsdTypeDefinition
- resolveNextType(Context context, XsdTypeDefinition previousType) {
-
- return null;
- }
-
- @Override
- protected void validate(
- Context context, XsdTypeDefinition previousType, List<IMessage> messages) {
-
- messages. add(ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__INVALID_FORM_ILLEGAL_SEGMENT,
- new String[] { getValue() },
- context.getContextObject(),
- getTextRange(context)));
- return;
- }
- }
-
- protected abstract class NamedComponentStep
- extends Step {
-
- protected String nsPrefix;
-
- protected String localName;
-
- protected List<String> predicates;
-
-
- protected NamedComponentStep(String nsPrefix, String localName, String[] predicates) {
- super();
- this.nsPrefix = nsPrefix;
- this.localName = localName;
- this.predicates = new Vector<String>();
- CollectionTools.addAll(this.predicates, predicates);
- }
-
- @Override
- protected String getValue() {
- StringBuffer sb = new StringBuffer();
- if (this.nsPrefix != null) {
- sb.append(nsPrefix);
- sb.append(COLON);
- }
- sb.append(this.localName);
- for (String predicate : this.predicates) {
- sb.append(OPEN_BRACKET);
- sb.append(predicate);
- sb.append(CLOSE_BRACKET);
- }
- return sb.toString();
- }
-
- protected String resolveNamespace(Context context) {
- JaxbPackage pkg = context.getJaxbPackage();
- if (this.nsPrefix == null) {
- return "";
- }
- else {
- JaxbPackageInfo pkgInfo = pkg.getPackageInfo();
- return (pkgInfo == null) ? null : pkgInfo.getNamespaceForPrefix(this.nsPrefix);
- }
- }
-
- @Override
- protected void validate(
- Context context, XsdTypeDefinition previousType, List<IMessage> messages) {
-
- String namespace = resolveNamespace(context);
-
- if (namespace == null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__INVALID_NS_PREFIX,
- new String[] { this.nsPrefix },
- context.getContextObject(),
- getTextRange(context)));
- }
-
- XsdTypeDefinition nextType = (previousType == null) ? null : validateLocalName(context, previousType, namespace, messages);
- if (nextType != null) {
- Step nextStep = getNextStep();
- if (nextStep != null) {
- nextStep.validate(context, nextType, messages);
- }
- }
- }
-
- protected abstract XsdTypeDefinition validateLocalName(
- Context context, XsdTypeDefinition previousType, String namespace, List<IMessage> messages);
-
-// protected abstract TextRange buildNamespacePrefixTextRange(CompilationUnit astRoot);
- }
-
- protected class SelfStep
- extends Step {
-
- protected SelfStep() {
- super();
- }
-
-
- @Override
- protected String getValue() {
- return SELF;
- }
-
- @Override
- protected XsdTypeDefinition
- resolveNextType(Context context, XsdTypeDefinition previousType) {
-
- return previousType;
- }
-
- @Override
- protected void validate(
- Context context, XsdTypeDefinition previousType, List<IMessage> messages) {
-
- if (getIndex() != 0) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__SELF_SEGMENT_MUST_BE_FIRST_SEGMENT,
- context.getContextObject(),
- getTextRange(context)));
- return;
- }
-
- if (getNextStep() != null) {
- getNextStep().validate(context, previousType, messages);
- }
- }
- }
-
- protected abstract class Step {
-
- protected int getIndex() {
- return XPath.this.getIndex(this);
- }
-
- protected Step getNextStep() {
- return XPath.this.getNextStep(this);
- }
-
- protected abstract String getValue();
-
- protected abstract XsdTypeDefinition resolveNextType(Context context, XsdTypeDefinition previousType);
-
- protected Iterable<String> getCompletionProposals(
- Context context, XsdTypeDefinition previousType,
- final String prefix, int pos, Filter<String> filter) {
-
- if (getTextRange(context).includes(pos) || getNextStep() == null) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterable<String>(
- new TransformationIterable<String, String>(
- new CompositeIterable<String>(
- getTextProposals(context, previousType),
- getAttributeProposals(context, previousType),
- getElementProposals(context, previousType))) {
- @Override
- protected String transform(String o) {
- return StringTools.concatenate(prefix, o);
- }
- },
- filter));
- }
-
- Step nextStep = getNextStep();
- XsdTypeDefinition nextType = resolveNextType(context, previousType);
- if (nextStep != null && nextType != null) {
- return nextStep.getCompletionProposals(context, nextType, prefix + getValue() + DELIM, pos, filter);
- }
-
- return new SingleElementIterable(TEXT);
- }
-
- protected Iterable<String> getTextProposals(Context context, final XsdTypeDefinition xsdType) {
- return (xsdType.hasTextContent()) ? new SingleElementIterable(TEXT) : EmptyIterable.instance();
- }
-
- protected Iterable<String> getAttributeProposals(Context context, final XsdTypeDefinition xsdType) {
- return new CompositeIterable<String>(
- new CompositeIterable<String>(
- new TransformationIterable<XmlNs, Iterable<String>>(getXmlNsInfos(context)) {
- @Override
- protected Iterable<String> transform(final XmlNs xmlns) {
- return new TransformationIterable<String, String>(xsdType.getAttributeNames(xmlns.getNamespaceURI())) {
- @Override
- protected String transform(String o) {
- return XPath.attributeXPath(xmlns.getPrefix(), o);
- }
- };
- }
- }),
- new TransformationIterable<String, String>(xsdType.getAttributeNames("")) {
- @Override
- protected String transform(String o) {
- return XPath.attributeXPath(null, o);
- }
- });
- }
-
- protected Iterable<String> getElementProposals(Context context, final XsdTypeDefinition xsdType) {
- return new CompositeIterable<String>(
- new CompositeIterable<String>(
- new TransformationIterable<XmlNs, Iterable<String>>(getXmlNsInfos(context)) {
- @Override
- protected Iterable<String> transform(final XmlNs xmlns) {
- return new TransformationIterable<String, String>(xsdType.getElementNames(xmlns.getNamespaceURI(), false)) {
- @Override
- protected String transform(String o) {
- return XPath.elementXPath(xmlns.getPrefix(), o);
- }
- };
- }
- }),
- xsdType.getElementNames("", false));
- }
-
- protected Iterable<XmlNs> getXmlNsInfos(Context context) {
- JaxbPackageInfo pkgInfo = context.getJaxbPackage().getPackageInfo();
- XmlSchema xmlSchema = (pkgInfo == null) ? null : pkgInfo.getXmlSchema();
- return (xmlSchema == null) ? EmptyIterable.<XmlNs>instance() : xmlSchema.getXmlNsPrefixes();
- }
-
- protected void validate(Context context, XsdTypeDefinition previousType, List<IMessage> messages) {
- // no op
- }
-
- protected TextRange getTextRange(Context context) {
- return XPath.this.buildTextRange(context, this);
- }
- }
-
- protected class TextStep
- extends Step {
-
- protected TextStep() {
- super();
- }
-
- @Override
- protected String getValue() {
- return TEXT;
- }
-
- @Override
- protected XsdTypeDefinition
- resolveNextType(Context context, XsdTypeDefinition previousType) {
-
- return previousType;
- }
-
- @Override
- protected void validate(
- Context context, XsdTypeDefinition previousType, List<IMessage> messages) {
-
- if (getNextStep() != null) {
- messages.add(
- ELJaxbValidationMessageBuilder.buildMessage(
- IMessage.HIGH_SEVERITY,
- ELJaxbValidationMessages.XPATH__TEXT_SEGMENT_MUST_BE_LAST_SEGMENT,
- context.getContextObject(),
- getTextRange(context)));
- }
- }
- }
-
-
- public interface Context {
-
- JaxbNode getContextObject();
-
- JaxbPackage getJaxbPackage();
-
- TextRange getTextRange();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPathFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPathFactory.java
deleted file mode 100644
index 99297fd3f3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/xpath/java/XPathFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.context.xpath.java;
-
-import java.util.Map;
-import java.util.WeakHashMap;
-
-
-public class XPathFactory {
-
- private static XPathFactory INSTANCE;
-
- private Map<String, XPath> xpaths;
-
-
- private XPathFactory() {
- this.xpaths = new WeakHashMap<String, XPath>();
- }
-
-
- public static XPathFactory instance() {
- if (INSTANCE == null) {
- INSTANCE = new XPathFactory();
- }
- return INSTANCE;
- }
-
-
- public XPath getXpath(String xpathString) {
- XPath xpath = this.xpaths.get(xpathString);
- if (xpath == null) {
- xpath = buildXpath(xpathString);
- this.xpaths.put(xpathString, xpath);
- }
- return xpath;
- }
-
- private XPath buildXpath(String xpathString) {
- return new XPath(xpathString);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
deleted file mode 100644
index 9e6c36dc82..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/libval/ELJaxbUserLibraryValidator.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jpt.common.core.internal.libval.LibValUtil;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.eclipselink.core.internal.JptCommonEclipseLinkCoreMessages;
-import org.eclipse.jpt.common.eclipselink.core.internal.libval.EclipseLinkLibValUtil;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.libprov.JaxbUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.osgi.service.resolver.VersionRange;
-
-
-/**
- * Library validator for EclipseLink JAXB user libraries.
- *
- * In order to validate that the correct eclipselink.jar is present in the user library, the version
- * class which appears in standard EclipseLink libraries will be examined and compared against the
- * union of calculated version ranges, depending on the platform specified in the config.
- */
-public class ELJaxbUserLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JaxbUserLibraryProviderInstallOperationConfig jaxbConfig
- = (JaxbUserLibraryProviderInstallOperationConfig) config;
- JaxbPlatformDescription platform = jaxbConfig.getJaxbPlatform();
- Set<VersionRange> versionRanges = new HashSet<VersionRange>();
-
- if (ELJaxbPlatform.VERSION_2_1.equals(platform)) {
- versionRanges.add(new VersionRange("[2.1, 3.0)")); //$NON-NLS-1$
- }
- else if (ELJaxbPlatform.VERSION_2_2.equals(platform)) {
- versionRanges.add(new VersionRange("[2.2, 3.0)")); //$NON-NLS-1$
- }
- else if (ELJaxbPlatform.VERSION_2_3.equals(platform)) {
- versionRanges.add(new VersionRange("[2.3, 3.0)")); //$NON-NLS-1$
- }
- else if (ELJaxbPlatform.VERSION_2_4.equals(platform)) {
- versionRanges.add(new VersionRange("[2.4, 3.0)")); //$NON-NLS-1$
- }
-
- IStatus status = EclipseLinkLibValUtil.validate(jaxbConfig.resolve(), versionRanges);
-
- if (! status.isOK()) {
- return status;
- }
-
- // finally look for xjc classes
-
- Set<String> classNames = new HashSet<String>();
-
- classNames.add("com.sun.tools.xjc.XJCFacade"); //$NON-NLS-1$
- classNames.add("com.sun.xml.bind.Util"); //$NON-NLS-1$
-
- Iterable<IPath> libraryPaths =
- new TransformationIterable<IClasspathEntry, IPath>(jaxbConfig.resolve()) {
- @Override
- protected IPath transform(IClasspathEntry o) {
- return o.getPath();
- }
- };
-
- status = LibValUtil.validate(libraryPaths, classNames);
-
- if (! status.isOK()) {
- return new Status(IStatus.WARNING, JptJaxbCorePlugin.PLUGIN_ID, JptCommonEclipseLinkCoreMessages.ELJaxbUserLibraryValidator_noXjcClasses);
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlCDATAAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlCDATAAnnotationDefinition.java
deleted file mode 100644
index 47c827c9dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlCDATAAnnotationDefinition.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlCDATAAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlCDATAAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlCDATAAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlCDATAAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlCDATAAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_CDATA;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlCDATAAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlCDATAAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorNodeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorNodeAnnotationDefinition.java
deleted file mode 100644
index ca1d0662cf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorNodeAnnotationDefinition.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlDiscriminatorNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlDiscriminatorNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlDiscriminatorNodeAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlDiscriminatorNodeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlDiscriminatorNodeAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_DISCRIMINATOR_NODE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlDiscriminatorNodeAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlDiscriminatorNodeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorValueAnnotationDefinition.java
deleted file mode 100644
index 982b223431..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlDiscriminatorValueAnnotationDefinition.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlDiscriminatorValueAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlDiscriminatorValueAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlDiscriminatorValueAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlDiscriminatorValueAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlDiscriminatorValueAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_DISCRIMINATOR_VALUE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlDiscriminatorValueAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlDiscriminatorValueAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.java
deleted file mode 100644
index 305d19ea16..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlInverseReferenceAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlInverseReferenceAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlInverseReferenceAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlInverseReferenceAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlInverseReferenceAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlInverseReferenceAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInverseReferenceAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInverseReferenceAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodeAnnotationDefinition.java
deleted file mode 100644
index 9764db94a8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodeAnnotationDefinition.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlJoinNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlJoinNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlJoinNodeAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlJoinNodeAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- private XmlJoinNodeAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return ELJaxb.XML_JOIN_NODE;
- }
-
- public String getContainerAnnotationName() {
- return ELJaxb.XML_JOIN_NODES;
- }
-
- public String getElementName() {
- return ELJaxb.XML_JOIN_NODES__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlJoinNodeAnnotation.buildSourceXmlJoinNodeAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryXmlJoinNodeAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodesAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodesAnnotationDefinition.java
deleted file mode 100644
index 116334329a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlJoinNodesAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlJoinNodesAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlJoinNodesAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlJoinNodesAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_JOIN_NODES;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlKeyAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlKeyAnnotationDefinition.java
deleted file mode 100644
index 1f6fb712bf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlKeyAnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlKeyAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlKeyAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlKeyAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlKeyAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlKeyAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_KEY;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlKeyAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlKeyAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathAnnotationDefinition.java
deleted file mode 100644
index 4c6593c38d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlPathAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlPathAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlPathAnnotationDefinition
- implements NestableAnnotationDefinition {
-
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new XmlPathAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- private XmlPathAnnotationDefinition() {
- super();
- }
-
-
- public String getNestableAnnotationName() {
- return ELJaxb.XML_PATH;
- }
-
- public String getContainerAnnotationName() {
- return ELJaxb.XML_PATHS;
- }
-
- public String getElementName() {
- return ELJaxb.XML_PATH__VALUE;
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceXmlPathAnnotation.buildSourceXmlPathAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryXmlPathAnnotation(parent, jdtAnnotation);
- }
-}
-
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathsAnnotationDefinition.java
deleted file mode 100644
index 61ed74de7d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlPathsAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlPathsAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlPathsAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlPathsAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_PATHS;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.java
deleted file mode 100644
index a8e219f317..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/XmlTransformationAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary.BinaryXmlTransformationAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source.SourceXmlTransformationAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-
-
-public class XmlTransformationAnnotationDefinition
- implements AnnotationDefinition {
-
- // singleton
- private static final AnnotationDefinition INSTANCE = new XmlTransformationAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private XmlTransformationAnnotationDefinition() {
- super();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransformationAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransformationAnnotation(parent, jdtAnnotation);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlCDATAAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlCDATAAnnotation.java
deleted file mode 100644
index 25655c5254..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlCDATAAnnotation.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlCDATAAnnotation;
-
-
-public class BinaryXmlCDATAAnnotation
- extends BinaryAnnotation
- implements XmlCDATAAnnotation {
-
- public BinaryXmlCDATAAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_CDATA;
- }
-
- @Override
- public void update() {
- super.update();
- }
-
- @Override
- public void toString(StringBuilder sb) {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java
deleted file mode 100644
index bfe576faf4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorNodeAnnotation.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-
-
-public class BinaryXmlDiscriminatorNodeAnnotation
- extends BinaryAnnotation
- implements XmlDiscriminatorNodeAnnotation {
-
- private String value;
-
-
- public BinaryXmlDiscriminatorNodeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = buildValue();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_DISCRIMINATOR_NODE;
- }
-
- @Override
- public void update() {
- super.update();
- setValue_(buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ***** 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(ELJaxb.XML_DISCRIMINATOR_NODE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java
deleted file mode 100644
index 9644af29a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-
-
-public class BinaryXmlDiscriminatorValueAnnotation
- extends BinaryAnnotation
- implements XmlDiscriminatorValueAnnotation {
-
- private String value;
-
-
- public BinaryXmlDiscriminatorValueAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = buildValue();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_DISCRIMINATOR_VALUE;
- }
-
- @Override
- public void update() {
- super.update();
- setValue_(buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ***** 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(ELJaxb.XML_DISCRIMINATOR_VALUE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java
deleted file mode 100644
index e2a600b5c9..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class BinaryXmlInverseReferenceAnnotation
- extends BinaryAnnotation
- implements XmlInverseReferenceAnnotation {
-
- private String mappedBy;
-
-
- public BinaryXmlInverseReferenceAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mappedBy = buildMappedBy();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- @Override
- public void update() {
- super.update();
- setMappedBy_(buildMappedBy());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.mappedBy);
- }
-
-
- // ***** mappedBy *****
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- throw new UnsupportedOperationException();
- }
-
- private void setMappedBy_(String mappedBy) {
- String old = this.mappedBy;
- this.mappedBy = mappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, mappedBy);
- }
-
- private String buildMappedBy() {
- return (String) this.getJdtMemberValue(ELJaxb.XML_INVERSE_REFERENCE__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java
deleted file mode 100644
index ab5497be35..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlJoinNodeAnnotation.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-
-
-public class BinaryXmlJoinNodeAnnotation
- extends BinaryAnnotation
- implements XmlJoinNodeAnnotation {
-
- private String xmlPath;
-
- private String referencedXmlPath;
-
-
- public BinaryXmlJoinNodeAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.xmlPath = buildXmlPath();
- this.referencedXmlPath = buildReferencedXmlPath();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_JOIN_NODE;
- }
-
- @Override
- public void update() {
- super.update();
- setXmlPath_(buildXmlPath());
- setReferencedXmlPath_(buildReferencedXmlPath());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.xmlPath + " -> " + this.referencedXmlPath);
- }
-
-
- // ***** xmlPath *****
-
- public String getXmlPath() {
- return this.xmlPath;
- }
-
- public void setXmlPath(String xmlPath) {
- throw new UnsupportedOperationException();
- }
-
- private void setXmlPath_(String xmlPath) {
- String old = this.xmlPath;
- this.xmlPath = xmlPath;
- this.firePropertyChanged(XML_PATH_PROPERTY, old, xmlPath);
- }
-
- private String buildXmlPath() {
- return (String) this.getJdtMemberValue(ELJaxb.XML_JOIN_NODE__XML_PATH);
- }
-
- public TextRange getXmlPathTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean xmlPathTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** xmlPath *****
-
- public String getReferencedXmlPath() {
- return this.referencedXmlPath;
- }
-
- public void setReferencedXmlPath(String referencedXmlPath) {
- throw new UnsupportedOperationException();
- }
-
- private void setReferencedXmlPath_(String referencedXmlPath) {
- String old = this.referencedXmlPath;
- this.referencedXmlPath = referencedXmlPath;
- this.firePropertyChanged(REFERENCED_XML_PATH_PROPERTY, old, referencedXmlPath);
- }
-
- private String buildReferencedXmlPath() {
- return (String) this.getJdtMemberValue(ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH);
- }
-
- public TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean referencedXmlPathTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlKeyAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlKeyAnnotation.java
deleted file mode 100644
index 8fb9897092..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlKeyAnnotation.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlKeyAnnotation;
-
-
-public class BinaryXmlKeyAnnotation
- extends BinaryAnnotation
- implements XmlKeyAnnotation {
-
- public BinaryXmlKeyAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_KEY;
- }
-
- @Override
- public void update() {
- super.update();
- }
-
- @Override
- public void toString(StringBuilder sb) {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.java
deleted file mode 100644
index 41e5f858dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlPathAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-
-
-public class BinaryXmlPathAnnotation
- extends BinaryAnnotation
- implements XmlPathAnnotation {
-
- private String value;
-
-
- public BinaryXmlPathAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = buildValue();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_PATH;
- }
-
- @Override
- public void update() {
- super.update();
- setValue_(buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ***** 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(ELJaxb.XML_PATH__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java
deleted file mode 100644
index 7b9d0e60f4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class BinaryXmlTransformationAnnotation
- extends BinaryAnnotation
- implements XmlTransformationAnnotation {
-
- private Boolean optional;
-
-
- public BinaryXmlTransformationAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = buildOptional();
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- @Override
- public void update() {
- super.update();
- setOptional_(buildOptional());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.optional);
- }
-
-
- // ***** optional
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(ELJaxb.XML_TRANSFORMATION__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlCDATAAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlCDATAAnnotation.java
deleted file mode 100644
index 208e1edbf3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlCDATAAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlCDATAAnnotation;
-
-
-public class SourceXmlCDATAAnnotation
- extends SourceAnnotation
- implements XmlCDATAAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_CDATA);
-
-
- public SourceXmlCDATAAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlCDATAAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_CDATA;
- }
-
- public void initialize(CompilationUnit astRoot) {}
-
- public void synchronizeWith(CompilationUnit astRoot) {}
-
- @Override
- public void toString(StringBuilder sb) {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java
deleted file mode 100644
index f87e39238f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorNodeAnnotation.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-
-
-public class SourceXmlDiscriminatorNodeAnnotation
- extends SourceAnnotation
- implements XmlDiscriminatorNodeAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER =
- new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_DISCRIMINATOR_NODE);
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public SourceXmlDiscriminatorNodeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlDiscriminatorNodeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.valueDeclarationAdapter = buildValueAdapter(daa);
- this.valueAdapter = buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, ELJaxb.XML_DISCRIMINATOR_NODE__VALUE, StringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_DISCRIMINATOR_NODE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncValue(buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ***** 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);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.valueDeclarationAdapter, pos, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java
deleted file mode 100644
index 4b75d3c536..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-
-
-public class SourceXmlDiscriminatorValueAnnotation
- extends SourceAnnotation
- implements XmlDiscriminatorValueAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER =
- new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_DISCRIMINATOR_VALUE);
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public SourceXmlDiscriminatorValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlDiscriminatorValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.valueDeclarationAdapter = buildValueAdapter(daa);
- this.valueAdapter = buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, ELJaxb.XML_DISCRIMINATOR_VALUE__VALUE, StringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_DISCRIMINATOR_VALUE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncValue(buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ***** 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);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.valueDeclarationAdapter, pos, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java
deleted file mode 100644
index 305eb4e2cd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class SourceXmlInverseReferenceAnnotation
- extends SourceAnnotation
- implements XmlInverseReferenceAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_INVERSE_REFERENCE);
-
- private final DeclarationAnnotationElementAdapter<String> mappedByDeclarationAdapter;
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
-
- public SourceXmlInverseReferenceAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlInverseReferenceAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.mappedByDeclarationAdapter = buildMappedByDeclarationAdapter(daa);
- this.mappedByAdapter = buildMappedByAdapter(this.mappedByDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildMappedByDeclarationAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(daa, ELJaxb.XML_INVERSE_REFERENCE__MAPPED_BY, StringExpressionConverter.instance());
- }
-
- private AnnotationElementAdapter<String> buildMappedByAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_INVERSE_REFERENCE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.mappedBy = buildMappedBy(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncMappedBy(buildMappedBy(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.mappedBy);
- }
-
-
- // ***** mappedBy *****
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (attributeValueHasChanged(this.mappedBy, mappedBy)) {
- this.mappedBy = mappedBy;
- this.mappedByAdapter.setValue(mappedBy);
- }
- }
-
- private void syncMappedBy(String astMappedBy) {
- String old = this.mappedBy;
- this.mappedBy = astMappedBy;
- this.firePropertyChanged(MAPPED_BY_PROPERTY, old, this.mappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.mappedByDeclarationAdapter, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.mappedByDeclarationAdapter, pos, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java
deleted file mode 100644
index 241268af2f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlJoinNodeAnnotation.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.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.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-
-
-public class SourceXmlJoinNodeAnnotation
- extends SourceAnnotation
- implements XmlJoinNodeAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER =
- new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_JOIN_NODE);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER =
- new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_JOIN_NODES);
-
- private final DeclarationAnnotationElementAdapter<String> xmlPathDeclarationAdapter;
- private final AnnotationElementAdapter<String> xmlPathAdapter;
- private String xmlPath;
-
- private final DeclarationAnnotationElementAdapter<String> referencedXmlPathDeclarationAdapter;
- private final AnnotationElementAdapter<String> referencedXmlPathAdapter;
- private String referencedXmlPath;
-
-
- public static SourceXmlJoinNodeAnnotation buildSourceXmlJoinNodeAnnotation(
- JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
-
- IndexedDeclarationAnnotationAdapter idaa = buildXmlJoinNodeDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlJoinNodeAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlJoinNodeAnnotation(parent, annotatedElement, idaa, iaa);
- }
-
-
- private SourceXmlJoinNodeAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.xmlPathDeclarationAdapter = buildXmlPathAdapter(daa);
- this.xmlPathAdapter = buildAnnotationElementAdapter(this.xmlPathDeclarationAdapter);
- this.referencedXmlPathDeclarationAdapter = buildReferencedXmlPathAdapter(daa);
- this.referencedXmlPathAdapter = buildAnnotationElementAdapter(this.referencedXmlPathDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildXmlPathAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, ELJaxb.XML_JOIN_NODE__XML_PATH, StringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildReferencedXmlPathAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH, StringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_JOIN_NODE;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.xmlPath = buildXmlPath(astRoot);
- this.referencedXmlPath = buildReferencedXmlPath(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncXmlPath(buildXmlPath(astRoot));
- syncReferencedXmlPath(buildReferencedXmlPath(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.xmlPath + " -> " + this.referencedXmlPath);
- }
-
-
- // ***** xmlPath *****
-
- public String getXmlPath() {
- return this.xmlPath;
- }
-
- public void setXmlPath(String xmlPath) {
- if (this.attributeValueHasChanged(this.xmlPath, xmlPath)) {
- this.xmlPath = xmlPath;
- this.xmlPathAdapter.setValue(xmlPath);
- }
- }
-
- private void syncXmlPath(String astXmlPath) {
- String old = this.xmlPath;
- this.xmlPath = astXmlPath;
- this.firePropertyChanged(XML_PATH_PROPERTY, old, astXmlPath);
- }
-
- private String buildXmlPath(CompilationUnit astRoot) {
- return this.xmlPathAdapter.getValue(astRoot);
- }
-
- public TextRange getXmlPathTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.xmlPathDeclarationAdapter, astRoot);
- }
-
- public boolean xmlPathTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.xmlPathDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** referencedXmlPath *****
-
- public String getReferencedXmlPath() {
- return this.referencedXmlPath;
- }
-
- public void setReferencedXmlPath(String referencedXmlPath) {
- if (this.attributeValueHasChanged(this.referencedXmlPath, referencedXmlPath)) {
- this.referencedXmlPath = referencedXmlPath;
- this.referencedXmlPathAdapter.setValue(referencedXmlPath);
- }
- }
-
- private void syncReferencedXmlPath(String astReferencedXmlPath) {
- String old = this.referencedXmlPath;
- this.referencedXmlPath = astReferencedXmlPath;
- this.firePropertyChanged(REFERENCED_XML_PATH_PROPERTY, old, astReferencedXmlPath);
- }
-
- private String buildReferencedXmlPath(CompilationUnit astRoot) {
- return this.referencedXmlPathAdapter.getValue(astRoot);
- }
-
- public TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedXmlPathDeclarationAdapter, astRoot);
- }
-
- public boolean referencedXmlPathTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.referencedXmlPathDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** NestableAnnotation impl *****
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlJoinNodeAnnotationAdapter(
- AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
-
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlJoinNodeDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- ELJaxb.XML_JOIN_NODE);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlKeyAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlKeyAnnotation.java
deleted file mode 100644
index 79ae0ad991..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlKeyAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlKeyAnnotation;
-
-
-public class SourceXmlKeyAnnotation
- extends SourceAnnotation
- implements XmlKeyAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_KEY);
-
-
- public SourceXmlKeyAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlKeyAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- }
-
-
- public String getAnnotationName() {
- return ELJaxb.XML_KEY;
- }
-
- public void initialize(CompilationUnit astRoot) {}
-
- public void synchronizeWith(CompilationUnit astRoot) {}
-
- @Override
- public void toString(StringBuilder sb) {}
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java
deleted file mode 100644
index e3690bdbe4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlPathAnnotation.java
+++ /dev/null
@@ -1,167 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.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.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-
-
-public class SourceXmlPathAnnotation
- extends SourceAnnotation
- implements XmlPathAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER =
- new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_PATH);
- public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER =
- new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_PATHS);
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public static SourceXmlPathAnnotation buildSourceXmlPathAnnotation(
- JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
-
- IndexedDeclarationAnnotationAdapter idaa = buildXmlPathDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildXmlPathAnnotationAdapter(annotatedElement, idaa);
- return new SourceXmlPathAnnotation(parent, annotatedElement, idaa, iaa);
- }
-
-
- private SourceXmlPathAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
-
- super(parent, annotatedElement, daa, annotationAdapter);
- this.valueDeclarationAdapter = buildValueAdapter(daa);
- this.valueAdapter = this.buildAnnotationElementAdapter(this.valueDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter daa) {
- return buildAnnotationElementAdapter(daa, ELJaxb.XML_PATH__VALUE, StringExpressionConverter.instance());
- }
-
- private DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
-
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, converter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(
- DeclarationAnnotationElementAdapter<String> daea) {
-
- return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_PATH;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- syncValue(buildValue(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ***** 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);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return elementTouches(this.valueDeclarationAdapter, pos, astRoot);
- }
-
-
- // ***** NestableAnnotation impl *****
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- @Override
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildXmlPathAnnotationAdapter(
- AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
-
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildXmlPathDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- ELJaxb.XML_PATH);
- return idaa;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java
deleted file mode 100644
index 3cdb791d02..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class SourceXmlTransformationAnnotation
- extends SourceAnnotation
- implements XmlTransformationAnnotation {
-
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_TRANSFORMATION);
-
- private final DeclarationAnnotationElementAdapter<Boolean> optionalDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
-
- public SourceXmlTransformationAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- this(parent, element, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(element, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceXmlTransformationAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.optionalDeclarationAdapter = buildOptionalDeclarationAdapter(daa);
- this.optionalAdapter = buildShortCircuitBooleanElementAdapter(this.optionalDeclarationAdapter);
- }
-
-
- private DeclarationAnnotationElementAdapter<Boolean> buildOptionalDeclarationAdapter(DeclarationAnnotationAdapter daa) {
- return ConversionDeclarationAnnotationElementAdapter.forBooleans(daa, ELJaxb.XML_TRANSFORMATION__OPTIONAL);
- }
-
- private AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea);
- }
-
- public String getAnnotationName() {
- return ELJaxb.XML_TRANSFORMATION;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = buildOptional(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncOptional(buildOptional(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.optional);
- }
-
-
- // ********** optional
-
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, this.optional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.optionalDeclarationAdapter, astRoot);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java
deleted file mode 100644
index cedaa85079..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_Factory.java
+++ /dev/null
@@ -1,121 +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.eclipselink.core.internal.v2_1;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.internal.AbstractJaxbFactory;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.ELJaxbContextRoot;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaElementFactoryMethod;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementRefMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementsMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlValueMapping;
-
-
-public class ELJaxb_2_1_Factory
- extends AbstractJaxbFactory {
-
- // singleton
- private static final JaxbFactory INSTANCE = new ELJaxb_2_1_Factory();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbFactory instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private ELJaxb_2_1_Factory() {
- super();
- }
-
-
- @Override
- public JaxbContextRoot buildContextRoot(JaxbProject parent) {
- return new ELJaxbContextRoot(parent);
- }
-
- @Override
- public JaxbElementFactoryMethod buildJavaElementFactoryMethod(
- XmlRegistry parent, JavaResourceMethod resourceMethod) {
- return new ELJavaElementFactoryMethod(parent, resourceMethod);
- }
-
- @Override
- public JaxbClassMapping buildJaxbClassMapping(JaxbClass parent) {
- return new ELJavaClassMapping(parent);
- }
-
- @Override
- public XmlAnyAttributeMapping buildJavaXmlAnyAttributeMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlAnyAttributeMapping(parent);
- }
-
- @Override
- public XmlAnyElementMapping buildJavaXmlAnyElementMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlAnyElementMapping(parent);
- }
-
- @Override
- public XmlAttributeMapping buildJavaXmlAttributeMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlAttributeMapping(parent);
- }
-
- @Override
- public XmlElementMapping buildJavaXmlElementMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlElementMapping(parent);
- }
-
- @Override
- public XmlElementRefMapping buildJavaXmlElementRefMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlElementRefMapping(parent);
- }
-
- @Override
- public XmlElementRefsMapping buildJavaXmlElementRefsMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlElementRefsMapping(parent);
- }
-
- @Override
- public XmlElementsMapping buildJavaXmlElementsMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlElementsMapping(parent);
- }
-
- @Override
- public XmlValueMapping buildJavaXmlValueMapping(JaxbPersistentAttribute parent) {
- return new ELJavaXmlValueMapping(parent);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java
deleted file mode 100644
index 3395082849..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinition.java
+++ /dev/null
@@ -1,119 +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.eclipselink.core.internal.v2_1;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbFactory;
-import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.AbstractELJaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAnyAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAnyElementMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementsMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlInverseReferenceMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlValueMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlInverseReferenceAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlPathAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlPathsAnnotationDefinition;
-
-
-public class ELJaxb_2_1_PlatformDefinition
- extends AbstractELJaxbPlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_1_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_1_PlatformDefinition() {
- super();
- }
-
-
- @Override
- protected JaxbPlatformDefinition getGenericJaxbPlatformDefinition() {
- return GenericJaxb_2_1_PlatformDefinition.instance();
- }
-
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_1;
- }
-
- public JaxbFactory getFactory() {
- return ELJaxb_2_1_Factory.instance();
- }
-
- @Override
- protected JaxbResourceModelProvider[] buildResourceModelProviders() {
- return ArrayTools.array(
- getGenericJaxbPlatformDefinition().getResourceModelProviders(),
- new JaxbResourceModelProvider[0]);
-
- }
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- return getGenericJaxbPlatformDefinition().getMostRecentSupportedResourceType(contentType);
- }
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return ArrayTools.addAll(
- getGenericJaxbPlatformDefinition().getAnnotationDefinitions(),
- XmlInverseReferenceAnnotationDefinition.instance(),
- XmlPathsAnnotationDefinition.instance());
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return ArrayTools.addAll(
- getGenericJaxbPlatformDefinition().getNestableAnnotationDefinitions(),
- XmlPathAnnotationDefinition.instance());
- }
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(
- ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- definitions.add(ELJavaXmlAttributeMappingDefinition.instance());
- definitions.add(ELJavaXmlElementMappingDefinition.instance());
- CollectionTools.addAll(definitions, getGenericJaxbPlatformDefinition().getDefaultJavaAttributeMappingDefinitions());
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(
- ArrayList<JavaAttributeMappingDefinition> definitions) {
- definitions.add(ELJavaXmlAnyAttributeMappingDefinition.instance());
- definitions.add(ELJavaXmlAnyElementMappingDefinition.instance());
- definitions.add(ELJavaXmlAttributeMappingDefinition.instance());
- definitions.add(ELJavaXmlElementMappingDefinition.instance());
- definitions.add(ELJavaXmlElementsMappingDefinition.instance());
- definitions.add(ELJavaXmlInverseReferenceMappingDefinition.instance());
- definitions.add(ELJavaXmlValueMappingDefinition.instance());
- CollectionTools.addAll(definitions, getGenericJaxbPlatformDefinition().getSpecifiedJavaAttributeMappingDefinitions());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java
deleted file mode 100644
index 61bc504659..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_1/ELJaxb_2_1_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +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.eclipselink.core.internal.v2_1;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_1_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_1_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java
deleted file mode 100644
index 3ee21425f5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinition.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jaxb.core.internal.jaxb22.GenericJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlJoinNodesMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlTransformationMappingDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlCDATAAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlDiscriminatorNodeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlDiscriminatorValueAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlJoinNodeAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlJoinNodesAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlKeyAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.resource.java.XmlTransformationAnnotationDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_PlatformDefinition;
-
-
-public class ELJaxb_2_2_PlatformDefinition
- extends ELJaxb_2_1_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_2_PlatformDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_2_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- @Override
- protected JaxbPlatformDefinition getGenericJaxbPlatformDefinition() {
- return GenericJaxb_2_2_PlatformDefinition.instance();
- }
-
- @Override
- protected AnnotationDefinition[] buildAnnotationDefinitions() {
- return ArrayTools.addAll(
- super.buildAnnotationDefinitions(),
- XmlCDATAAnnotationDefinition.instance(),
- XmlDiscriminatorNodeAnnotationDefinition.instance(),
- XmlDiscriminatorValueAnnotationDefinition.instance(),
- XmlJoinNodesAnnotationDefinition.instance(),
- XmlKeyAnnotationDefinition.instance(),
- XmlTransformationAnnotationDefinition.instance());
- }
-
- @Override
- protected NestableAnnotationDefinition[] buildNestableAnnotationDefinitions() {
- return ArrayTools.addAll(
- super.buildNestableAnnotationDefinitions(),
- XmlJoinNodeAnnotationDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(
- ArrayList<JavaAttributeMappingDefinition> definitions) {
- super.addSpecifiedJavaAttributeMappingDefinitionsTo(definitions);
- definitions.add(ELJavaXmlJoinNodesMappingDefinition.instance());
- definitions.add(ELJavaXmlTransformationMappingDefinition.instance());
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java
deleted file mode 100644
index d1844d766b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_2/ELJaxb_2_2_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +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.eclipselink.core.internal.v2_2;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_2_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_2_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java
deleted file mode 100644
index 38ff00513e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-
-
-public class ELJaxb_2_3_PlatformDefinition
- extends ELJaxb_2_2_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_3_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_3_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_3;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java
deleted file mode 100644
index 9dfc64c4e1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_3/ELJaxb_2_3_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +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.eclipselink.core.internal.v2_3;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_3_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_3_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinition.java
deleted file mode 100644
index 20648b20d1..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_4;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_3.ELJaxb_2_3_PlatformDefinition;
-
-
-public class ELJaxb_2_4_PlatformDefinition
- extends ELJaxb_2_3_PlatformDefinition {
-
- // singleton
- private static final JaxbPlatformDefinition INSTANCE = new ELJaxb_2_4_PlatformDefinition();
-
- /**
- * Return the singleton.
- */
- public static JaxbPlatformDefinition instance() {
- return INSTANCE;
- }
-
-
- protected ELJaxb_2_4_PlatformDefinition() {
- super();
- }
-
-
- @Override
- public JaxbPlatformDescription getDescription() {
- return ELJaxbPlatform.VERSION_2_4;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinitionFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinitionFactory.java
deleted file mode 100644
index 0dfb2a8492..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/v2_4/ELJaxb_2_4_PlatformDefinitionFactory.java
+++ /dev/null
@@ -1,22 +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.eclipselink.core.internal.v2_4;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinitionFactory;
-
-
-public class ELJaxb_2_4_PlatformDefinitionFactory
- implements JaxbPlatformDefinitionFactory {
-
- public JaxbPlatformDefinition buildJaxbPlatformDefinition() {
- return ELJaxb_2_4_PlatformDefinition.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
deleted file mode 100644
index 60a8593632..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessageBuilder.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.internal.validation;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbNode;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages;
-
-public class ELJaxbValidationMessageBuilder {
-
- private static String[] DEFAULT_PARMS = new String[0];
- private static TextRange DEFAULT_TEXT_RANGE = TextRange.Empty.instance();
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JaxbNode targetObject) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JaxbNode targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JaxbNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JaxbNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange) {
- return DefaultValidationMessages.buildMessage(defaultSeverity, messageId, parms, targetObject, textRange, MESSAGE_FACTORY);
- }
-
-
- private ELJaxbValidationMessageBuilder() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- private static final DefaultValidationMessages.MessageFactory MESSAGE_FACTORY = new EclipseLinkMessageFactory();
-
- /* CU private */ static class EclipseLinkMessageFactory
- implements DefaultValidationMessages.MessageFactory
- {
- public IMessage buildMessage(int severity, String messageId, String[] parms, IResource targetObject) {
- // TODO check for preference override
-// int prefSeverity = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
-// if (prefSeverity != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
-// severity = prefSeverity;
-// }
- IMessage message = new EclipseLinkMessage(ELJaxbValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- // TODO "EclipseLink JAXB" validation marker?
- message.setMarkerId(JptJaxbCorePlugin.VALIDATION_MARKER_ID);
- return message;
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- /**
- * We have to build this message so {@link Message} uses the right class
- * loader to retrieve the message bundles.
- * <p>
- * Another way we could potentially solve this is to have a separate
- * EclispeLink JPA validator and set up the extension points so that
- * it only runs against JPA projects with the EclispeLink platform....
- */
- /* CU private */ static class EclipseLinkMessage
- extends Message
- {
- EclipseLinkMessage(String bundleName, int severity, String id, String[] params, Object target) {
- super(bundleName, severity, id, params, target);
- }
-
- @Override
- public ResourceBundle getBundle(Locale locale, ClassLoader classLoader) {
- try {
- return super.getBundle(locale, this.getClass().getClassLoader());
- } catch (MissingResourceException ex) {
- return super.getBundle(locale, classLoader);
- }
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java
deleted file mode 100644
index cbf6e5780e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/validation/ELJaxbValidationMessages.java
+++ /dev/null
@@ -1,55 +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.eclipselink.core.internal.validation;
-
-@SuppressWarnings("nls")
-public interface ELJaxbValidationMessages {
-
- // bundle name
- String BUNDLE_NAME = "el_jaxb_validation";
-
-
- // validation on project
- String PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY = "PROJECT_MISSING_ECLIPSELINK_JAXB_CONTEXT_FACTORY";
-
- String XML_DISCRIMINATOR_NODE__NOT_SPECIFIED = "XML_DISCRIMINATOR_NODE__NOT_SPECIFIED";
-
- String XML_DISCRIMINATOR_VALUE__NOT_SPECIFIED = "XML_DISCRIMINATOR_VALUE__NOT_SPECIFIED";
-
- String XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE = "XML_ELEMENT_DECL__INVALID_METHOD_SIGNATURE_RETURN_TYPE";
-
- String XML_JOIN_NODE__XML_PATH_NOT_SPECIFIED = "XML_JOIN_NODE__XML_PATH_NOT_SPECIFIED";
- String XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_SPECIFIED = "XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_SPECIFIED";
- String XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_IN_REFERENCED_CLASS_KEYS = "XML_JOIN_NODE__REFERENCED_XML_PATH_NOT_IN_REFERENCED_CLASS_KEYS";
-
- String XML_JOIN_NODES__INVALID_REFERENCED_CLASS = "XML_JOIN_NODES__INVALID_REFERENCED_CLASS";
- String XML_JOIN_NODES__DUPLICATE_XML_PATH = "XML_JOIN_NODES__DUPLICATE_XML_PATH";
- String XML_JOIN_NODES__DUPLICATE_REFERENCED_XML_PATH = "XML_JOIN_NODES__DUPLICATE_REFERENCED_XML_PATH";
-
- String XML_PATH__NOT_SPECIFIED = "XML_PATH__NOT_SPECIFIED";
-
- // used on XmlElements mapping
- String XML_PATH__INSUFFICIENT_XML_PATHS_FOR_XML_ELEMENTS = "XML_PATH__INSUFFICIENT_XML_PATHS_FOR_XML_ELEMENTS";
- String XML_PATH__INSUFFICIENT_XML_ELEMENTS_FOR_XML_PATHS = "XML_PATH__INSUFFICIENT_XML_ELEMENTS_FOR_XML_PATHS";
-
- String XML_INVERSE_REFERENCE__MAPPED_BY_NOT_SPECIFIED = "XML_INVERSE_REFERENCE__MAPPED_BY_NOT_SPECIFIED";
- String XML_INVERSE_REFERENCE__MAPPED_BY_NOT_RESOLVED = "XML_INVERSE_REFERENCE__MAPPED_BY_NOT_RESOLVED";
- String XML_INVERSE_REFERENCE__MAPPED_BY_ILLEGAL_MAPPING_TYPE = "XML_INVERSE_REFERENCE__MAPPED_BY_ILLEGAL_MAPPING_TYPE";
-
- // for all XPath usage
- String XPATH__INVALID_FORM_ILLEGAL_SEGMENT = "XPATH__INVALID_FORM_ILLEGAL_SEGMENT";
- String XPATH__ROOT_NOT_SUPPORTED = "XPATH__ROOT_NOT_SUPPORTED";
- String XPATH__SELF_SEGMENT_MUST_BE_FIRST_SEGMENT = "XPATH__SELF_SEGMENT_MUST_BE_FIRST_SEGMENT";
- String XPATH__TEXT_SEGMENT_MUST_BE_LAST_SEGMENT = "XPATH__TEXT_SEGMENT_MUST_BE_LAST_SEGMENT";
- String XPATH__ATTRIBUTE_SEGMENT_MUST_BE_LAST_SEGMENT = "XPATH__ATTRIBUTE_SEGMENT_MUST_BE_LAST_SEGMENT";
- String XPATH__INVALID_NS_PREFIX = "XPATH__INVALID_NS_PREFIX";
- String XPATH__UNRESOLVED_ELEMENT = "XPATH__UNRESOLVED_ELEMENT";
- String XPATH__UNRESOLVED_ATTRIBUTE = "XPATH__UNRESOLVED_ATTRIBUTE";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.java
deleted file mode 100644
index ba5853d23a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/ELJaxb.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.eclipselink.core.resource.java;
-
-/**
- * EclipseLink 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 ELJaxb {
-
- // EclipseLink annotations package
-
- String PACKAGE = "org.eclipse.persistence.oxm.annotations";
- String PACKAGE_ = PACKAGE + '.';
-
-
- // Annotations
-
- String XML_CDATA = PACKAGE_ + "XmlCDATA";
-
- String XML_DISCRIMINATOR_NODE = PACKAGE_ + "XmlDiscriminatorNode";
- String XML_DISCRIMINATOR_NODE__VALUE = "value";
-
- String XML_DISCRIMINATOR_VALUE = PACKAGE_ + "XmlDiscriminatorValue";
- String XML_DISCRIMINATOR_VALUE__VALUE = "value";
-
- String XML_INVERSE_REFERENCE = PACKAGE_ + "XmlInverseReference";
- String XML_INVERSE_REFERENCE__MAPPED_BY = "mappedBy";
-
- String XML_JOIN_NODE = PACKAGE_ + "XmlJoinNode";
- String XML_JOIN_NODE__XML_PATH = "xmlPath";
- String XML_JOIN_NODE__REFERENCED_XML_PATH = "referencedXmlPath";
-
- String XML_JOIN_NODES = PACKAGE_ + "XmlJoinNodes";
- String XML_JOIN_NODES__VALUE = "value";
-
- String XML_KEY = PACKAGE_ + "XmlKey";
-
- String XML_PATH = PACKAGE_ + "XmlPath";
- String XML_PATH__VALUE = "value";
-
- String XML_PATHS = PACKAGE_ + "XmlPaths";
-
- String XML_TRANSFORMATION = PACKAGE_ + "XmlTransformation";
- String XML_TRANSFORMATION__OPTIONAL = "optional";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlCDATAAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlCDATAAnnotation.java
deleted file mode 100644
index 07675041d8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlCDATAAnnotation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlCDATA
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface XmlCDATAAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java
deleted file mode 100644
index 43efff8607..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorNodeAnnotation.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface XmlDiscriminatorNodeAnnotation
- extends Annotation {
-
- /**
- * String associated with change events to the 'value' property
- */
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlDiscriminatorNode annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
-
- /**
- * Corresponds to the 'value' element of the XmlDiscriminatorNode annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the text range associated with the 'value' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified text position is within the 'value' element.
- */
- boolean valueTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorValueAnnotation.java
deleted file mode 100644
index d9312af1f0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface XmlDiscriminatorValueAnnotation
- extends Annotation {
-
- /**
- * String associated with change events to the 'value' property
- */
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the XmlDiscriminatorValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
-
- /**
- * Corresponds to the 'value' element of the XmlDiscriminatorValue annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the text range associated with the 'value' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
deleted file mode 100644
index b7b7a07a11..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java
+++ /dev/null
@@ -1,59 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlInverseReference
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.0
- */
-public interface XmlInverseReferenceAnnotation
- extends Annotation {
-
- /**
- * String associated with change events to the 'mappedBy' property
- */
- String MAPPED_BY_PROPERTY = "mappedBy"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'mappedBy' element of the XmlInverseReference annotation.
- * Return null if the element does not exist in Java.
- */
- String getMappedBy();
-
- /**
- * Corresponds to the 'mappedBy' element of the XmlInverseReference annotation.
- * Set to null to remove the element.
- */
- void setMappedBy(String mappedBy);
-
- /**
- * Return the text range associated with the 'mappedBy' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getMappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified text position is within the 'mappedBy' element.
- */
- boolean mappedByTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java
deleted file mode 100644
index 7e8ff12345..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlJoinNodeAnnotation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlJoinNode
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface XmlJoinNodeAnnotation
- extends NestableAnnotation {
-
- /**
- * String associated with change events to the 'xmlPath' property
- */
- String XML_PATH_PROPERTY = "xmlPath"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'xmlPath' element of the XmlJoinNode annotation.
- * Return null if the element does not exist in Java.
- */
- String getXmlPath();
-
- /**
- * Corresponds to the 'xmlPath' element of the XmlJoinNode annotation.
- * Set to null to remove the element.
- */
- void setXmlPath(String xmlPath);
-
- /**
- * Return the text range associated with the 'xmlPath' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getXmlPathTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified text position is within the 'xmlPath' element.
- */
- boolean xmlPathTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * String associated with change events to the 'referencedXmlPath' property
- */
- String REFERENCED_XML_PATH_PROPERTY = "referencedXmlPath"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'referencedXmlPath' element of the XmlJoinNode annotation.
- * Return null if the element does not exist in Java.
- */
- String getReferencedXmlPath();
-
- /**
- * Corresponds to the 'referencedXmlPath' element of the XmlJoinNode annotation.
- * Set to null to remove the element.
- */
- void setReferencedXmlPath(String referencedXmlPath);
-
- /**
- * Return the text range associated with the 'referencedXmlPath' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getReferencedXmlPathTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified text position is within the 'referencedXmlPath' element.
- */
- boolean referencedXmlPathTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlKeyAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlKeyAnnotation.java
deleted file mode 100644
index cd96cd9200..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlKeyAnnotation.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlKey
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface XmlKeyAnnotation
- extends Annotation {
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java
deleted file mode 100644
index 5a6908a5fc..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlPathAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlPath
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface XmlPathAnnotation
- extends NestableAnnotation {
-
- /**
- * String associated with change events to the 'value' property
- */
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the annotation.
- * Return null if the element does not exist in Java (the annotation is a marker annotation.)
- */
- String getValue();
-
- /**
- * Corresponds to the 'value' element of the annotation.
- * Set to null to remove the element (to make it a marker annotation.)
- */
- void setValue(String value);
-
- /**
- * Return the text range associated with the 'value' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified text position is within the 'value' element.
- */
- boolean valueTouches(int pos, CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java
deleted file mode 100644
index df7071765e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java
+++ /dev/null
@@ -1,54 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.oxm.annotations.XmlTransformation
- *
- * 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 XmlTransformationAnnotation
- extends Annotation {
-
- /**
- * String associated with change events to the 'optional' property
- */
- String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'optional' element of the XmlTransformation annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the 'optional' element of the XmlTransformation annotation.
- * Set to null to remove the element.
- */
- void setOptional(Boolean optional);
-
- /**
- * Return the text range associated with the 'optional' element.
- * Return the text range of this annotation if the element is absent.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
deleted file mode 100644
index 783ee1e9ed..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.classpath
+++ /dev/null
@@ -1,13 +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">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project
deleted file mode 100644
index d5a24d6f79..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.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.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ca38fa9a1c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:04 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 8e669444a7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,30 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.ui;singleton:=true
-Bundle-Version: 1.3.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.2,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.jface;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.jpt.jaxb.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.swt;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.8.0,4.0.0)",
- org.eclipse.ui.workbench;bundle-version="[3.7.0,4.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.ui,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_4;x-internal:=true
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.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.jaxb.eclipselink.ui/build.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
deleted file mode 100644
index 08bc038360..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/build.properties
+++ /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
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- icons/,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif
deleted file mode 100644
index ce55b84284..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-inverse-reference.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gif
deleted file mode 100644
index 578ec36aa3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-join-nodes.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif
deleted file mode 100644
index fecf9e54c3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/icons/full/obj16/xml-transformation.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties
deleted file mode 100644
index affebbc075..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.properties
+++ /dev/null
@@ -1,25 +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 - EclipseLink MOXy Support - UI
-providerName=Eclipse Web Tools Platform
-
-addEclipseLinkJaxbPropertyCommand=Add EclipseLink JAXB property
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml
deleted file mode 100644
index 938f8a981b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/plugin.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- 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
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.jpt.jaxb.ui.jaxbPlatformUis">
-
- <jaxbPlatformUi
- id="eclipselink_2_1.ui"
- jaxbPlatform="eclipselink_2_1"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1.ELJaxb_2_1_PlatformUi"/>
-
- <jaxbPlatformUi
- id="eclipselink_2_2.ui"
- jaxbPlatform="eclipselink_2_2"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2.ELJaxb_2_2_PlatformUi"/>
-
- <jaxbPlatformUi
- id="eclipselink_2_3.ui"
- jaxbPlatform="eclipselink_2_3"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3.ELJaxb_2_3_PlatformUi"/>
-
- <jaxbPlatformUi
- id="eclipselink_2_4.ui"
- jaxbPlatform="eclipselink_2_4"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_4.ELJaxb_2_4_PlatformUi"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.commands">
-
- <command
- id="org.eclipse.jpt.jaxb.eclipselink.ui.command.addEclipseLinkJaxbProperty"
- name="%addEclipseLinkJaxbPropertyCommand"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.handlers">
-
- <handler
- commandId="org.eclipse.jpt.jaxb.eclipselink.ui.command.addEclipseLinkJaxbProperty"
- class="org.eclipse.jpt.jaxb.eclipselink.ui.internal.commands.AddEclipseLinkJaxbPropertyCommandHandler">
- <enabledWhen>
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.jpt.jaxb.core.context.JaxbPackage">
- <test
- property="org.eclipse.jpt.jaxb.eclipselink.core.hasEclipseLinkJaxbProperty"
- value="false"/>
- </adapt>
- </iterate>
- </enabledWhen>
- </handler>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions to the JAXB menu -->
- <menuContribution
- locationURI="popup:org.eclipse.jpt.jaxb.ui.menu.jaxb">
-
- <!--
- "Add EclipseLink JAXB property" menu item for any JaxbPackage
- that does not already have one
- -->
- <command
- commandId="org.eclipse.jpt.jaxb.eclipselink.ui.command.addEclipseLinkJaxbProperty">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.jpt.jaxb.core.context.JaxbPackage">
- <test
- property="org.eclipse.jpt.jaxb.eclipselink.core.hasEclipseLinkJaxbProperty"
- value="false"/>
- </adapt>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- </menuContribution>
-
- </extension>
-
-</plugin>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java
deleted file mode 100644
index 39e81583dd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.ui;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static BundleContext context;
-
- static BundleContext getContext() {
- return context;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java
deleted file mode 100644
index 23b5d76ee8..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.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.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;
-
-/**
- * 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 JptJaxbEclipseLinkUiPlugin
- extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.ui";
-
-
- // ********** singleton **********
-
- private static JptJaxbEclipseLinkUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJaxbEclipseLinkUiPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** error logging **********
-
- 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;
- }
-
-
- // ********** constructors **********
-
- public JptJaxbEclipseLinkUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
deleted file mode 100644
index a740ddcbb4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys;
-import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-
-public class ELJaxbMappingImageHelper {
-
- public static Image imageForAttributeMapping(String mappingKey) {
- String iconKey = iconKeyForAttributeMapping(mappingKey);
- return (iconKey == null) ?
- JaxbMappingImageHelper.imageForAttributeMapping(mappingKey)
- : JptJaxbEclipseLinkUiPlugin.getImage(iconKey);
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
- if (ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbEclipseLinkUiIcons.XML_INVERSE_REFERENCE;
- }
- else if (ELJaxbMappingKeys.XML_JOIN_NODES_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptJaxbEclipseLinkUiIcons.XML_JOIN_NODES;
- }
- else if (ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbEclipseLinkUiIcons.XML_TRANSFORMATION;
- }
-
- return null;
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 52d9500cb7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorItemLabelProviderFactory;
-
-
-public class ELJaxbNavigatorItemLabelProviderFactory
- extends GenericJaxb_2_1_NavigatorItemLabelProviderFactory {
-
- private static ELJaxbNavigatorItemLabelProviderFactory INSTANCE = new ELJaxbNavigatorItemLabelProviderFactory();
-
-
- public static GenericJaxb_2_1_NavigatorItemLabelProviderFactory instance() {
- return INSTANCE;
- }
-
-
- private ELJaxbNavigatorItemLabelProviderFactory() {
- super();
- }
-
-
- @Override
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
-
- if (item instanceof JaxbPersistentAttribute) {
- return new ELJaxbPersistentAttributeItemLabelProvider((JaxbPersistentAttribute) item, manager);
- }
-
- return super.buildProvider(item, manager);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java
deleted file mode 100644
index 86a9cfa556..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi;
-
-
-public class ELJaxbNavigatorUi
- extends GenericJaxb_2_1_NavigatorUi {
-
- private static ELJaxbNavigatorUi INSTANCE = new ELJaxbNavigatorUi();
-
-
- public static ELJaxbNavigatorUi instance() {
- return INSTANCE;
- }
-
-
- private ELJaxbNavigatorUi() {
- super();
- }
-
-
- @Override
- public ItemExtendedLabelProviderFactory getItemLabelProviderFactory() {
- return ELJaxbNavigatorItemLabelProviderFactory.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java
deleted file mode 100644
index ea3b47b243..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.internal.jaxb21.JaxbPersistentAttributeItemLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-
-public class ELJaxbPersistentAttributeItemLabelProvider
- extends JaxbPersistentAttributeItemLabelProvider
-{
- public ELJaxbPersistentAttributeItemLabelProvider(JaxbPersistentAttribute attribute, ItemLabelProvider.Manager manager) {
- super(attribute, manager);
- }
-
-
- @Override
- protected Image buildImage(String mappingKey) {
- return ELJaxbMappingImageHelper.imageForAttributeMapping(mappingKey);
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java
deleted file mode 100644
index e9e4faacdf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.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.jaxb.eclipselink.ui.internal;
-
-
-public class JptJaxbEclipseLinkUiIcons {
-
- public static final String XML_INVERSE_REFERENCE = "full/obj16/xml-inverse-reference";
- public static final String XML_JOIN_NODES = "full/obj16/xml-join-nodes";
- public static final String XML_TRANSFORMATION = "full/obj16/xml-transformation";
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java
deleted file mode 100644
index 21bd600dfb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/commands/AddEclipseLinkJaxbPropertyCommandHandler.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.ui.internal.commands;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.Properties;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-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.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-
-
-public class AddEclipseLinkJaxbPropertyCommandHandler
- extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection =
- (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- IWorkbenchWindow activeWindow = HandlerUtil.getActiveWorkbenchWindow(event);
-
- for (Iterator stream = selection.iterator(); stream.hasNext(); ) {
- addEclipseLinkJaxbProperty(stream.next(), activeWindow);
- }
-
- return null;
- }
-
- protected void addEclipseLinkJaxbProperty(Object selectedObject, IWorkbenchWindow activeWindow) {
- JaxbPackage jaxbPackage =
- (JaxbPackage) Platform.getAdapterManager().getAdapter(selectedObject, JaxbPackage.class);
-
- JaxbPropertiesResource jaxbProperties = jaxbPackage.getJaxbProject().getJaxbPropertiesResource(jaxbPackage.getName());
-
- if (jaxbProperties == null) {
- createJaxbPropertiesWithProperty(jaxbPackage, activeWindow);
- }
- else {
- addPropertyToExistingProperties(jaxbPackage, activeWindow);
- }
- }
-
- protected void createJaxbPropertiesWithProperty(
- final JaxbPackage jaxbPackage, final IWorkbenchWindow activeWindow) {
- final IFolder folder;
- try {
- folder = getFolder(jaxbPackage);
- }
- catch (JavaModelException jme) {
- JptJaxbEclipseLinkUiPlugin.log(jme);
- return;
- }
- Job job = new Job("Creating jaxb.properties") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IFile file = folder.getFile("jaxb.properties");
- InputStream stream = createInputStream(createNewProperties());
- try {
- file.create(stream, true, null);
- }
- catch (CoreException ce) {
- JptJaxbEclipseLinkUiPlugin.log(ce);
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not create jaxb.properties.");
- }
- AddEclipseLinkJaxbPropertyCommandHandler.this.revealAndOpenFile(file, activeWindow);
- return Status.OK_STATUS;
- }
- };
- job.setRule(folder);
- job.schedule();
- }
-
- protected void addPropertyToExistingProperties(
- final JaxbPackage jaxbPackage, final IWorkbenchWindow activeWindow) {
- final IFolder folder;
- try {
- folder = getFolder(jaxbPackage);
- }
- catch (JavaModelException jme) {
- JptJaxbEclipseLinkUiPlugin.log(jme);
- return;
- }
- Job job = new Job("Adding property to jaxb.properties.") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IFile file = folder.getFile("jaxb.properties");
- Properties properties = loadProperties(file);
- if (properties == null) {
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not load jaxb.properties.");
- }
- adjustProperties(properties);
- InputStream stream = createInputStream(properties);
- try {
- file.setContents(stream, true, true, null);
- }
- catch (CoreException ce) {
- JptJaxbEclipseLinkUiPlugin.log(ce);
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not write to jaxb.properties.");
- }
- AddEclipseLinkJaxbPropertyCommandHandler.this.revealAndOpenFile(file, activeWindow);
- return Status.OK_STATUS;
- }
- };
- job.setRule(folder);
- job.schedule();
- }
-
- protected IFolder getFolder(JaxbPackage jaxbPackage) throws JavaModelException {
- IPackageFragment jdtPackage =
- (IPackageFragment) CollectionTools.get(
- jaxbPackage.getContextRoot().getTypes(jaxbPackage), 0).
- getJavaResourceType().getJavaResourceCompilationUnit().getCompilationUnit().getParent();
- return (IFolder) jdtPackage.getUnderlyingResource();
- }
-
- protected Properties createNewProperties() {
- Properties properties = new Properties();
- adjustProperties(properties);
- return properties;
- }
-
- protected Properties loadProperties(IFile file) {
- Properties properties = new Properties();
- InputStream stream = null;
- try {
- properties.load(file.getContents());
- }
- catch (Exception ex) {
- JptJaxbEclipseLinkUiPlugin.log(ex);
- return null;
- }
- finally {
- closeStream(stream);
- }
- return properties;
- }
-
- protected void adjustProperties(Properties properties) {
- String factoryProp = "javax.xml.bind.context.factory";
- String factoryPropValue = "org.eclipse.persistence.jaxb.JAXBContextFactory";
- properties.setProperty(factoryProp, factoryPropValue);
- }
-
- protected InputStream createInputStream(Properties properties) {
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- try {
- properties.store(outStream, null);
- }
- catch (Exception e) {
- JptJaxbCorePlugin.log(e);
- return new ByteArrayInputStream(new byte[0]);
- }
- finally {
- closeStream(outStream);
- }
-
- return new ByteArrayInputStream(outStream.toByteArray());
- }
-
- protected void closeStream(Closeable stream) {
- try {
- if (stream != null) {
- stream.close();
- }
- } catch (IOException ex) {
- JptJaxbEclipseLinkUiPlugin.log(ex);
- }
- }
-
- protected void revealAndOpenFile(
- final IFile file, final IWorkbenchWindow activeWindow) {
- Job job = new UIJob("Opening jaxb.properties.") {
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- BasicNewResourceWizard.selectAndReveal(file, activeWindow);
- try {
- IDE.openEditor(activeWindow.getActivePage(), file, true);
- }
- catch (PartInitException pie) {
- JptJaxbUiPlugin.log(pie);
- return new Status(Status.ERROR, JptJaxbEclipseLinkUiPlugin.PLUGIN_ID, "Could not open jaxb.properties in editor.");
- }
- return Status.OK_STATUS;
- }
- };
- job.setRule(file.getParent());
- job.schedule();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java
deleted file mode 100644
index cdaa30c23f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java
+++ /dev/null
@@ -1,23 +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.eclipselink.ui.internal.v2_1;
-
-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 ELJaxb_2_1_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return GenericJaxb_2_1_NavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java
deleted file mode 100644
index 2737982fd4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java
+++ /dev/null
@@ -1,23 +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.eclipselink.ui.internal.v2_2;
-
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class ELJaxb_2_2_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return ELJaxbNavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java
deleted file mode 100644
index dbc9c4f31e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java
+++ /dev/null
@@ -1,23 +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.eclipselink.ui.internal.v2_3;
-
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class ELJaxb_2_3_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return ELJaxbNavigatorUi.instance();
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_4/ELJaxb_2_4_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_4/ELJaxb_2_4_PlatformUi.java
deleted file mode 100644
index 62cb7ffc42..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_4/ELJaxb_2_4_PlatformUi.java
+++ /dev/null
@@ -1,23 +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.eclipselink.ui.internal.v2_4;
-
-import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi;
-import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi;
-
-
-public class ELJaxb_2_4_PlatformUi
- implements JaxbPlatformUi {
-
- public JaxbNavigatorUi getNavigatorUi() {
- return ELJaxbNavigatorUi.instance();
- }
-}
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 ba077a4031..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
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/.settings/org.eclipse.jdt.core.prefs b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 38cf57c08a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:10 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 89a4a4d393..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,51 +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.3.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.launching;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 0a95eca8b7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/build.properties
+++ /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
-################################################################################
-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_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.gif
deleted file mode 100644
index baac236770..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_class.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/jaxb_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif
deleted file mode 100644
index c73ed28e70..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_enum.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif
deleted file mode 100644
index 719e6057b3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_registry.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif
deleted file mode 100644
index 066461be61..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico
deleted file mode 100644
index 126f3e5c81..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_class.ico
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif
deleted file mode 100644
index b634fb535f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico
deleted file mode 100644
index 6c3cceb0c4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/jaxb_transient_enum.ico
+++ /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 6989b8df73..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_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/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/xml-any-attribute.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-any-attribute.gif
deleted file mode 100644
index a5d9fb0dd6..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 f73d02bf43..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 851ee72391..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-ref.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif
deleted file mode 100644
index 3220052c41..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-ref.gif
+++ /dev/null
Binary files differ
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.gif
deleted file mode 100644
index 77e4d6a8bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-element-refs.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 8c953dc928..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-elements.gif b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.gif
deleted file mode 100644
index cb6aad6b16..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/icons/full/obj16/xml-elements.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 8a4a68b8e4..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
+++ /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
-###############################################################################
-
-# ====================================================================
-# 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
-
-createPackageInfoCommand = Create package-info.java
-
-jaxbMenu = JAXB
-
-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 287d099477..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
+++ /dev/null
@@ -1,406 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?> <!--
- Copyright (c) 2010, 2012 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension-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">
- <enablement>
- <with variable="project">
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb" forcePluginActivation="true"/>
- </adapt>
- </with>
- </enablement>
- </proposalCategory>
-
- </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.commands">
-
- <command
- id="org.eclipse.jpt.jaxb.ui.command.createPackageInfo"
- name="%createPackageInfoCommand"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.handlers">
-
- <handler
- commandId="org.eclipse.jpt.jaxb.ui.command.createPackageInfo"
- class="org.eclipse.jpt.jaxb.ui.internal.commands.CreatePackageInfoCommandHandler">
- <enabledWhen>
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.jpt.jaxb.core.context.JaxbPackage">
- <test
- property="org.eclipse.jpt.jaxb.core.hasPackageInfo"
- value="false"/>
- </adapt>
- </iterate>
- </enabledWhen>
- </handler>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions for any popup -->
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any">
-
- <!--
- "JAXB" submenu for any JaxbPackage
- -->
- <menu
- id="org.eclipse.jpt.jaxb.ui.menu.jaxb"
- label="%jaxbMenu">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <!-- bug 377809 test for jaxb facet: if o.e.jpt.jaxb.core plug-in not active,
- the JaxbPackage AdapterFactory will not be called and the expression evaluates to true,
- that causes the JAXB menu to appear for JPA project packages -->
- <and>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jaxb"/>
- </adapt>
- <adapt type="org.eclipse.jpt.jaxb.core.context.JaxbPackage"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- </menu>
-
- </menuContribution>
-
- <!-- contributions to the JAXB menu -->
- <menuContribution
- locationURI="popup:org.eclipse.jpt.jaxb.ui.menu.jaxb">
-
- <!--
- "Create package-info.java" menu item for any JaxbPackage
- that does not already have one
- -->
- <command
- commandId="org.eclipse.jpt.jaxb.ui.command.createPackageInfo">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.jpt.jaxb.core.context.JaxbPackage">
- <test
- property="org.eclipse.jpt.jaxb.core.hasPackageInfo"
- value="false"/>
- </adapt>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- </menuContribution>
-
- </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.common.ui.internal.jface.NavigatorLabelProvider">
-
- <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.jaxb.ui.internal.navigator.JaxbNavigatorActionProvider"
- id="org.eclipse.jpt.jaxb.ui.jaxbActionProvider">
- <enablement>
- <and>
- <instanceof
- value="org.eclipse.jpt.jaxb.core.context.JaxbContextNode"/>
- </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 8917ccd0b3..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
+++ /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
-################################################################################
-
-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}
-
-Error_openingEditor=Error Opening Editor
-
-JaxbContent_label=JAXB Content
-
-SchemasPage_description = Configure JAXB schemas used for validation and content 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.
-
-SelectFileOrXMLCatalogIdPanel_fileFromWorkspace = Select file from Work&space
-SelectFileOrXMLCatalogIdPanel_xmlCatalogEntry = Select XML Catalo&g entry
-SelectFileOrXMLCatalogIdPanel_importButton = &Import Files...
-
-ClassesGeneratorWizardPage_title = Generate Classes from Schema: {0}
-ClassesGeneratorWizardPage_desc = Configure JAXB class generation.
-
-ClassesGeneratorWizardPage_usesMoxyImplementation = Use EclipseLink MO&Xy as the JAXB implementation
-
-ClassesGeneratorWizardPage_catalog = Catalo&g:
-ClassesGeneratorWizardPage_bindingsFiles = B&indings files:
-ClassesGeneratorWizardPage_browseButton = Brow&se...
-ClassesGeneratorWizardPage_addButton = &Add...
-ClassesGeneratorWizardPage_removeButton = Re&move
-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 = N&o proxy
-ClassesGeneratorOptionsWizardPage_proxy = &Proxy:
-ClassesGeneratorOptionsWizardPage_proxyFile = Prox&y file:
-ClassesGeneratorOptionsWizardPage_chooseAProxyFile = Proxy File Selection
-
-ClassesGeneratorOptionsWizardPage_useStrictValidation = Use strict v&alidation
-ClassesGeneratorOptionsWizardPage_makeReadOnly = Generate &read-only files
-ClassesGeneratorOptionsWizardPage_suppressPackageInfoGen = Suppress pac&kage-info generation
-ClassesGeneratorOptionsWizardPage_suppressesHeaderGen = Suppress generation of file &header
-ClassesGeneratorOptionsWizardPage_target = Target X&JC 2.0
-ClassesGeneratorOptionsWizardPage_verbose = &Verbose
-ClassesGeneratorOptionsWizardPage_quiet = Suppress compiler outp&ut
-
-ClassesGeneratorOptionsWizardPage_treatsAsXmlSchema = Treat input as &XML schema
-ClassesGeneratorOptionsWizardPage_treatsAsRelaxNg = Treat input as RELAX N&G
-ClassesGeneratorOptionsWizardPage_treatsAsRelaxNgCompact = Treat input as RELAX NG &compact syntax
-ClassesGeneratorOptionsWizardPage_treatsAsDtd = Treat input as XML D&TD
-ClassesGeneratorOptionsWizardPage_treatsAsWsdl = Treat input as WS&DL and compile schema inside it
-ClassesGeneratorOptionsWizardPage_showsVersion = Show vers&ion
-ClassesGeneratorOptionsWizardPage_showsHelp = Show h&elp
-
-ClassesGeneratorExtensionOptionsWizardPage_title = Classes Generator Extension Configuration
-ClassesGeneratorExtensionOptionsWizardPage_desc = Configure JAXB compiler vendor extensions.
-
-ClassesGeneratorExtensionOptionsWizardPage_allowExtensions = Allow vendor &extensions
-ClassesGeneratorExtensionOptionsWizardPage_classpath = Class&path:
-ClassesGeneratorExtensionOptionsWizardPage_additionalArguments = Additional ar&guments:
-
-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.\
- \nAre you sure you want to continue?
-
-# SchemaGenerator
-SchemaGeneratorWizard_title = New JAXB Schema File
-
-SchemaGeneratorWizard_generatingSchema = Generating JAXB Schema
-SchemaGeneratorWizard_openSchemaFileJobName = Open XSD File
-
-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 f67d113c5e..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-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.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.core.xsd.XsdUtil;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * ClassesGeneratorUi
- */
-public class ClassesGeneratorUi {
-
- private final IJavaProject javaProject;
- private final IFile xsdFile;
-
- // ********** static methods **********
-
- public static void generate(IFile xsdFile) {
- IJavaProject javaProject = JavaCore.create(xsdFile.getProject());
- if (javaProject == null) {
- throw new NullPointerException();
- }
-
- new ClassesGeneratorUi(javaProject, xsdFile).generate();
- }
-
- // ********** constructors **********
- private ClassesGeneratorUi(IJavaProject javaProject, IFile xsdFile) {
- super();
- if (javaProject == null) {
- throw new NullPointerException();
- }
- this.javaProject = javaProject;
- this.xsdFile = xsdFile;
- }
-
- // ********** generate **********
- /**
- * prompt the user with a wizard
- */
- protected void generate() {
- ClassesGeneratorWizard wizard = new ClassesGeneratorWizard(this.javaProject, this.xsdFile);
- wizard.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode != Window.OK) {
- return;
- }
-
- if(this.displayOverwritingClassesWarning(wizard.getGeneratorOptions())) {
- this.generateJaxbClasses(
- wizard.getLocalSchemaUri(),
- wizard.getDestinationFolder(),
- wizard.getTargetPackage(),
- wizard.getCatalog(),
- wizard.usesMoxy(),
- wizard.getBindingsFileNames(),
- wizard.getGeneratorOptions(),
- wizard.getGeneratorExtensionOptions());
- addSchemaToLibrary(wizard.getSchemaLocation());
- }
- }
-
- // ********** internal methods **********
-
- private void generateJaxbClasses(
- URI schemaUri,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean usesMoxyGenerator,
- String[] bindingsFileNames,
- ClassesGeneratorOptions generatorOptions,
- ClassesGeneratorExtensionOptions generatorExtensionOptions) {
-
- try {
- WorkspaceJob job = new GenerateJaxbClassesJob(
- this.javaProject,
- schemaUri.toString(),
- 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 addSchemaToLibrary(String schemaLocation) {
- JaxbProject jaxbProject = getJaxbProject();
-
- if (jaxbProject == null) {
- return;
- }
-
- String resolvedUri = XsdUtil.getResolvedUri(schemaLocation);
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- if (schema != null) {
- SchemaLibrary schemaLib = jaxbProject.getSchemaLibrary();
- List<String> schemas = new Vector<String>(schemaLib.getSchemaLocations());
- if (! schemas.contains(schemaLocation)) {
- schemas.add(schemaLocation);
- schemaLib.setSchemaLocations(schemas);
- }
- }
- }
-
- 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;
- }
-
- /* may be null */
- private JaxbProject getJaxbProject() {
- return JptJaxbCorePlugin.getJaxbProject(this.javaProject.getProject());
- }
-
- private boolean isOverwritingClasses(ClassesGeneratorOptions generatorOptions) {
- if(generatorOptions == null) {
- throw new NullPointerException();
- }
- if(generatorOptions.showsVersion() || generatorOptions.showsHelp()) {
- return false;
- }
- return true;
- }
-
- private boolean displayOverwritingClassesWarning(ClassesGeneratorOptions generatorOptions) {
-
- if( ! this.isOverwritingClasses(generatorOptions)
- || !OptionalMessageDialog.isDialogEnabled(OverwriteConfirmerDialog.ID)) {
- return true;
- }else {
- OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.getShell());
- return dialog.open() == IDialogConstants.YES_ID;
- }
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- // ********** overwrite dialog **********
-
- static class OverwriteConfirmerDialog extends OptionalMessageDialog {
-
- private static final String ID= "dontShowOverwriteJaxbClassesFromSchemas.warning"; //$NON-NLS-1$
-
- OverwriteConfirmerDialog(Shell parent) {
- super(ID, parent,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningTitle,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningMessage,
- MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- }
-
- }
-
-}
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 0815779e2c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbJavaCompletionProposalComputer.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.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.Transparent.<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)) {
- // using proposal.length() -1 as cursor position puts the cursor just inside end quotes
- // useful for further content assist if necessary
- proposals.add(new CompletionProposal(proposal, tokenStart, tokenEnd - tokenStart + 1, proposal.length() - 1));
- }
- }
- 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 4c0ddd7a7b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JaxbMappingImageHelper.java
+++ /dev/null
@@ -1,79 +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_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT_REF;
- }
- else if (MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENT_REFS;
- }
- else if (MappingKeys.XML_ELEMENTS_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptJaxbUiIcons.XML_ELEMENTS;
- }
- 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 693c3ec187..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiIcons.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.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 JAXB_CLASS = "full/obj16/jaxb_class";
- public static final String JAXB_ENUM = "full/obj16/jaxb_enum";
- public static final String JAXB_TRANSIENT_CLASS = "full/obj16/jaxb_transient_class";
- public static final String JAXB_TRANSIENT_ENUM = "full/obj16/jaxb_transient_enum";
- public static final String JAXB_REGISTRY = "full/obj16/jaxb_registry";
-
- 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_ELEMENT_REF = "full/obj16/xml-element-ref";
- public static final String XML_ELEMENT_REFS = "full/obj16/xml-element-refs";
- public static final String XML_ELEMENTS = "full/obj16/xml-elements";
-
- 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";
-
- 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";
-
-
- // **************** Wizard icons *******************************************
-
- public static final String SCHEMA_GEN = "full/wizban/NewXSD";
-
- 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";
-}
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 ef7689b1aa..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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 Error_openingEditor;
-
- 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 SelectFileOrXMLCatalogIdPanel_fileFromWorkspace;
- public static String SelectFileOrXMLCatalogIdPanel_xmlCatalogEntry;
- public static String SelectFileOrXMLCatalogIdPanel_importButton;
-
- 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 SchemaGeneratorWizard_openSchemaFileJobName;
-
- 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/actions/OpenJaxbResourceAction.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/OpenJaxbResourceAction.java
deleted file mode 100644
index c852e481cb..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/OpenJaxbResourceAction.java
+++ /dev/null
@@ -1,91 +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.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.BaseSelectionListenerAction;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-
-
-public class OpenJaxbResourceAction
- extends BaseSelectionListenerAction {
-
- private JaxbContextNode selectedNode;
-
-
- public OpenJaxbResourceAction() {
- super("Open"); //$NON-NLS-1$
- }
-
-
- @Override
- public boolean updateSelection(IStructuredSelection s) {
- this.selectedNode = null;
-
- if (! super.updateSelection(s)) {
- return false;
- }
-
- if (s.size() != 1) {
- return false;
- }
-
- if (s.getFirstElement() instanceof JaxbContextRoot) {
- return false;
- }
-
- selectedNode = (JaxbContextNode) s.getFirstElement();
-
- return true;
- }
-
- @Override
- public void run() {
- if (! isEnabled()) {
- return;
- }
-
- IResource resource = this.selectedNode.getResource();
-
- if (resource != null && resource.exists() && resource.getType() == IResource.FILE) {
- openEditor((IFile) resource);
- }
- }
-
- protected void openEditor(IFile file) {
- IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
- IContentType contentType = IDE.getContentType(file);
- IEditorDescriptor editorDescriptor = registry.getDefaultEditor(file.getName(), contentType);
- if (editorDescriptor == null) {
- return; // no editor associated...
- }
-
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- try {
- page.openEditor(new FileEditorInput(file), editorDescriptor.getId());
- }
- catch (Exception e) {
- MessageDialog.openError(page.getWorkbenchWindow().getShell(), JptJaxbUiMessages.Error_openingEditor, e.getMessage());
- }
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java
deleted file mode 100644
index ec18089158..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/commands/CreatePackageInfoCommandHandler.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.commands;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
-
-
-public class CreatePackageInfoCommandHandler
- extends AbstractHandler {
-
- private List<IFile> createdFiles = new Vector<IFile>();
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection =
- (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
-
- for (Iterator stream = selection.iterator(); stream.hasNext(); ) {
- createPackageInfo(stream.next());
- }
-
- for (IFile file : this.createdFiles) {
- IWorkbenchWindow activeWindow = HandlerUtil.getActiveWorkbenchWindow(event);
- BasicNewResourceWizard.selectAndReveal(file, activeWindow);
- try {
- IDE.openEditor(activeWindow.getActivePage(), file, true);
- }
- catch (PartInitException pie) {
- JptJaxbUiPlugin.log(pie);
- }
- }
-
- return null;
- }
-
- private void createPackageInfo(Object selectedObject) {
- JaxbPackage jaxbPackage =
- (JaxbPackage) Platform.getAdapterManager().getAdapter(selectedObject, JaxbPackage.class);
-
- IPackageFragment jdtPackage = getJdtPackage(jaxbPackage);
- try {
- ICompilationUnit cu = jdtPackage.createCompilationUnit("package-info.java", "package " + jdtPackage.getElementName() + ";", true, null);
- this.createdFiles.add((IFile) cu.getCorrespondingResource());
- }
- catch (JavaModelException jme) {
- JptJaxbUiPlugin.log(jme);
- }
- }
-
- private IPackageFragment getJdtPackage(JaxbPackage jaxbPackage) {
- return (IPackageFragment) CollectionTools.get(
- jaxbPackage.getContextRoot().getTypes(jaxbPackage), 0).
- getJavaResourceType().getJavaResourceCompilationUnit().getCompilationUnit().getParent();
- }
-}
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 58bc367db3..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,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-
-
-public class GenericJaxb_2_1_NavigatorItemLabelProviderFactory
- implements ItemExtendedLabelProviderFactory {
-
- 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;
- }
-
-
- protected GenericJaxb_2_1_NavigatorItemLabelProviderFactory() {
- super();
- }
-
-
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
-
- if (item instanceof JaxbContextRoot) {
- return this.buildJaxbContextRootProvider((JaxbContextRoot) item, manager);
- }
- else if (item instanceof JaxbPackage) {
- return this.buildJaxbPackageProvider((JaxbPackage) item, manager);
- }
- else if (item instanceof JaxbClass) {
- return new JaxbClassItemLabelProvider((JaxbClass) item, manager);
- }
- else if (item instanceof JaxbEnum) {
- return new JaxbEnumItemLabelProvider((JaxbEnum) item, manager);
- }
- else if (item instanceof JaxbPersistentAttribute) {
- return new JaxbPersistentAttributeItemLabelProvider((JaxbPersistentAttribute) item, manager);
- }
- else if (item instanceof JaxbEnumConstant) {
- return this.buildJaxbEnumConstantProvider((JaxbEnumConstant) item, manager);
- }
- return null;
- }
-
- protected ItemExtendedLabelProvider buildJaxbContextRootProvider(JaxbContextRoot root, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CONTENT),
- JptJaxbUiMessages.JaxbContent_label,
- this.buildJaxbContextRootDescription(root)
- );
- }
-
- protected String buildJaxbContextRootDescription(JaxbContextRoot root) {
- StringBuilder sb = new StringBuilder();
- sb.append(JptJaxbUiMessages.JaxbContent_label);
- sb.append(" - "); //$NON-NLS-1$
- sb.append(root.getResource().getFullPath().makeRelative());
- return sb.toString();
- }
-
- protected ItemExtendedLabelProvider buildJaxbEnumConstantProvider(JaxbEnumConstant enumConstant, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.getImage(JptJaxbUiIcons.ENUM_CONSTANT),
- enumConstant.getName()
- );
- }
-
- protected ItemExtendedLabelProvider buildJaxbPackageProvider(JaxbPackage pkg, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return new StaticItemExtendedLabelProvider(
- JptJaxbUiPlugin.getImage(JptJaxbUiIcons.PACKAGE),
- pkg.getName(),
- this.buildJaxbPackageDescription(pkg)
- );
- }
-
- protected String buildJaxbPackageDescription(JaxbPackage pkg) {
- StringBuilder sb = new StringBuilder();
- sb.append(pkg.getName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(pkg.getResource().getFullPath().makeRelative());
- return sb.toString();
- }
-}
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 52c3fa79e9..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,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-
-/**
- *
- */
-public class GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, Manager manager) {
- if (item instanceof JaxbContextRoot) {
- return this.buildJaxbContextRootProvider((JaxbContextRoot) item, manager);
- }
- if (item instanceof JaxbPackage) {
- return this.buildJaxbPackageProvider((JaxbPackage) item, manager);
- }
- if (item instanceof JaxbClass) {
- return this.buildJaxbClassProvider((JaxbClass) item, manager);
- }
- if (item instanceof JaxbEnum) {
- return this.buildJaxbEnumProvider((JaxbEnum) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJaxbContextRootProvider(JaxbContextRoot item, Manager manager) {
- return new JaxbContextRootItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJaxbPackageProvider(JaxbPackage item, Manager manager) {
- return new JaxbPackageItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJaxbClassProvider(JaxbClass item, Manager manager) {
- return new JaxbClassItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJaxbEnumProvider(JaxbEnum item, Manager manager) {
- return new JaxbEnumItemContentProvider(item, manager);
- }
-}
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 d0481c87f5..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, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-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;
- }
-
-
- protected GenericJaxb_2_1_NavigatorUi() {
- super();
- }
-
-
- public ItemTreeContentProviderFactory getTreeItemContentProviderFactory() {
- return GenericJaxb_2_1_NavigatorTreeItemContentProviderFactory.instance();
- }
-
- public ItemExtendedLabelProviderFactory 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/JaxbClassItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemContentProvider.java
deleted file mode 100644
index cbf6b8e38f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemContentProvider.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-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.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-
-
-public class JaxbClassItemContentProvider
- extends AbstractItemTreeContentProvider<JaxbClass, JaxbPersistentAttribute>
-{
-
- public JaxbClassItemContentProvider(JaxbClass jaxbClass, Manager manager) {
- super(jaxbClass, manager);
- }
-
-
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbPersistentAttribute> buildChildrenModel() {
- PropertyValueModel<JaxbClassMapping> mappingModel = buildMappingModel();
- return new CompositeCollectionValueModel<CollectionValueModel<JaxbPersistentAttribute>, JaxbPersistentAttribute>(
- buildAttributesModel(mappingModel),
- buildIncludedAttributesModel(mappingModel));
- }
-
- protected PropertyValueModel<JaxbClassMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbClass, JaxbClassMapping>(JaxbClass.MAPPING_PROPERTY, this.item) {
- @Override
- protected JaxbClassMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- protected CollectionValueModel<JaxbPersistentAttribute> buildAttributesModel(
- PropertyValueModel<JaxbClassMapping> mappingModel) {
- return new CollectionAspectAdapter<JaxbClassMapping, JaxbPersistentAttribute>(
- mappingModel, JaxbClassMapping.ATTRIBUTES_COLLECTION) {
- @Override
- protected Iterable<JaxbPersistentAttribute> getIterable() {
- return this.subject.getAttributes();
- }
- };
- }
-
- protected CollectionValueModel<JaxbPersistentAttribute> buildIncludedAttributesModel(
- PropertyValueModel<JaxbClassMapping> mappingModel) {
- return new CollectionAspectAdapter<JaxbClassMapping, JaxbPersistentAttribute>(
- mappingModel, JaxbClassMapping.INCLUDED_ATTRIBUTES_COLLECTION) {
- @Override
- protected Iterable<JaxbPersistentAttribute> getIterable() {
- return this.subject.getIncludedAttributes();
- }
- };
- }
-}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
deleted file mode 100644
index 1b5db6e35c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbClassItemLabelProvider.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-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.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.context.JaxbTypeMapping;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbClassItemLabelProvider
- extends JaxbTypeItemLabelProvider<JaxbClass>
-{
-
- public JaxbClassItemLabelProvider(JaxbClass jaxbPersistentClass, ItemLabelProvider.Manager manager) {
- super(jaxbPersistentClass, manager);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new JaxbClassImageModel(this.item);
- }
-
-
- protected class JaxbClassImageModel
- extends AspectPropertyValueModelAdapter<JaxbClass, Image> {
-
- protected final PropertyValueModel<Boolean> isXmlRegistryModel;
-
- protected final PropertyValueModel<JaxbClassMapping> mappingModel;
-
- protected final PropertyValueModel<Boolean> isXmlTransientModel;
-
- protected final PropertyChangeListener propertyChangeListener;
-
-
- public JaxbClassImageModel(JaxbClass subject) {
- super(new StaticPropertyValueModel<JaxbClass>(subject));
- this.isXmlRegistryModel = buildIsXmlRegistryModel();
- this.mappingModel = buildMappingModel();
- this.isXmlTransientModel = buildIsXmlTransientModel();
- this.propertyChangeListener = buildPropertyChangeListener();
- }
-
-
- protected PropertyValueModel<Boolean> buildIsXmlRegistryModel() {
- return new PropertyAspectAdapter<JaxbClass, Boolean>(JaxbClass.XML_REGISTRY_PROPERTY, JaxbClassItemLabelProvider.this.item) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getXmlRegistry() != null);
- }
- };
- }
-
- protected PropertyValueModel<JaxbClassMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbClass, JaxbClassMapping> (JaxbType.MAPPING_PROPERTY, JaxbClassItemLabelProvider.this.item) {
- @Override
- protected JaxbClassMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildIsXmlTransientModel() {
- return new PropertyAspectAdapter<JaxbClassMapping, Boolean>(this.mappingModel, JaxbTypeMapping.XML_TRANSIENT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isXmlTransient());
- }
- };
- }
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- // transform the subject's property change events into VALUE property change events
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JaxbClassImageModel.this.aspectChanged();
- }
- };
- }
-
- @Override
- protected Image buildValue_() {
- if (this.mappingModel.getValue() != null) {
- if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_TRANSIENT_CLASS);
- }
- }
- else if (this.isXmlRegistryModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_REGISTRY);
- }
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_CLASS);
- }
-
- @Override
- protected void engageSubject_() {
- this.isXmlRegistryModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- this.mappingModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.isXmlRegistryModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.mappingModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- }
- }
-}
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 b0894be526..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbContextRootItemContentProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-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 AbstractItemTreeContentProvider<JaxbContextRoot, JaxbPackage> {
-
- public JaxbContextRootItemContentProvider(JaxbContextRoot rootContext, Manager manager) {
- super(rootContext, manager);
- }
-
-
- public IProject getParent() {
- return item.getJaxbProject().getProject();
- }
-
- @Override
- protected CollectionValueModel<JaxbPackage> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbContextRoot, JaxbPackage>(
- JaxbContextRoot.PACKAGES_COLLECTION,
- this.item) {
-
- @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/JaxbEnumItemContentProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java
deleted file mode 100644
index 9c25e9a1da..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-
-
-public class JaxbEnumItemContentProvider
- extends AbstractItemTreeContentProvider<JaxbEnum, JaxbEnumConstant> {
-
- public JaxbEnumItemContentProvider(JaxbEnum jaxbEnum, Manager manager) {
- super(jaxbEnum, manager);
- }
-
-
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) this.item.getParent();
- }
-
- protected PropertyValueModel<JaxbEnumMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbEnum, JaxbEnumMapping>(JaxbType.MAPPING_PROPERTY, this.item) {
- @Override
- protected JaxbEnumMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- @Override
- protected CollectionValueModel<JaxbEnumConstant> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbEnumMapping, JaxbEnumConstant>(
- buildMappingModel(), JaxbEnumMapping.ENUM_CONSTANTS_COLLECTION) {
- @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/JaxbEnumItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
deleted file mode 100644
index 40a36bffb2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbEnumItemLabelProvider.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-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.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-
-public class JaxbEnumItemLabelProvider
- extends JaxbTypeItemLabelProvider<JaxbEnum>
-{
-
- public JaxbEnumItemLabelProvider(JaxbEnum jaxbEnum, ItemLabelProvider.Manager manager) {
- super(jaxbEnum, manager);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new JaxbEnumImageModel(this.item);
- }
-
-
- protected class JaxbEnumImageModel
- extends AspectPropertyValueModelAdapter<JaxbEnum, Image> {
-
- protected final PropertyValueModel<JaxbEnumMapping> mappingModel;
-
- protected final PropertyValueModel<Boolean> isXmlTransientModel;
-
- protected final PropertyChangeListener propertyChangeListener;
-
-
- public JaxbEnumImageModel(JaxbEnum subject) {
- super(new StaticPropertyValueModel<JaxbEnum>(subject));
- this.mappingModel = buildMappingModel();
- this.isXmlTransientModel = buildIsXmlTransientModel();
- this.propertyChangeListener = buildPropertyChangeListener();
- }
-
-
- protected PropertyValueModel<JaxbEnumMapping> buildMappingModel() {
- return new PropertyAspectAdapter<JaxbEnum, JaxbEnumMapping> (JaxbType.MAPPING_PROPERTY, JaxbEnumItemLabelProvider.this.item) {
- @Override
- protected JaxbEnumMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildIsXmlTransientModel() {
- return new PropertyAspectAdapter<JaxbEnumMapping, Boolean>(this.mappingModel, JaxbEnumMapping.XML_TRANSIENT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isXmlTransient());
- }
- };
- }
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- // transform the subject's property change events into VALUE property change events
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JaxbEnumImageModel.this.aspectChanged();
- }
- };
- }
-
- @Override
- protected Image buildValue_() {
- if (this.mappingModel.getValue() != null) {
- if (this.isXmlTransientModel.getValue() == Boolean.TRUE) {
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_TRANSIENT_ENUM);
- }
- }
- return JptJaxbUiPlugin.getImage(JptJaxbUiIcons.JAXB_ENUM);
- }
-
- @Override
- protected void engageSubject_() {
- this.mappingModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.mappingModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.isXmlTransientModel.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- }
- }
-}
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 37fc82362f..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPackageItemContentProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-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 AbstractItemTreeContentProvider<JaxbPackage, JaxbType> {
-
- public JaxbPackageItemContentProvider(JaxbPackage jaxbPackage, Manager manager) {
- super(jaxbPackage, manager);
- }
-
-
- public JaxbContextRoot getParent() {
- return (JaxbContextRoot) this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<JaxbType> buildChildrenModel() {
- return new CollectionAspectAdapter<JaxbContextRoot, JaxbType>(
- JaxbContextRoot.TYPES_COLLECTION, getParent()) {
- @Override
- protected Iterable<JaxbType> getIterable() {
- return this.subject.getTypes(JaxbPackageItemContentProvider.this.item);
- }
- };
- }
-}
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 0c1ee41d75..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbPersistentAttributeItemLabelProvider.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-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 class JaxbPersistentAttributeItemLabelProvider
- extends AbstractItemExtendedLabelProvider<JaxbPersistentAttribute>
-{
- protected final String text;
- protected final String description;
-
- public JaxbPersistentAttributeItemLabelProvider(JaxbPersistentAttribute attribute, ItemLabelProvider.Manager manager) {
- super(attribute, manager);
- this.text = this.buildText();
- this.description = this.buildDescription();
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new PropertyAspectAdapter<JaxbPersistentAttribute, Image>(IMAGE_ASPECT_NAMES, this.item) {
- @Override
- protected Image buildValue_() {
- return JaxbPersistentAttributeItemLabelProvider.this.buildImage(this.subject.getMappingKey());
- }
- };
- }
-
- protected Image buildImage(String mappingKey) {
- return JaxbMappingImageHelper.imageForAttributeMapping(mappingKey);
- }
-
- protected static final String[] IMAGE_ASPECT_NAMES = new String[] {
- JaxbPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY,
- JaxbPersistentAttribute.MAPPING_PROPERTY
- };
-
- @Override
- public String getText() {
- return this.text;
- }
-
- protected String buildText() {
- StringBuffer sb = new StringBuffer();
- if (this.item.isInherited()) {
- sb.append(this.item.getDeclaringJavaResourceType().getName());
- sb.append('.');
- }
- sb.append(this.item.getName());
- return sb.toString();
- }
-
- @Override
- public String getDescription() {
- return this.description;
- }
-
- protected String buildDescription() {
- return this.item.getName();
- }
-}
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 e08db985c7..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/jaxb21/JaxbTypeItemLabelProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.jaxb21;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-
-
-public abstract class JaxbTypeItemLabelProvider<I extends JaxbType>
- extends AbstractItemExtendedLabelProvider<I>
-{
- protected final String text;
- protected final String description;
-
- protected JaxbTypeItemLabelProvider(I jaxbType, ItemLabelProvider.Manager manager) {
- super(jaxbType, manager);
- this.text = this.buildText();
- this.description = this.buildDescription();
- }
-
- @Override
- public String getText() {
- return this.text;
- }
-
- protected String buildText() {
- return this.item.getTypeQualifiedName();
- }
-
- @Override
- public String getDescription() {
- return this.description;
- }
-
- protected String buildDescription() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.item.getFullyQualifiedName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(this.item.getResource().getFullPath().makeRelative());
- return 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/JaxbNavigatorActionProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorActionProvider.java
deleted file mode 100644
index b38d0d85a0..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorActionProvider.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.ui.internal.navigator;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jaxb.ui.internal.actions.OpenJaxbResourceAction;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionConstants;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonMenuConstants;
-
-
-public class JaxbNavigatorActionProvider
- extends CommonActionProvider {
-
- private OpenJaxbResourceAction openAction;
-
-
- public JaxbNavigatorActionProvider() {
- super();
- }
-
-
- @Override
- public void init(ICommonActionExtensionSite aConfig) {
- this.openAction = new OpenJaxbResourceAction();
- }
-
- @Override
- public void setContext(ActionContext aContext) {
- if (aContext != null && aContext.getSelection() instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) aContext.getSelection();
- this.openAction.selectionChanged(selection);
- }
-
- super.setContext(aContext);
- }
-
- @Override
- public void fillActionBars(IActionBars theActionBars) {
- if (this.openAction.isEnabled()) {
- theActionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, this.openAction);
- }
- }
-
- @Override
- public void fillContextMenu(IMenuManager aMenu) {
- if (getContext() == null || getContext().getSelection().isEmpty()) {
- return;
- }
-
- if (this.openAction.isEnabled()) {
- aMenu.insertAfter(ICommonMenuConstants.GROUP_OPEN, this.openAction);
- }
- }
-}
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 134eb9fd1a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorContentProvider.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.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.ui.internal.jface.NavigatorContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-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;
-
-/**
- * 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
- extends NavigatorContentProvider
-{
- 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();
- }
-
- @Override
- protected ItemTreeContentProviderFactory buildItemContentProviderFactory() {
- return new JaxbNavigatorTreeItemContentProviderFactory();
- }
-
- @Override
- protected ItemExtendedLabelProviderFactory buildItemLabelProviderFactory() {
- return new JaxbNavigatorItemLabelProviderFactory();
- }
-
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- super.inputChanged(viewer, oldInput, newInput);
- this.viewer = (StructuredViewer) viewer;
- }
-
- @Override
- protected 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;
- }
- }
- }
- return false;
- }
-
- @Override
- protected 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()};
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public void dispose() {
- super.dispose();
- JptJaxbCorePlugin.getProjectManager().removeCollectionChangeListener(JaxbProjectManager.JAXB_PROJECTS_COLLECTION, this.jaxbProjectListener);
- }
-
-
- // **************** member classes *****************************************
-
- /* CU 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;
- }
- };
- 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 fe25b2d926..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-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 ItemExtendedLabelProviderFactory {
-
- /**
- * 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, ItemExtendedLabelProviderFactory> delegates = new HashMap<JaxbPlatformDescription, ItemExtendedLabelProviderFactory>();
-
-
- public JaxbNavigatorItemLabelProviderFactory() {
- super();
- }
-
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
- ItemExtendedLabelProviderFactory delegate = getDelegate(item);
- if (delegate != null) {
- return delegate.buildProvider(item, manager);
- }
- return null;
- }
-
-
- private ItemExtendedLabelProviderFactory 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);
- ItemExtendedLabelProviderFactory 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/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 5c6f3979bd..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/navigator/JaxbNavigatorTreeItemContentProviderFactory.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.navigator;
-
-import java.util.HashMap;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-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 ItemTreeContentProviderFactory
-{
- /**
- * 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 HashMap<JaxbPlatformDescription, ItemTreeContentProviderFactory> delegates = new HashMap<JaxbPlatformDescription, ItemTreeContentProviderFactory>();
-
-
- public JaxbNavigatorTreeItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- ItemTreeContentProviderFactory delegate = getDelegate(item);
- if (delegate != null) {
- return delegate.buildProvider(item, manager);
- }
- return null;
- }
-
-
- private ItemTreeContentProviderFactory 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);
- ItemTreeContentProviderFactory 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 a7c219623c..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectModel.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.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.aspectChanged();
- }
-
- @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 dfd89c363b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbProjectPropertiesPage.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.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.IFacetedProject;
-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 LibraryInstallDelegate createLibraryInstallDelegate(IFacetedProject project, IProjectFacetVersion fv) {
- LibraryInstallDelegate lid = new LibraryInstallDelegate(project, fv);
- lid.addListener(buildLibraryProviderListener());
- return lid;
- }
-
- @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 */
- // default validation is OK
- }
-
-
- // ********** 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 7830ebd110..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/properties/JaxbSchemasPropertiesPage.java
+++ /dev/null
@@ -1,962 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.properties;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.Iterator;
-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.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.emf.common.util.URI;
-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.ModifiableCollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jaxb.core.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.SchemaEntry;
-import org.eclipse.jpt.jaxb.core.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.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 ModifiablePropertyValueModel<IProject> projectModel;
-
- private final PropertyValueModel<JaxbProject> jaxbProjectModel;
-
- protected final BufferedWritablePropertyValueModel.Trigger trigger;
-
- private final SchemasModel schemasModel;
-
- private final ModifiableCollectionValueModel<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.getAspectValue());
-
- // 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, Schema>(this.schemasSelectionModel) {
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(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.getAspectValue());
-
- // 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, Schema>(this.schemasSelectionModel) {
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(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) {
- // should *not* happen...
- Thread.currentThread().interrupt();
- 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, Collection<Schema>>
- 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 (SchemaEntry entry : this.subject.getSchemaLibrary().getSchemaEntries()) {
- schemas.add(new Schema(entry.getNamespace(), entry.getLocation()));
- }
- 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() {
- List<String> schemaLocations = new Vector<String>();
- for (Schema schema : this.schemas) {
- schemaLocations.add(schema.getLocation());
- }
- this.subject.getSchemaLibrary().setSchemaLocations(schemaLocations);
- }
-
- public void reset() {
- this.schemas.clear();
- if (this.subject != null) {
- this.schemas.addAll(buildSchemas_());
- }
- fireCollectionChanged(VALUES, getAspectValue());
- }
-
- 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(Collection<Schema> oldValue, Collection<Schema> newValue) {
- this.synchronizeCollection(newValue, new ArrayList<Schema>(oldValue), VALUES);
- }
-
- @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> getAspectValue() {
- 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> {
-
- static String locationDisplayString(String location) {
- if (location == null) {
- return StringTools.EMPTY_STRING;
- }
-
- URI uri = URI.createURI(location);
- if (uri.isPlatformResource()) {
- return uri.toPlatformString(false);
- }
-
- return location;
- }
-
- static String namespaceDisplayString(String namespace) {
- if (null == namespace || StringTools.EMPTY_STRING.equals(namespace)) {
- return JptJaxbUiMessages.SchemasPage_noNamespaceText;
- }
-
- return namespace;
- }
-
- Schema(String namespace, String location) {
- super();
- this.namespace = namespace;
- this.location = location;
- }
-
-
- private String namespace;
- final static String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
-
- private String location;
- final static String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
-
-
- String getNamespace() {
- return this.namespace;
- }
-
- void setNamespace(String namespace) {
- String old = this.namespace;
- this.namespace = namespace;
- firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
- }
-
- String namespaceDisplayString() {
- return namespaceDisplayString(this.namespace);
- }
-
- String getLocation() {
- return this.location;
- }
-
- String locationDisplayString() {
- return locationDisplayString(getLocation());
- }
-
- void setLocation(String location) {
- String old = this.location;
- this.location = location;
- firePropertyChanged(LOCATION_PROPERTY, old, location);
- }
-
- public int compareTo(Schema o) {
- return this.namespaceDisplayString().compareTo(o.namespaceDisplayString());
- }
- }
-
-
- 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 ModifiablePropertyValueModel<?>[] cellModels(Schema subject) {
- ModifiablePropertyValueModel<?>[] cellModels = new ModifiablePropertyValueModel<?>[COLUMN_COUNT];
- cellModels[NAMESPACE_COLUMN] = buildNamespaceCellModel(subject);
- cellModels[LOCATION_COLUMN] = buildLocationCellModel(subject);
- return cellModels;
- }
-
- private ModifiablePropertyValueModel<String> buildNamespaceCellModel(Schema subject) {
- return new PropertyAspectAdapter<Schema, String>(Schema.NAMESPACE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getNamespace();
- }
- };
- }
-
- private ModifiablePropertyValueModel<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).namespaceDisplayString();
- case SchemaColumnAdapter.LOCATION_COLUMN :
- return ((Schema) element).locationDisplayString();
- default :
- return null;
- }
- }
- }
-
-
- static class AddEditSchemaDialog
- extends TitleAreaDialog {
-
- private Schema currentSchema;
-
- private String defaultMessage;
-
- private final ModifiablePropertyValueModel<String> location;
-
- private final ModifiablePropertyValueModel<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(null);
- this.namespace.setValue(null);
- }
- 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(locationDisplayString());
- 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(locationDisplayString());
- }
- });
-
- 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(namespaceDisplayString());
- 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) {
- namespaceText.setText(namespaceDisplayString());
- }
- });
-
- Dialog.applyDialogFont(dialogArea);
-
- return dialogArea;
- }
-
- @Override
- public void create() {
- super.create();
-
- // disable ok button until user does something and then validation takes over
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
-
- @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(location);
-
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- String newNamespace =
- (schema == null) ?
- null
- : ((schema.getTargetNamespace()) == null ?
- StringTools.EMPTY_STRING
- : schema.getTargetNamespace());
- this.namespace.setValue(newNamespace);
- this.resolvedSchema = schema;
-
- validate();
- }
-
- public String getNamespace() {
- return this.namespace.getValue();
- }
-
- protected String namespaceDisplayString() {
- return Schema.namespaceDisplayString(getNamespace());
- }
-
- public String getLocation() {
- return this.location.getValue();
- }
-
- protected String locationDisplayString() {
- return Schema.locationDisplayString(getLocation());
- }
-
- 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"}); //$NON-NLS-1$
- 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(), false).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 88fe945dc9..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, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.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 ((IJavaElement) project.getAdapter(IJavaElement.class)).getJavaProject();
- }
-
- // ********** 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 a584b54d4a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorExtensionOptionsWizardPage.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jaxb.core.JaxbFacet;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-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;
-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;
-
-/**
- * ClassesGeneratorExtensionOptionsWizardPage
- */
-public class ClassesGeneratorExtensionOptionsWizardPage extends WizardPage
-{
- public static final String TARGET_OPTION = "-target "; //$NON-NLS-1$
-
- 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;
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- String facetVersion = this.getFacetVersion();
- if( ! StringTools.stringIsEmpty(facetVersion)) {
- if(StringTools.stringIsEmpty(this.additionalArgsComposite.getAdditionalArgs())) {
- this.additionalArgsComposite.setAdditionalArgs(TARGET_OPTION + facetVersion);
- }
- }
- };
-
- // ********** intra-wizard methods **********
-
- protected boolean allowsExtensions() {
- return this.additionalArgsComposite.allowsExtensions();
- }
-
- protected String getClasspath() {
- return this.additionalArgsComposite.getClasspath();
- }
-
- protected String getAdditionalArgs() {
- return this.additionalArgsComposite.getAdditionalArgs();
- }
-
- // ********** private methods **********
-
- private String getFacetVersion() {
- IProjectFacetVersion projectFacetVersion = this.getProjectFacetVersion();
- return (projectFacetVersion == null) ? null : projectFacetVersion.getVersionString();
- }
-
- private IProjectFacetVersion getProjectFacetVersion() {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(this.getProject());
- }
- catch(CoreException e) {
- JptJaxbUiPlugin.log(e);
- return null;
- }
- return (facetedProject == null) ? null : facetedProject.getProjectFacetVersion(JaxbFacet.FACET);
- }
-
- private IProject getProject() {
- return ((ClassesGeneratorWizard)this.getWizard()).getJavaProject().getProject();
- }
-
- // ********** ExtensionOptionsComposite **********
-
- 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();
- }
-
- protected void setAdditionalArgs(String argsString) {
- this.additionalArgsText.setText(argsString);
- }
-
- }
-}
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 c6931e1985..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorOptionsWizardPage.java
+++ /dev/null
@@ -1,770 +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.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 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 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.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.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 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 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 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 5218c0f4a5..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen;
-
-import java.util.List;
-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.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.IDialogConstants;
-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.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.common.ui.internal.wizards.JavaProjectWizardPage;
-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.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.core.xsd.XsdUtil;
-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.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl;
-import org.eclipse.xsd.XSDSchema;
-
-/**
- * ClassesGeneratorWizard
- */
-public class ClassesGeneratorWizard
- extends Wizard
- implements IWorkbenchWizard {
-
- private IJavaProject javaProject;
- private IFile preselectedXsdFile;
- 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, IFile xsdFile) {
- super();
- this.javaProject = javaProject;
- this.preselectedXsdFile = xsdFile;
- 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.selection.isEmpty()) {
- 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
- if (this.preselectedXsdFile == null) {
- this.preselectedXsdFile = SchemaWizardPage.getSourceSchemaFromSelection(this.selection);
- }
-
- if (this.preselectedXsdFile == null) {
- this.schemaWizardPage = new SchemaWizardPage(this.selection);
- this.addPage(this.schemaWizardPage);
- }
-
- 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 canFinish() {
- return this.settingsPage.isPageComplete()
- && this.optionsPage.isPageComplete()
- && this.extensionOptionsPage.isPageComplete();
- }
-
- @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 (displayOverwritingClassesWarning(this.generatorOptions)) {
- generateJaxbClasses();
- addSchemaToLibrary();
- }
- }
-
- return true;
- }
-
- // ********** intra-wizard methods **********
-
- public IJavaProject getJavaProject() {
- if(this.projectWizardPage != null) {
- this.javaProject = this.projectWizardPage.getJavaProject();
- }
- return this.javaProject;
- }
-
- /* may be null */
- private JaxbProject getJaxbProject() {
- return JptJaxbCorePlugin.getJaxbProject(getJavaProject().getProject());
- }
-
- /* return the physical location of the schema */
- public URI getLocalSchemaUri() {
- if (this.preselectedXsdFile != null) {
- return URI.createFileURI(this.preselectedXsdFile.getLocation().toString());
- }
- else if (this.schemaWizardPage != null) {
- return this.schemaWizardPage.getLocalSchemaURI();
- }
- return null;
- }
-
- /* return the uri or file platform resource uri used for schema resolution */
- public String getSchemaLocation() {
- if (this.preselectedXsdFile != null) {
- return URI.createPlatformResourceURI(this.preselectedXsdFile.getFullPath().toString(), false).toString();
- }
- else if (this.schemaWizardPage != null) {
- return this.schemaWizardPage.getSchemaLocation();
- }
- return null;
- }
-
-
- // ********** 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 || selection.isEmpty()) {
- 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 ClassesGeneratorWizardPage buildClassesGeneratorPage() {
- return new ClassesGeneratorWizardPage();
- }
-
- private ClassesGeneratorOptionsWizardPage buildClassesGeneratorOptionsPage() {
- return new ClassesGeneratorOptionsWizardPage();
- }
-
- private ClassesGeneratorExtensionOptionsWizardPage buildExtensionOptionsPage() {
- return new ClassesGeneratorExtensionOptionsWizardPage();
- }
-
- public IJavaProject getJavaProjectFrom(IProject project) {
- return ((IJavaElement) project.getAdapter(IJavaElement.class)).getJavaProject();
- }
-
- private boolean displayOverwritingClassesWarning(ClassesGeneratorOptions generatorOptions) {
-
- if( ! this.isOverridingClasses(generatorOptions)
- || !OptionalMessageDialog.isDialogEnabled(OverwriteConfirmerDialog.ID)) {
- return true;
- } else {
- OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.getShell());
- return dialog.open() == IDialogConstants.YES_ID;
- }
- }
-
- private boolean isOverridingClasses(ClassesGeneratorOptions generatorOptions) {
- if(generatorOptions == null) {
- throw new NullPointerException();
- }
- if(generatorOptions.showsVersion() || generatorOptions.showsHelp()) {
- return false;
- }
- return true;
- }
-
- 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.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 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()));
- }
- }
-
- private void generateJaxbClasses() {
- try {
- WorkspaceJob job =
- new GenerateJaxbClassesJob(
- this.getJavaProject(),
- this.getLocalSchemaUri().toString(),
- 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 addSchemaToLibrary() {
- JaxbProject jaxbProject = getJaxbProject();
-
- if (jaxbProject == null) {
- return;
- }
-
- String schemaLocation = getSchemaLocation();
- String resolvedUri = XsdUtil.getResolvedUri(schemaLocation);
- XSDSchema schema = XSDImpl.buildXSDModel(resolvedUri);
- if (schema != null) {
- SchemaLibrary schemaLib = jaxbProject.getSchemaLibrary();
- List<String> schemas = new Vector<String>(schemaLib.getSchemaLocations());
- if (! schemas.contains(schemaLocation)) {
- schemas.add(schemaLocation);
- schemaLib.setSchemaLocations(schemas);
- }
- }
- }
-
- protected void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorWizard_errorDialogTitle,
- message
- );
- }
-
- static class OverwriteConfirmerDialog extends OptionalMessageDialog {
-
- private static final String ID= "dontShowOverwriteJaxbClassesFromSchemas.warning"; //$NON-NLS-1$
-
- OverwriteConfirmerDialog(Shell parent) {
- super(ID, parent,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningTitle,
- JptJaxbUiMessages.ClassesGeneratorUi_generatingClassesWarningMessage,
- MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- }
-
- }
-
-}
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 762aea5275..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
+++ /dev/null
@@ -1,779 +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 java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-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.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstall2;
-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.dialogs.TrayDialog;
-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.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.gen.ClassesGenerator;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformGroupDescription;
-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.Shell;
-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 final String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.ui"; //$NON-NLS-1$
- static public final String XML_FILTER = "*.xml"; //$NON-NLS-1$
- static public final String[] bindingdFilesFilterExtensions = {".xjb",".xml",".xbd"}; //$NON-NLS-1$
- static public final JaxbPlatformGroupDescription ECLIPSELINK_PLATFORM_GROUP
- = JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatformGroup("eclipselink"); //$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;
- }
-
- private void setUsesMoxy(boolean usesMoxy){
- this.usesMoxy = usesMoxy;
- }
-
- // ********** 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)) {
- this.updateStatus(fContainerStatus);
- }
- else if( ! this.fPackageStatus.matches(IStatus.OK) ) {
- this.updateStatus(fPackageStatus);
- }
- else {
- this.updateStatus(Status.OK_STATUS);
- }
- this.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());
-
- if(this.projectPlatformIsJaxb()) {
- this.setUsesMoxy(this.projectJaxbPlatformIsEclipseLink());
- this.usesMoxyCheckBox.setVisible(false);
- }
- else {
- // default usesMoxy to true only when JPT EclipseLink bundle exists and MOXy is on the classpath
- this.setUsesMoxy((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 schemaName = ((ClassesGeneratorWizard) getWizard()).getLocalSchemaUri().lastSegment();
- this.setTitle(NLS.bind(JptJaxbUiMessages.ClassesGeneratorWizardPage_title, schemaName));
- }
- }
-
- /**
- * 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;
- }
-
- // ********** 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.horizontalIndent = 5;
- gridData.verticalIndent = 5;
- 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.eclipseLinkMoxyIsOnClasspath()) {
- //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);
-// }
-// }
- }
-
- /**
- * Test if the Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbIsOnClasspath() {
- if(this.genericJaxbNonJdkIsOnClasspath()) {
- return true;
- }
- else {
- if(this.projectJre15OrLower()) {
- return false;
- }
- else if(this.genericJaxbJdkIsOnClasspath()) {
- return true;
- }
- else {
- return this.toolsJarExists();
- }
- }
- }
-
- private boolean projectJre15OrLower() {
- try {
- IVMInstall vm = this.getVMInstall();
- if(vm == null) {
- return false;
- }
- if (vm instanceof IVMInstall2) {
- String javaVersion = ((IVMInstall2) vm).getJavaVersion();
- if(javaVersion != null) {
- String versionString = javaVersion.substring(0, javaVersion.lastIndexOf('.'));
- Float javaVersionNumber = Float.valueOf(versionString);
- if( javaVersionNumber <= 1.5) {
- return true;
- }
- }
- }
- return false;
- }
- catch (CoreException e) {
- return false;
- }
- }
-
- /**
- * Test if the JDK Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbJdkIsOnClasspath() {
- return ClassesGenerator.genericJaxbJdkIsOnClasspath(this.getJavaProject());
- }
-
- /**
- * Test if the non-JDK Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbNonJdkIsOnClasspath() {
- return ClassesGenerator.genericJaxbNonJdkIsOnClasspath(this.getJavaProject());
- }
-
- private boolean toolsJarExists() {
- return ClassesGenerator.toolsJarExists(this.getJavaProject());
- }
-
- private IVMInstall getVMInstall() throws CoreException {
- return ClassesGenerator.getVMInstall(this.getJavaProject());
- }
-
- /**
- * Test if the EclipseLink Jaxb compiler is on the classpath.
- */
- private boolean moxyIsOnClasspath() {
- try {
- IType genClass = this.getJavaProject().findType(ClassesGenerator.JAXB_ECLIPSELINK_GEN_CLASS);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- private boolean eclipseLinkMoxyIsOnClasspath() {
- return (this.moxyIsOnClasspath() && this.genericJaxbNonJdkIsOnClasspath());
- }
-
- private boolean projectPlatformIsJaxb() {
- return JptJaxbCorePlugin.getJaxbProject(this.getJavaProject().getProject()) != null;
- }
-
- private boolean projectJaxbPlatformIsEclipseLink() {
- JaxbPlatformDescription jaxbPlatform = JptJaxbCorePlugin.getJaxbPlatformDescription(this.getJavaProject().getProject());
- JaxbPlatformGroupDescription jaxbPlatformGroup = (jaxbPlatform == null) ? null : jaxbPlatform.getGroup();
- return jaxbPlatformGroup == ECLIPSELINK_PLATFORM_GROUP;
- }
-
- private void displayWarning(String message) {
- this.setMessage(message, WARNING);
- }
-
- // ********** inner class **********
-
- // ********** 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 button
- 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) {
- String filePath = addBindingsFileDialog();
- if( ! StringTools.stringIsEmpty(filePath)) {
- addBindingsFile(filePath, tableDataModel);
- tableViewer.refresh();
- }
- }
- });
- // Remove button
- 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 addBindingsFileDialog() {
- PromptBindingsFilesDialog dialog = new PromptBindingsFilesDialog(getShell());
-
- // opens the dialog - just returns if the user cancels it
- if(dialog.open() == Window.CANCEL) {
- return null;
- }
-
- String location = dialog.getLocation();
- return location;
- }
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(getJavaProject().getProject().getLocation());
- return relativePath.toOSString();
- }
-
- private void addBindingsFile(String relativePath, final ArrayList<String> tableDataModel) {
- 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 void addColumnsData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- }
-
- // ********** TableLabelProvider **********
-
- 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;
- }
- }
-
- // ********** TableContentProvider **********
-
- private class TableContentProvider implements IStructuredContentProvider {
-
- // ********** constructor **********
- TableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
-
- // ********** PromptBindingsFilesDialog **********
-
- private class PromptBindingsFilesDialog extends TrayDialog {
-
- private SelectFileOrXMLCatalogIdPanel locationPanel;
-
- private String location;
-
- // ********** constructor **********
- public PromptBindingsFilesDialog(Shell shell) {
- super(shell);
- }
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseABindingsFile);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- this.locationPanel = new SelectFileOrXMLCatalogIdPanel(composite, StructuredSelection.EMPTY);
- this.locationPanel.setFilterExtensions(bindingdFilesFilterExtensions);
- 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 = file.getProjectRelativePath().toOSString();
- }
- super.okPressed();
- }
-
- public String getLocation() {
- return this.location;
- }
- }
-} \ 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 cb1a1d6c0a..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SchemaWizardPage.java
+++ /dev/null
@@ -1,215 +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.emf.common.CommonPlugin;
-import org.eclipse.emf.common.util.URI;
-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 {
-
- protected static final String[] browseXSDFilterExtensions = {".xsd"}; //$NON-NLS-1$
-
- private final IStructuredSelection initialSelection;
- private IProject targetProject;
-
- protected SelectFileOrXMLCatalogIdPanel selectSourcePanel;
-
-
- // ********** 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.getSchemaFile() != null) {
- this.selectSourcePanel.setSingleFileViewDefaultSelection(new StructuredSelection(this.getSchemaFile()));
- }
- 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.fileOrXmlCatalogEntrySelected() && (this.getErrorMessage() == null);
- }
-
-
- // ********** intra-wizard methods **********
-
- /* return the file, if a file is selected */
- public IFile getSchemaFile() {
- return this.selectSourcePanel.getFile();
- }
-
- /* return xml catalog id, if a catalog entry is selected */
- public String getXMLCatalogId() {
- return this.selectSourcePanel.getXMLCatalogId();
- }
-
- /* return identifier of schema location, whether using file or xml catalog */
- public String getSchemaLocation() {
- IFile file = this.selectSourcePanel.getFile();
- if (file != null) {
- return URI.createPlatformResourceURI(file.getFullPath().toString(), false).toString();
- }
- return this.selectSourcePanel.getXMLCatalogId();
- }
-
- /* return local uri of schema, whether using file or xml catalog */
- public URI getLocalSchemaURI() {
- IFile file = this.selectSourcePanel.getFile();
- if (file != null) {
- return URI.createFileURI(file.getLocation().toString());
- }
-
- String uri = this.selectSourcePanel.getXMLCatalogURI();
- if (uri != null) {
- return CommonPlugin.asLocalURI(URI.createURI(uri));
- }
-
- return null;
- }
-
-
- // ********** 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 fileOrXmlCatalogEntrySelected() {
- return this.getSchemaFile() != null || this.getXMLCatalogId() != null;
- }
-
- private String computeErrorMessage() {
- String errorMessage = null;
- URI uri = this.getLocalSchemaURI();
- if (uri != null) {
- if (! URIHelper.isReadableURI(uri.toString(), 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 da4cdc8c87..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectFileOrXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,192 +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.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.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(JptJaxbUiMessages.SelectFileOrXMLCatalogIdPanel_fileFromWorkspace);
- 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(JptJaxbUiMessages.SelectFileOrXMLCatalogIdPanel_xmlCatalogEntry);
- 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);
- this.control = this.createControl(parent);
- this.overrideImportButtonText();
-
- this.control.setLayoutData(new GridData(GridData.FILL_BOTH));
- SelectFilePanel.this.setListener(this);
- }
-
- public Control getControl() {
- return this.control;
- }
-
- public void setControlComplete(boolean isComplete) {
- updateCompletionStateChange();
- }
-
- private void overrideImportButtonText() {
- this.importButton.setText(JptJaxbUiMessages.SelectFileOrXMLCatalogIdPanel_importButton);
- }
- }
-}
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 111684b49b..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/SelectXMLCatalogIdPanel.java
+++ /dev/null
@@ -1,145 +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 d2897cd77d..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java
+++ /dev/null
@@ -1,198 +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();
- }
-
- @Override
- protected void validatePage() {
- // done to prevent "orphan" pages from validating
- if (getWizard() == null) {
- return;
- }
-
- super.validatePage();
- }
-
- @Override
- protected void validatePage(boolean showMessage) {
- // done to prevent "orphan" pages from validating
- if (getWizard() == null) {
- return;
- }
-
- super.validatePage(showMessage);
- }
-
- 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 d6fcb911bf..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/NewSchemaFileWizardPage.java
+++ /dev/null
@@ -1,213 +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);
- }
-
- /**
- * @return the path of the schema file relative to the project
- */
- public IPath getFileRelativePath() {
- IPath filePath = this.getContainerFullPath();
- String projectName = filePath.segment(0);
-
- if(this.getProject().getName().equals(projectName)) {
- filePath = filePath.removeFirstSegments(1);
- }
- return filePath;
- }
-
- // ********** 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 67fb5ff2d2..0000000000
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceRuleFactory;
-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.ui.internal.util.SWTUtil;
-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.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-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());
-
- this.scheduleGenerateSchemaJob(sourceClassNames);
- return true;
- }
-
- protected void scheduleGenerateSchemaJob(String[] sourceClassNames) {
-
- WorkspaceJob genSchemaJob = new GenerateSchemaJob(
- this.targetProject,
- sourceClassNames,
- this.getTargetSchema(),
- this.usesMoxy());
- genSchemaJob.schedule();
-
-// Delaying the release of "open file" functionality (see bug 322567)
-// IPath schemaPath = this.newSchemaFileWizardPage.getContainerFullPath();
-// String schemaName = this.newSchemaFileWizardPage.getFileName();
-//
-// IContainer container = (IContainer)ResourcesPlugin.getWorkspace().getRoot().findMember(schemaPath);
-// IFile schemaFile = container.getFile(new Path(schemaName));
-//
-// OpenSchemaFileJob openSchemaFileJob = new OpenSchemaFileJob(
-// this.targetProject,
-// schemaFile);
-// openSchemaFileJob.schedule();
- }
-
- // ********** 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 = ((IJavaElement) project.getAdapter(IJavaElement.class)).getJavaProject();
- if(javaProject == null) {
- throw new RuntimeException("Not a Java Project"); //$NON-NLS-1$
- }
- return javaProject;
- }
-
- private String getTargetSchema() {
-
- IPath filePath = this.newSchemaFileWizardPage.getFileRelativePath();
- String fileName = this.newSchemaFileWizardPage.getFileName();
- String targetSchema = (filePath.isEmpty()) ?
- fileName :
- filePath.toOSString() + File.separator + fileName;
-
- return this.addXsdExtension(targetSchema);
- }
-
- private String addXsdExtension(String fileName) {
-
- return (FileTools.extension(fileName).equalsIgnoreCase(XSD_EXTENSION)) ?
- fileName :
- fileName + XSD_EXTENSION;
- }
-
- 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;
- }
- }
-
- // ********** open schema file job **********
-
- public static class OpenSchemaFileJob extends WorkspaceJob {
- private final IJavaProject javaProject;
- private final IFile schemaFile;
-
- public OpenSchemaFileJob(IJavaProject javaProject, IFile schemaFile) {
- super(JptJaxbUiMessages.SchemaGeneratorWizard_openSchemaFileJobName);
- this.javaProject = javaProject;
- this.schemaFile = schemaFile;
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- this.setRule(ruleFactory.modifyRule(this.javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- try {
- this.postGeneration(this.schemaFile);
- }
- catch (InvocationTargetException e) {
- throw new CoreException(new Status(IStatus.ERROR, JptJaxbUiPlugin.PLUGIN_ID, "error", e)); //$NON-NLS-1$
- }
- return Status.OK_STATUS;
- }
-
- private void postGeneration(IFile schemaFile) throws InvocationTargetException {
- try {
- this.openEditor(schemaFile);
- }
- catch (Exception cantOpen) {
- throw new InvocationTargetException(cantOpen);
- }
- }
-
- private void openEditor(final IFile file) {
- if(file != null) {
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- JptJaxbUiPlugin.log(e);
- }
- }
- });
- }
- }
- }
-} \ 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 7e5f1b6f6c..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, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.ui.navigator;
-
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-
-/**
- * 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 ItemTreeContentProvider}s
- */
- ItemTreeContentProviderFactory getTreeItemContentProviderFactory();
-
- /**
- * Return the factory to create {@link ItemLabelProvider}s
- */
- ItemExtendedLabelProviderFactory 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);
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath
deleted file mode 100644
index 76131ca132..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.classpath
+++ /dev/null
@@ -1,13 +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">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project
deleted file mode 100644
index bcbed7f5b7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core.tests</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/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 1284b5c67d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:07:36 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index c1ecd0d512..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/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.jaxb.core.tests;singleton:=true
-Bundle-Version: 1.2.0.qualifier
-Bundle-Localization: plugin
-Dali-Comment: jdk 1.6 has the javax.xml.bind annotations
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Activator: org.eclipse.jpt.jaxb.core.tests.JptJaxbCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.6.100,4.0.0)",
- org.eclipse.jdt.core;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.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.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.wst.common.frameworks;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.core;bundle-version="[1.4.200,2.0.0)",
- org.eclipse.xsd;bundle-version="[2.6.0,3.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.core.tests;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.projects;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jaxb.core.tests.internal.resource.java;x-internal:=true
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/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/tests/org.eclipse.jpt.jaxb.core.tests/build.properties b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties
deleted file mode 100644
index 9cd29bcb38..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/build.properties
+++ /dev/null
@@ -1,16 +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
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.properties
deleted file mode 100644
index 01a0b633cd..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/plugin.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
-################################################################################
-# ====================================================================
-# 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 Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.java
deleted file mode 100644
index 6fb339c26d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/JptJaxbCoreTestsPlugin.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.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * configure the core to handle events synchronously when we are
- * running tests
- */
-@SuppressWarnings("nls")
-public class JptJaxbCoreTestsPlugin extends Plugin {
-
- private static JptJaxbCoreTestsPlugin INSTANCE;
-
- public static JptJaxbCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbCoreTestsPlugin() {
- 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);
- JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.getProjectManager();
- ReflectionTools.executeMethod(jaxbProjectManager, "handleEventsSynchronously");
- ReflectionTools.executeStaticMethod(JaxbPreferencesManager.class, "doNotFlushPreferences");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.java
deleted file mode 100644
index 632df40d68..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbCoreTests.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.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbCoreContextModelTests;
-import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
-import org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTests;
-
-public class JaxbCoreTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreTests.class.getPackage().getName());
- suite.addTestSuite(SchemaLibraryTests.class);
- suite.addTest(JaxbCoreResourceModelTests.suite());
- suite.addTest(JaxbCoreContextModelTests.suite());
- return suite;
- }
-
- public static boolean requiredJarsExists() {
- return jaxbJarPropertyExists() && jaxbJarFileExists();
- }
-
- public static boolean jaxbJarPropertyExists() {
- return getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY) != null;
- }
-
- public static boolean jaxbJarFileExists() {
- return (new File(getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY))).exists();
- }
-
- public static String buildMissingJarErrorMessage() {
- if( ! jaxbJarPropertyExists()) {
- return errorMissingProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY);
- }
- return errorJarFileDoesNotExist(getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY));
- }
-
- /*********** private **********/
- private static String errorMissingProperty(String propertyName) {
- return "missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String propertyValue) {
- return "JAR file doesn't exist: \"" + propertyValue + "\"";
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
-
- private JaxbCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java
deleted file mode 100644
index a32117f964..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/JaxbTestCase.java
+++ /dev/null
@@ -1,82 +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.tests.internal;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-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.internal.facet.JaxbFacetDataModelProperties;
-import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProvider;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-
-public class JaxbTestCase
- extends AnnotationTestCase {
-
- protected static final String BASE_PROJECT_NAME = "JaxbTestProject";
-
- protected JaxbTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJaxbProject(BASE_PROJECT_NAME, autoBuild, buildJaxbFacetInstallConfig());
- }
-
- protected TestJaxbProject buildJaxbProject(
- String projectName, boolean autoBuild, IDataModel jaxbConfig)
- throws Exception {
- return TestJaxbProject.buildJaxbProject(projectName, autoBuild, jaxbConfig);
- }
-
- protected IDataModel buildJaxbFacetInstallConfig() {
- IDataModel config = DataModelFactory.createDataModel(new JaxbFacetInstallDataModelProvider());
- config.setProperty(IFacetDataModelProperties.FACET_VERSION, getProjectFacetVersion());
- config.setProperty(JaxbFacetDataModelProperties.PLATFORM, getPlatform());
- return config;
- }
-
- protected JaxbPlatformDescription getPlatform() {
- return JptJaxbCorePlugin.getDefaultPlatform(getProjectFacetVersion());
- }
-
- protected IProjectFacetVersion getProjectFacetVersion() {
- return JaxbFacet.VERSION_2_1;
- }
-
- @Override
- protected TestJaxbProject getJavaProject() {
- return (TestJaxbProject) super.getJavaProject();
- }
-
- protected JaxbProject getJaxbProject() {
- return this.getJavaProject().getJaxbProject();
- }
-
- protected JavaResourceAttribute getFieldNamed(JavaResourceType resourceType, String attributeName) {
- for (JavaResourceAttribute attribute : resourceType.getFields()) {
- if (attribute.getName().equals(attributeName)) {
- return attribute;
- }
- }
- return null;
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java
deleted file mode 100644
index eecf3ee5b2..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/SchemaLibraryTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal;
-
-import java.io.ByteArrayInputStream;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.jaxb.core.xsd.XsdSchema;
-
-
-
-public class SchemaLibraryTests
- extends JaxbTestCase {
-
- public SchemaLibraryTests(String name) {
- super(name);
- }
-
- // tests schema for namespace that is set in catalog, but not in project properties
- public void testUnsetNamespace() {
- String namespace = "http://www.w3.org/2001/XInclude";
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-
- // tests schema for registered uri that is set in project properties (namespace not registered in catalog)
- public void testSetRegisteredUriUnregisteredNamespace() {
- String namespace = "http://java.sun.com/xml/ns/persistence/orm";
-
- // set namespace in project properties\
- List<String> schemaLocations = new Vector<String>();
- schemaLocations.add("http://java.sun.com/xml/ns/persistence/orm_2_0.xsd");
- getJaxbProject().getSchemaLibrary().setSchemaLocations(schemaLocations);
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-
- // tests schema for registerd uri that is set in project properties (namespace already registered in catalog)
- public void testSetRegisteredUriRegisteredNamespace() {
- String namespace = "http://www.eclipse.org/eclipselink/xsds/persistence/orm";
-
- // set namespace in project properties\
- List<String> schemaLocations = new Vector<String>();
- schemaLocations.add("http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd");
- getJaxbProject().getSchemaLibrary().setSchemaLocations(schemaLocations);
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-
- // tests schema for unregistered uri that is set in project properties (local file)
- public void testSetUnregisterdUri() throws Exception {
- IFile schemaFile = getJaxbProject().getProject().getFile(new Path("customer.xsd"));
- String contents =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
- + "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
- + " targetNamespace=\"http://www.example.org/customer-example\">"
- + "</xs:schema>";
- schemaFile.create(new ByteArrayInputStream(contents.getBytes()), true, null);
-
- String namespace = "http://www.example.org/customer-example";
-
- // set namespace in project properties\
- List<String> schemaLocations = new Vector<String>();
- schemaLocations.add("platform:/resource/" + BASE_PROJECT_NAME + "/customer.xsd");
- getJaxbProject().getSchemaLibrary().setSchemaLocations(schemaLocations);
-
- // test initial load
- XsdSchema schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test cached load
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
-
- // test unload/reload
- schema.getXSDComponent().eResource().unload();
- schema = getJaxbProject().getSchemaLibrary().getSchema(namespace);
- assertNotNull(schema);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java
deleted file mode 100644
index 855a5ef20c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/GenericContextRootTests.java
+++ /dev/null
@@ -1,517 +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.tests.internal.context;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.TypeLiteral;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackage;
-import org.eclipse.jpt.jaxb.core.context.JaxbType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-
-
-@SuppressWarnings("nls")
-public class GenericContextRootTests
- extends JaxbContextModelTestCase {
-
- public GenericContextRootTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorOrder() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)",
- JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
-
- private ICompilationUnit createClassWithXmlTypeAndSuperclassNamed(final String superclassName) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + superclassName);
- }
- });
- }
-
- private ICompilationUnit createClassWithXmlTypeAndAttribute(
- final String attributeName, final String typeName) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("public " + typeName + " " + attributeName + ";" + CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createClassWithXmlTypeAndListAttribute(
- final String attributeName, final String typeName) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.List", JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("public List<" + typeName + "> " + attributeName + ";" + CR);
- sb.append(CR);
- }
- });
- }
-
- public void testGetPackages() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- Iterator<JaxbPackage> packages = this.getContextRoot().getPackages().iterator();
- assertEquals(1, this.getContextRoot().getPackagesSize());
- assertEquals(PACKAGE_NAME, packages.next().getName());
- assertFalse(packages.hasNext());
-
- //add an unannotated package-info.java and make sure it's not added to the root context node
- this.createUnannotatedPackageInfo("foo");
- packages = this.getContextRoot().getPackages().iterator();
- assertEquals(1, this.getContextRoot().getPackagesSize());
- assertEquals(PACKAGE_NAME, packages.next().getName());
- assertFalse(packages.hasNext());
-
- //annotate the package-info.java and test it's added to the root context node
- JavaResourcePackage fooResourcePackage = getJaxbProject().getJavaResourcePackage("foo");
- AnnotatedElement annotatedElement = this.annotatedElement(fooResourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericContextRootTests.this.addXmlAccessorTypeAnnotation(declaration, JAXB.XML_ACCESS_TYPE__PROPERTY);
- }
- });
-
- Iterable<String> packageNames = new TransformationIterable<JaxbPackage, String>(this.getContextRoot().getPackages()) {
- @Override
- protected String transform(JaxbPackage o) {
- return o.getName();
- }
- };
- assertEquals(2, this.getContextRoot().getPackagesSize());
- assertTrue(CollectionTools.contains(packageNames, PACKAGE_NAME));
- assertTrue(CollectionTools.contains(packageNames, "foo"));
-
- //remove the annotation from the package-info.java and test it's removed from the root context node
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericContextRootTests.this.removeXmlAccessorTypeAnnotation(declaration);
- }
- });
-
- packages = this.getContextRoot().getPackages().iterator();
- assertEquals(1, this.getContextRoot().getPackagesSize());
- assertEquals(PACKAGE_NAME, packages.next().getName());
- assertFalse(packages.hasNext());
- }
-
- protected void addXmlAccessorTypeAnnotation(ModifiedDeclaration declaration, String accessType) {
- NormalAnnotation annotation = this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_TYPE);
- addEnumMemberValuePair(annotation, JAXB.XML_ACCESSOR_TYPE__VALUE, accessType);
- }
-
- protected void removeXmlAccessorTypeAnnotation(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE);
- }
-
- protected void addXmlSeeAlsoAnnotation(final ModifiedDeclaration declaration, String... typeNames) {
- Annotation annotation = declaration.getAnnotationNamed(JAXB.XML_SEE_ALSO);
- NormalAnnotation normalAnnotation = null;
- if (annotation == null) {
- normalAnnotation = addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_SEE_ALSO);
- }
- else if (annotation.isMarkerAnnotation()) {
- normalAnnotation = replaceMarkerAnnotation((MarkerAnnotation) annotation);
- }
- else {
- normalAnnotation = (NormalAnnotation) annotation;
- }
-
- Expression arrayInitializer = newArrayInitializer(
- declaration.getAst(),
- ArrayTools.array(
- new TransformationIterable<String, TypeLiteral>(new ArrayIterable<String>(typeNames)) {
- @Override
- protected TypeLiteral transform(String o) {
- return newTypeLiteral(declaration.getAst(), o);
- }
- },
- new Expression[0]));
- addMemberValuePair(normalAnnotation, JAXB.XML_SEE_ALSO__VALUE, arrayInitializer);
- }
-
- public void testGetRegistries() throws Exception {
- createClassWithXmlRegistry();
- Iterable<JaxbType> types = getContextRoot().getTypes();
- assertEquals(1, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
-
- //add an unannotated class and make sure it's not added to the context root
- createUnannotatedClassNamed("Foo");
- types = getContextRoot().getTypes();
- assertEquals(1, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
-
- //annotate the class with @XmlRegistry and test it's added to the root context node
- JavaResourceAbstractType fooResourceType = getJaxbProject().getJavaResourceType("test.Foo");
- AnnotatedElement annotatedElement = annotatedElement(fooResourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_REGISTRY);
- }
- });
-
- types = getContextRoot().getTypes();
- assertEquals(2, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType("test.Foo")).getXmlRegistry());
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
-
- //remove the annotation from the class and test it's removed from the context root
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_REGISTRY);
- }
- });
-
- types = getContextRoot().getTypes();
- assertEquals(1, CollectionTools.size(types));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)).getXmlRegistry());
- }
-
- public void testGetTypes() throws Exception {
- createClassWithXmlType();
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
-
- //add an unannotated class and make sure it's not added to the context root
- createUnannotatedClassNamed("Foo");
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
-
- //annotate the class with @XmlType and test it's added to the context root
- JavaResourceAbstractType fooResourceType = getJaxbProject().getJavaResourceType("test.Foo");
- AnnotatedElement annotatedElement = annotatedElement(fooResourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNotNull(((JaxbClass) getContextRoot().getType("test.Foo")));
-
- //remove the annotation from the class and test it's removed from the root context node
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_TYPE);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbClass) getContextRoot().getType("test.Foo")));
- }
-
- public void testGetTypes2() throws Exception {
- createEnumWithXmlType();
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
-
- //add an unannotated class and make sure it's not added to the context root
- createUnannotatedEnumNamed("Foo");
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbEnum) getContextRoot().getType("test.Foo")));
-
- //annotate the class with @XmlEnum and test it's added to the context root
- JavaResourceEnum fooResourceType = (JavaResourceEnum) getJaxbProject().getJavaResourceType("test.Foo", JavaResourceAbstractType.Kind.ENUM);
- AnnotatedElement annotatedElement = annotatedElement(fooResourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNotNull(((JaxbEnum) getContextRoot().getType("test.Foo")));
-
- //remove the annotation from the class and test it's removed from the root context node
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_TYPE);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbEnum) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbEnum) getContextRoot().getType("test.Foo")));
- }
-
- public void testDirectReferencedSuperclass() throws Exception {
- String superclassName = "Super" + TYPE_NAME;
- String fqSuperclassName = PACKAGE_NAME_ + superclassName;
- createUnannotatedClassNamed(superclassName);
-
- // make sure unannotated superclass is not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlTypeAndSuperclassNamed(superclassName);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNotNull(((JaxbClass) getContextRoot().getType(fqSuperclassName)));
-
- // remove annotated class - both classes removed from context
- IFile file = (IFile) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME).getResource();
- file.delete(true, null);
-
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
- assertNull(((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME)));
- assertNull(((JaxbClass) getContextRoot().getType(fqSuperclassName)));
- }
-
- public void testDirectReferencedAttribute() throws Exception {
- String otherClassName = "Other" + TYPE_NAME;
- String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- String attributeName = "other";
- createUnannotatedClassNamed(otherClassName);
-
- // make sure unannotated other class is not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlTypeAndAttribute(attributeName, otherClassName);
- JavaResourceType thisType = (JavaResourceType) getJaxbProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceAttribute attribute = getFieldNamed(thisType, attributeName);
- AnnotatedElement annotatedAttribute = annotatedElement(attribute);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // add an @XmlElement
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to @XmlTransient
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_ELEMENT);
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNull(getContextRoot().getType(fqOtherClassName));
- }
-
- public void testDirectReferencedListAttribute() throws Exception {
- String otherClassName = "Other" + TYPE_NAME;
- String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- String attributeName = "other";
- createUnannotatedClassNamed(otherClassName);
-
- // make sure unannotated other class is not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlTypeAndListAttribute(attributeName, otherClassName);
- JavaResourceType thisType = (JavaResourceType) getJaxbProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceAttribute attribute = getFieldNamed(thisType, attributeName);
- AnnotatedElement annotatedAttribute = annotatedElement(attribute);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // add an @XmlElement
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to @XmlTransient
- annotatedAttribute.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_ELEMENT);
- addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNull(getContextRoot().getType(fqOtherClassName));
- }
-
- public void testDirectReferencedSeeAlso() throws Exception {
- final String otherClassName = "Other" + TYPE_NAME;
- final String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- final String otherClassName2 = "Other" + TYPE_NAME + "2";
- final String fqOtherClassName2 = PACKAGE_NAME_ + otherClassName2;
- createUnannotatedClassNamed(otherClassName);
- createUnannotatedClassNamed(otherClassName2);
-
- // make sure unannotated other classes are not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlType();
- JavaResourceType thisType = (JavaResourceType) getJaxbProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- AnnotatedElement annotatedType = annotatedElement(thisType);
-
- // make sure unannotated other classes are not in context
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
-
- // add an @XmlSeeAlso with one class
- annotatedType.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- addXmlSeeAlsoAnnotation(declaration, otherClassName);
- }
- });
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to @XmlSeeAlso with two classes
- annotatedType.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_SEE_ALSO);
- addXmlSeeAlsoAnnotation(declaration, otherClassName, otherClassName2);
- }
- });
-
- assertEquals(3, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
- assertNotNull(getContextRoot().getType(fqOtherClassName2));
-
- // remove the @XmlSeeAlso annotation
- annotatedType.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- removeAnnotation(declaration, JAXB.XML_SEE_ALSO);
- }
- });
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- }
-
- public void testJaxbIndex() throws Exception {
- final String otherClassName = "Other" + TYPE_NAME;
- final String fqOtherClassName = PACKAGE_NAME_ + otherClassName;
- final String otherClassName2 = "Other" + TYPE_NAME + "2";
- final String fqOtherClassName2 = PACKAGE_NAME_ + otherClassName2;
- createUnannotatedClassNamed(otherClassName);
- createUnannotatedClassNamed(otherClassName2);
-
- // make sure unannotated other classes are not in context
- assertTrue(CollectionTools.isEmpty(getContextRoot().getTypes()));
-
- createClassWithXmlType();
-
- // make sure unannotated other classes are not in context
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
-
- // add a jaxb.index with one class
- IFile jaxbIndex = getJavaProject().getProject().getFile(new Path("src/test/jaxb.index"));
- InputStream stream = new ByteArrayInputStream(otherClassName.getBytes());
- jaxbIndex.create(stream, true, null);
-
- assertEquals(2, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
-
- // change to jaxb.index with two classes
- jaxbIndex.setContents(new ByteArrayInputStream((otherClassName + CR + otherClassName2).getBytes()), true, false, null);
-
- assertEquals(3, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- assertNotNull(getContextRoot().getType(fqOtherClassName));
- assertNotNull(getContextRoot().getType(fqOtherClassName2));
-
- // clear the jaxb.index
- jaxbIndex.setContents(new ByteArrayInputStream(new byte[0]), true, false, null);
-
- assertEquals(1, CollectionTools.size(getContextRoot().getTypes()));
- assertNotNull(getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME));
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java
deleted file mode 100644
index 9eeb39279b..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbContextModelTestCase.java
+++ /dev/null
@@ -1,98 +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.tests.internal.context;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.JaxbTestCase;
-
-@SuppressWarnings("nls")
-public abstract class JaxbContextModelTestCase
- extends JaxbTestCase {
-
- protected static final String BASE_PROJECT_NAME = "JaxbContextModelTestProject";
-
-
- protected JaxbContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJaxbProject(BASE_PROJECT_NAME, autoBuild, buildJaxbFacetInstallConfig());
- }
-
- protected JaxbContextRoot getContextRoot() {
- return this.getJaxbProject().getContextRoot();
- }
-
- protected AnnotatedElement annotatedElement(JavaResourceAnnotatedElement resource) {
- return (AnnotatedElement) ReflectionTools.getFieldValue(resource, "annotatedElement");
- }
-
- protected ICompilationUnit createUnannotatedPackageInfo(String packageName) throws CoreException {
- return createTestPackageInfo(packageName);
- }
-
- protected ICompilationUnit createClassWithXmlType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- protected ICompilationUnit createClassWithXmlRegistry() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
- });
- }
-
- protected ICompilationUnit createUnannotatedClassNamed(String typeName) throws Exception {
- return this.createTestType(PACKAGE_NAME, typeName + ".java", typeName, new DefaultAnnotationWriter());
- }
-
- protected ICompilationUnit createEnumWithXmlType() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- protected ICompilationUnit createUnannotatedEnumNamed(String enumName) throws Exception {
- return this.createTestEnum(PACKAGE_NAME, enumName + ".java", enumName, new DefaultEnumAnnotationWriter());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java
deleted file mode 100644
index 4d72349d16..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/JaxbCoreContextModelTests.java
+++ /dev/null
@@ -1,40 +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.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.core.tests.internal.JaxbCoreTests;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.java.JaxbCoreJavaContextModelTests;
-
-public class JaxbCoreContextModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreContextModelTests.class.getName());
-
- if (JaxbCoreTests.requiredJarsExists()) {
- suite.addTestSuite(GenericContextRootTests.class);
- suite.addTest(JaxbCoreJavaContextModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JaxbCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
-
- private JaxbCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java
deleted file mode 100644
index 3d2a980510..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaAttributeXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaAttributeXmlJavaTypeAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ATTRIBUTE, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute").append(CR);
- sb.append("@XmlJavaTypeAdapter");
- }
- });
- }
-
- public void testModifyValue() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- contextXmlJavaTypeAdapter.setValue("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getValue());
- assertEquals("foo", contextXmlJavaTypeAdapter.getValue());
-
- //verify the xml schema type annotation is not removed when the value is set to null
- contextXmlJavaTypeAdapter.setValue(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getValue());
- assertNull(contextXmlJavaTypeAdapter.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- //add a value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- }
-
- public void testModifyType() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertEquals("int", contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getType());
- assertEquals("int", contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
- }
-
- public void testUpdateType() throws Exception {
- createClassWithXmlTypeAndAttributeXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = attributeMapping.getXmlJavaTypeAdapter();
- JavaResourceAttribute resourceAttribute = attributeMapping.getJavaResourceAttribute();
-
- assertEquals("int", contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("String", contextXmlJavaTypeAdapter.getType());
- assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaAttributeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- }
-
- protected void addXmlJavaTypeAdapterTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlJavaTypeAdapterMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration), name, value);
- }
-
- protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java
deleted file mode 100644
index 8cf435e871..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaClassMappingTests.java
+++ /dev/null
@@ -1,2142 +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.tests.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.internal.context.java.PropertyAccessor;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaClassMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaClassMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createXmlTypeWithAccessorType() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlAccessorType(value = XmlAccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createXmlTypeWithAccessorOrder() throws CoreException {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)");
- }
- });
- }
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- private void createTestXmlTypeWithFieldAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public int foo;").append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertyAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return 1;").append(CR).append(" }").append(CR);
- sb.append(" public void setFoo(int foo) {}").append(CR).append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertyGetterAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return 1;").append(CR).append(" }").append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertyGetterListAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public List<?> getFoo() {").append(CR);
- sb.append(" return 1;").append(CR).append(" }").append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- private void createTestXmlTypeWithPropertySetterAndPublicMemberAccess() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TYPE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_ATTRIBUTE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JAXB.XML_TRANSIENT);
- sb.append(";");
- sb.append(CR);
- sb.append("import java.util.List;");
- sb.append(CR);
- sb.append("@XmlType");
- sb.append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" ");
- sb.append("{").append(CR);
- sb.append(" public void setFoo(int foo) {}").append(CR).append(CR);
- sb.append(CR).append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestType.java", sourceWriter);
- }
-
- public void testModifyFactoryClass() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getSpecifiedFactoryClass());
- assertEquals(JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS, classMapping.getFactoryClass());
-
- classMapping.setSpecifiedFactoryClass("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryClass());
- assertEquals("foo", classMapping.getFactoryClass());
-
- classMapping.setSpecifiedFactoryClass(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryClass());
- assertNull(classMapping.getSpecifiedFactoryClass());
- assertEquals(JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS, classMapping.getFactoryClass());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set factoryClass again, this time starting with no XmlType annotation
- classMapping.setSpecifiedFactoryClass("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryClass());
- assertEquals("foo", classMapping.getFactoryClass());
- }
-
- public void testUpdateFactoryClass() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getSpecifiedFactoryClass());
- assertEquals(JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS, classMapping.getFactoryClass());
-
- //add a factoryClass member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeTypeMemberValuePair(declaration, JAXB.XML_TYPE__FACTORY_CLASS, "Foo");
- }
- });
- assertEquals("Foo", classMapping.getFactoryClass());
-
- //remove the factoryClass member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getSpecifiedFactoryClass());
- assertEquals(JAXB.XML_TYPE__DEFAULT_FACTORY_CLASS, classMapping.getFactoryClass());
- }
-
- public void testModifyFactoryMethod() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getFactoryMethod());
-
- classMapping.setFactoryMethod("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryMethod());
- assertEquals("foo", classMapping.getFactoryMethod());
-
- classMapping.setFactoryMethod(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryMethod());
- assertNull(classMapping.getFactoryMethod());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set factoryMethod again, this time starting with no XmlType annotation
- classMapping.setFactoryMethod("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getFactoryMethod());
- assertEquals("foo", classMapping.getFactoryMethod());
- }
-
- public void testUpdateFactoryMethod() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getFactoryMethod());
-
- //add a factoryMethod member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__FACTORY_METHOD, "foo");
- }
- });
- assertEquals("foo", classMapping.getFactoryMethod());
-
- //remove the factoryMethod member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getFactoryMethod());
- }
-
- public void testModifySchemaTypeName() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
-
- classMapping.getQName().setSpecifiedName("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", classMapping.getQName().getSpecifiedName());
- assertEquals("foo", classMapping.getQName().getName());
-
- classMapping.getQName().setSpecifiedName(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getName());
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set name again, this time starting with no XmlType annotation
- classMapping.getQName().setSpecifiedName("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", classMapping.getQName().getSpecifiedName());
- assertEquals("foo", classMapping.getQName().getName());
- }
-
- public void testUpdateSchemaTypeName() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAME, "foo");
- }
- });
- assertEquals("foo", classMapping.getQName().getSpecifiedName());
- assertEquals("foo", classMapping.getQName().getName());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, classMapping.getQName().getName());
- }
-
- public void testModifyNamespace() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getDefaultNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
-
- classMapping.getQName().setSpecifiedNamespace("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", classMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", classMapping.getQName().getNamespace());
-
- classMapping.getQName().setSpecifiedNamespace(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getNamespace());
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
-
- //add another annotation so that the context model does not get blown away
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- resourceType.removeAnnotation(JAXB.XML_TYPE);
-
- //set namespace again, this time starting with no XmlType annotation
- classMapping.getQName().setSpecifiedNamespace("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", classMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", classMapping.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getDefaultNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", classMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", classMapping.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaClassMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaClassMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(classMapping.getQName().getSpecifiedNamespace());
- assertEquals("", classMapping.getQName().getNamespace());
- }
-
- public void testModifyAccessType() throws Exception {
- createXmlTypeWithAccessorType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessType.PROPERTY, classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.FIELD, classMapping.getAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.NONE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.NONE, classMapping.getAccessType());
-
- classMapping.setSpecifiedAccessType(null);
- accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertNull(accessorTypeAnnotation.getValue());
- assertNull(classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
- }
-
- public void testUpdateAccessType() throws Exception {
- createXmlTypeWithAccessorType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessType.PROPERTY, classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
-
- //set the accesser type value to FIELD
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__FIELD);
- }
- });
- assertEquals(XmlAccessType.FIELD, classMapping.getAccessType());
-
- //set the accesser type value to PUBLIC_MEMBER
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- }
- });
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
-
- //set the accesser type value to NONE
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__NONE);
- }
- });
- assertEquals(XmlAccessType.NONE, classMapping.getAccessType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE);
- }
- });
- assertNull(classMapping.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, classMapping.getDefaultAccessType());
- }
-
- /**
- * 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.
- */
- public void testGetDefaultAccessType() throws Exception {
- createClassWithXmlType();
- createTestSubType();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbClass childJaxbClass = (JaxbClass) getContextRoot().getType("test.AnnotationTestTypeChild");
- JaxbClassMapping childClassMapping = childJaxbClass.getMapping();
-
- assertEquals(XmlAccessType.PUBLIC_MEMBER, childClassMapping.getDefaultAccessType());
-
- this.createPackageInfoWithAccessorType();
- assertEquals(XmlAccessType.PROPERTY, childClassMapping.getDefaultAccessType());
-
- classMapping.setSpecifiedAccessType(XmlAccessType.FIELD);
- assertEquals(XmlAccessType.FIELD, childClassMapping.getDefaultAccessType());
-
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- classMapping.setSpecifiedAccessType(null);
- assertEquals(XmlAccessType.PROPERTY, childClassMapping.getDefaultAccessType());
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- assertEquals(XmlAccessType.FIELD, childClassMapping.getDefaultAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.NONE);
- assertEquals(XmlAccessType.NONE, childClassMapping.getDefaultAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(null);
- assertEquals(XmlAccessType.PUBLIC_MEMBER, childClassMapping.getDefaultAccessType());
- }
-
- public void testGetSuperPersistentClass() throws Exception {
- createClassWithXmlType();
- createTestSubType();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbClass childJaxbClass = (JaxbClass) getContextRoot().getType("test.AnnotationTestTypeChild");
- JaxbClassMapping childClassMapping = childJaxbClass.getMapping();
-
- assertEquals(classMapping, childClassMapping.getSuperclass());
-
- //test that the superClass is not null even when it is unannotated
- AnnotatedElement annotatedElement = this.annotatedElement(jaxbClass.getJavaResourceType());
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_TYPE);
- }
- });
- assertEquals(classMapping, childClassMapping.getSuperclass());
- }
-
- public void testModifyAccessOrder() throws Exception {
- createXmlTypeWithAccessorOrder();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
-
- classMapping.setSpecifiedAccessOrder(XmlAccessOrder.UNDEFINED);
- XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED, accessorOrderAnnotation.getValue());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
-
- classMapping.setSpecifiedAccessOrder(null);
- accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNull(accessorOrderAnnotation.getValue());
- assertNull(classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
- }
-
- public void testUpdateAccessOrder() throws Exception {
- createXmlTypeWithAccessorOrder();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
-
- //set the access order value to UNDEFINED
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER__UNDEFINED);
- }
- });
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_ORDER);
- }
- });
- assertNull(classMapping.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, classMapping.getDefaultAccessOrder());
- }
-
- public void testGetPropOrder() throws Exception {
- this.createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- ListIterator<String> props = classMapping.getPropOrder().iterator();
- assertFalse(props.hasNext());
-
- //add 2 prop orders
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addProp(declaration, 0, "bar");
- GenericJavaClassMappingTests.this.addProp(declaration, 1, "foo");
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertEquals("bar", props.next());
- assertEquals("foo", props.next());
- assertFalse(props.hasNext());
- }
-
- protected void addProp(ModifiedDeclaration declaration, int index, String prop) {
- this.addArrayElement(declaration, JAXB.XML_TYPE, index, JAXB.XML_TYPE__PROP_ORDER, this.newStringLiteral(declaration.getAst(), prop));
- }
-
- public void testGetPropOrderSize() throws Exception {
- this.createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(0, classMapping.getPropOrderSize());
-
- //add 2 prop orders
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addProp(declaration, 0, "bar");
- GenericJavaClassMappingTests.this.addProp(declaration, 1, "foo");
- }
- });
- assertEquals(2, classMapping.getPropOrderSize());
- }
-
- public void testAddProp() throws Exception {
- this.createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(0, "foo");
- classMapping.addProp(0, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- ListIterator<String> props = xmlTypeAnnotation.getPropOrder().iterator();
-
- assertEquals("baz", props.next());
- assertEquals("foo", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
- }
-
- public void testAddProp2() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(1, "foo");
- classMapping.addProp(0, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- ListIterator<String> props = xmlTypeAnnotation.getPropOrder().iterator();
-
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertEquals("foo", props.next());
- assertFalse(props.hasNext());
- }
-
- public void testRemoveProp() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(1, "foo");
- classMapping.addProp(2, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
-
- classMapping.removeProp(1);
-
- ListIterator<String> resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("bar", resourceProps.next());
- assertEquals("baz", resourceProps.next());
- assertFalse(resourceProps.hasNext());
-
- classMapping.removeProp(1);
- resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("bar", resourceProps.next());
- assertFalse(resourceProps.hasNext());
-
- classMapping.removeProp(0);
- resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertFalse(resourceProps.hasNext());
- }
-
- public void testMoveProp() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- classMapping.addProp(0, "bar");
- classMapping.addProp(1, "foo");
- classMapping.addProp(2, "baz");
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
-
- assertEquals(3, xmlTypeAnnotation.getPropOrderSize());
-
- classMapping.moveProp(2, 0);
- ListIterator<String> props = classMapping.getPropOrder().iterator();
- assertEquals("foo", props.next());
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
- ListIterator<String> resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("foo", resourceProps.next());
- assertEquals("baz", resourceProps.next());
- assertEquals("bar", resourceProps.next());
-
- classMapping.moveProp(0, 1);
- props = classMapping.getPropOrder().iterator();
- assertEquals("baz", props.next());
- assertEquals("foo", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
- resourceProps = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("baz", resourceProps.next());
- assertEquals("foo", resourceProps.next());
- assertEquals("bar", resourceProps.next());
- }
-
- public void testSyncProps() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- ListIterator<String> props = classMapping.getPropOrder().iterator();
- assertFalse(props.hasNext());
-
- //add 3 prop orders
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addProp(declaration, 0, "bar");
- GenericJavaClassMappingTests.this.addProp(declaration, 1, "foo");
- GenericJavaClassMappingTests.this.addProp(declaration, 2, "baz");
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("bar", props.next());
- assertEquals("foo", props.next());
- assertEquals("baz", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.moveProp(declaration, 2, 0);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("foo", props.next());
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.moveProp(declaration, 0, 1);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("baz", props.next());
- assertEquals("foo", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeProp(declaration, 1);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("baz", props.next());
- assertEquals("bar", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeProp(declaration, 1);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertTrue(props.hasNext());
- assertEquals("baz", props.next());
- assertFalse(props.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeProp(declaration, 0);
- }
- });
-
- props = classMapping.getPropOrder().iterator();
- assertFalse(props.hasNext());
- }
-
- protected void addXmlTypeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlTypeAnnotation(declaration), name, value);
- }
-
- protected void addXmlTypeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlTypeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlTypeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_TYPE);
- }
-
- protected void moveProp(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) getXmlTypeAnnotation(declaration), JAXB.XML_TYPE__PROP_ORDER, targetIndex, sourceIndex);
- }
-
- protected void removeProp(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) getXmlTypeAnnotation(declaration), JAXB.XML_TYPE__PROP_ORDER, index);
- }
-
- public void testModifyXmlRootElement() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getXmlRootElement());
-
- classMapping.addXmlRootElement().getQName().setSpecifiedName("foo");
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", xmlRootElementAnnotation.getName());
- assertEquals("foo", classMapping.getXmlRootElement().getQName().getName());
-
- classMapping.removeXmlRootElement();
- xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation);
- assertNull(classMapping.getXmlRootElement());
- }
-
- public void testUpdateXmlRootElement() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(classMapping.getXmlRootElement());
-
- //add a XmlRootElement annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = GenericJavaClassMappingTests.this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ROOT_ELEMENT);
- GenericJavaClassMappingTests.this.addMemberValuePair(annotation, JAXB.XML_ROOT_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", classMapping.getXmlRootElement().getQName().getName());
-
- //remove the XmlRootElement annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(classMapping.getXmlRootElement());
- }
-
- public void testUpdateFieldAttributes() throws Exception {
- this.createTestXmlTypeWithFieldAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public int foo;
- publicFieldTest(classMapping);
-
- //public transient int foo;
- publicTransientFieldTest(classMapping);
-
- //public static int foo;
- publicStaticFieldTest(classMapping);
-
- //public final int foo;
- publicFinalFieldTest(classMapping);
-
- //public static final int foo;
- publicStaticFinalFieldTest(classMapping);
-
- //private int foo;
- privateFieldTest(classMapping);
-
- // private transient int foo;
- privateTransientFieldTest(classMapping);
-
- // @XmlAttribute
- // private static int foo; //persistent
- privateStaticFieldTest(classMapping);
-
- // @XmlAttribute
- // private static final int foo; //persistent
- privateStaticFinalFieldTest(classMapping);
- }
-
- protected void publicFieldTest(JaxbClassMapping classMapping) {
- //public int foo; PUBLIC_MEMBER access - persistent
- assertEquals(1, classMapping.getAttributesSize());
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int foo; //PROPERTY access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int foo; //FIELD access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int foo; //NONE access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int foo; PUBLIC_MEMBER access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //add @XmlTransient annotation and test each access type
- JavaResourceField resourceField = (JavaResourceField) classMapping.getAttributes().iterator().next().getJavaResourceAttribute();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT);
- }
- });
- //@XmlTransient
- //public int foo; //PROPERTY access - not "persistent", but comes in to our context model because it is "mapped"
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlTransient
- //public int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlTransient
- //public int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlTransient
- //public int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_TRANSIENT);
- }
- });
- }
-
- protected void publicTransientFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public transient int foo; PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceField, ModifierKeyword.TRANSIENT_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public transient int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- this.removeModifiers(resourceField, ModifierKeyword.TRANSIENT_KEYWORD);
- }
-
- protected void publicStaticFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public static int foo; PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- this.removeModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD);
- }
-
- protected void publicFinalFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public final int foo; PUBLIC_MEMBER access - persistent
- this.addModifiers(resourceField, ModifierKeyword.FINAL_KEYWORD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public final int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public final int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public final int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public final int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- this.removeModifiers(resourceField, ModifierKeyword.FINAL_KEYWORD);
- }
-
- protected void publicStaticFinalFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
-
- //public static final int foo; PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD, ModifierKeyword.FINAL_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static final int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- this.removeModifiers(resourceField, ModifierKeyword.STATIC_KEYWORD, ModifierKeyword.FINAL_KEYWORD);
- }
-
- protected void privateFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD);
-
- //private int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //private int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- protected void privateTransientFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.TRANSIENT_KEYWORD);
-
- //private transient int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private transient int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private transient int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private transient int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private transient int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private transient int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.TRANSIENT_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- protected void privateStaticFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD);
-
- //private static int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private static int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- protected void privateStaticFinalFieldTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- JavaResourceField resourceField = (JavaResourceField) attributes.next().getJavaResourceAttribute();
- removeModifiers(resourceField, ModifierKeyword.PUBLIC_KEYWORD);
- addModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD, ModifierKeyword.FINAL_KEYWORD);
-
- //private static final int foo; PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; //PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; //FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; //NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private static final int foo; PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceField);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private static final int foo; //PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static final int foo; //FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static final int foo; //NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private static final int foo; PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- public void testUpdatePropertyAttributes() throws Exception {
- createTestXmlTypeWithPropertyAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public int getFoo();, public void setFoo(int);
- publicGetterSetterTest(classMapping);
-
- //public static int getFoo();, public static void setFoo(int);
- publicStaticGetterSetterTest(classMapping);
-
- //private int getFoo();, private void setFoo(int);
- privateGetterSetterTest(classMapping);
- }
-
- public void testUpdateGetterPropertyAttributes() throws Exception {
- createTestXmlTypeWithPropertyGetterAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public int getFoo(); PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); PROPERTY access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); FIELD access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); NONE access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo(); PUBLIC_MEMBER access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = classMapping.getJaxbType().getJavaResourceType().getMethods().iterator().next();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public int getFoo(); PROPERTY access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo(); FIELD access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo(); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo(); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- public void testUpdateSetterPropertyAttributes() throws Exception {
- createTestXmlTypeWithPropertySetterAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public void setFoo(int foo); PUBLIC_MEMBER access - not persistent
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); PROPERTY access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); FIELD access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); NONE access - not persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public void setFoo(int foo); PUBLIC_MEMBER access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = classMapping.getJaxbType().getJavaResourceType().getMethods().iterator().next();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public void setFoo(int foo);; PROPERTY access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public void setFoo(int foo); FIELD access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public void setFoo(int foo); NONE access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public void setFoo(int foo); PUBLIC_MEMBER access - persistent
- setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- public void testUpdateGetterListPropertyAttributes() throws Exception {
- this.createTestXmlTypeWithPropertyGetterListAndPublicMemberAccess();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- //public List<?> getFoo(); PUBLIC_MEMBER access - persistent
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public List<?> getFoo(); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public List<?> getFoo(); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public List<?> getFoo(); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public List<?> getFoo(); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = classMapping.getJaxbType().getJavaResourceType().getMethods().iterator().next();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public List<?> getFoo(); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- attributes = classMapping.getAttributes().iterator();
- assertEquals(1, classMapping.getAttributesSize());
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public List<?> getFoo(); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public List<?> getFoo(); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public List<?> getFoo(); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- protected void publicGetterSetterTest(JaxbClassMapping classMapping) {
- //public int getFoo();, public void setFoo(int); PUBLIC_MEMBER access - persistent
- assertEquals(1, classMapping.getAttributesSize());
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int getFoo();, public void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //public int getFoo();, public void setFoo(int); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo();, public void setFoo(int); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public int getFoo();, public void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
-
- //add @XmlAttribute annotation and test each access type
- JavaResourceMethod resourceMethod = (JavaResourceMethod) classMapping.getAttributes().iterator().next().getJavaResourceAttribute();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public int getFoo();, public void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- }
-
- protected void publicStaticGetterSetterTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- PropertyAccessor propertyAccessor = (PropertyAccessor) ReflectionTools.getFieldValue(attributes.next(), "accessor");
- JavaResourceMethod resourceGetter = propertyAccessor.getResourceGetterMethod();
- JavaResourceMethod resourceSetter = propertyAccessor.getResourceSetterMethod();
-
- //public static int getFoo();, public static void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.addModifiers(resourceGetter, ModifierKeyword.STATIC_KEYWORD);
- this.addModifiers(resourceSetter, ModifierKeyword.STATIC_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //public static int getFoo();, public static void setFoo(int); PROPERTY access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int getFoo();, public static void setFoo(int); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int getFoo();, public static void setFoo(int); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //public static int getFoo();, public static void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceGetter);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //public static int getFoo();, public static void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- this.removeModifiers(resourceGetter, ModifierKeyword.STATIC_KEYWORD);
- this.removeModifiers(resourceSetter, ModifierKeyword.STATIC_KEYWORD);
- }
-
- protected void privateGetterSetterTest(JaxbClassMapping classMapping) {
- Iterator<JaxbPersistentAttribute> attributes = classMapping.getAttributes().iterator();
- PropertyAccessor propertyAccessor = (PropertyAccessor) ReflectionTools.getFieldValue(attributes.next(), "accessor");
- JavaResourceMethod resourceGetter = propertyAccessor.getResourceGetterMethod();
- JavaResourceMethod resourceSetter = propertyAccessor.getResourceSetterMethod();
-
- //private int getFoo();, private void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.removeModifiers(resourceGetter, ModifierKeyword.PUBLIC_KEYWORD);
- this.removeModifiers(resourceSetter, ModifierKeyword.PUBLIC_KEYWORD);
- this.addModifiers(resourceGetter, ModifierKeyword.PRIVATE_KEYWORD);
- this.addModifiers(resourceSetter, ModifierKeyword.PRIVATE_KEYWORD);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //private int getFoo();, private void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //private int getFoo();, private void setFoo(int); FIELD access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int getFoo();, private void setFoo(int); NONE access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(0, classMapping.getAttributesSize());
-
- //private int getFoo();, private void setFoo(int); PUBLIC_MEMBER access - not persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(0, classMapping.getAttributesSize());
-
-
- //add @XmlAttribute annotation and test each access type
- AnnotatedElement annotatedElement = this.annotatedElement(resourceGetter);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE);
- }
- });
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); PROPERTY access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PROPERTY);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); FIELD access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__FIELD);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); NONE access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__NONE);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- //@XmlAttribute
- //private int getFoo();, private void setFoo(int); PUBLIC_MEMBER access - persistent
- this.setAccessTypeInJavaSource(classMapping, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- assertEquals(1, classMapping.getAttributesSize());
- attributes = classMapping.getAttributes().iterator();
- assertEquals("foo", attributes.next().getName());
- assertFalse(attributes.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE);
- }
- });
- this.removeModifiers(resourceGetter, ModifierKeyword.PRIVATE_KEYWORD);
- this.removeModifiers(resourceSetter, ModifierKeyword.PRIVATE_KEYWORD);
- this.addModifiers(resourceGetter, ModifierKeyword.PUBLIC_KEYWORD);
- this.addModifiers(resourceSetter, ModifierKeyword.PUBLIC_KEYWORD);
- }
-
- public void testModifyXmlSeeAlso() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlSeeAlsoAnnotation annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
-
- classMapping.addXmlSeeAlso();
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNotNull(classMapping.getXmlSeeAlso());
- assertNotNull(annotation);
-
- classMapping.removeXmlSeeAlso();
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
- }
-
- public void testUpdateXmlSeeAlso() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlSeeAlsoAnnotation annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SEE_ALSO);
- }
- });
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNotNull(classMapping.getXmlSeeAlso());
- assertNotNull(annotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(
- ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeAnnotation(declaration, JAXB.XML_SEE_ALSO);
- }
- });
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertNull(classMapping.getXmlSeeAlso());
- assertNull(annotation);
- }
-
- protected void addModifiers(JavaResourceMember resourceMember, final ModifierKeyword... modifiers) {
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMember);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.addModifiers((BodyDeclaration) declaration.getDeclaration(), modifiers);
- }
- });
- }
-
- protected void removeModifiers(JavaResourceMember resourceMember, final ModifierKeyword... modifiers) {
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMember);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.removeModifiers((BodyDeclaration) declaration.getDeclaration(), modifiers);
- }
- });
- }
-
- protected void addModifiers(BodyDeclaration bodyDeclaration, ModifierKeyword... modifiers) {
- for (ModifierKeyword modifier : modifiers) {
- this.modifiers(bodyDeclaration).add(bodyDeclaration.getAST().newModifier(modifier));
- }
- }
-
- protected void removeModifiers(BodyDeclaration bodyDeclaration, ModifierKeyword... modifierKeywords) {
- for (ModifierKeyword modifierKeyWord : modifierKeywords) {
- for (Iterator<IExtendedModifier> stream = this.modifiers(bodyDeclaration).iterator(); stream.hasNext();) {
- IExtendedModifier modifier = stream.next();
- if (modifier.isModifier()) {
- if (((Modifier) modifier).getKeyword() == modifierKeyWord) {
- stream.remove();
- break;
- }
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- protected List<IExtendedModifier> modifiers(BodyDeclaration bodyDeclaration) {
- return bodyDeclaration.modifiers();
- }
-
- protected void setAccessTypeInJavaSource(JaxbClassMapping classMapping, final String accessType) {
- JavaResourceType resourceClass = classMapping.getJaxbType().getJavaResourceType();
- AnnotatedElement annotatedElement = this.annotatedElement(resourceClass);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaClassMappingTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, accessType);
- }
- });
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java
deleted file mode 100644
index e6e8f7640b..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java
+++ /dev/null
@@ -1,413 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaElementFactoryMethodTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaElementFactoryMethodTests(String name) {
- super(name);
- }
-
- protected ICompilationUnit createClassWithXmlRegistryAndCreateMethods() throws Exception {
- return this.createTestType(PACKAGE_NAME, "ObjectFactory.java", "ObjectFactory", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY, JAXB.XML_ELEMENT_DECL, "javax.xml.bind.JAXBElement");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
-
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl").append(CR);
- sb.append(" JAXBElement<AnnotationTestType> createFoo(AnnotationTestType value) {return null}").append(CR);
- sb.append(CR);
- sb.append(" @XmlElementDecl(name=\"bar\")").append(CR);
- sb.append(" JAXBElement createBar(Object value) {return null}").append(CR);
- sb.append(CR);
- }
- });
- }
-
- public void testModifyElementName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getQName().getName());
-
- elementFactoryMethod.getQName().setSpecifiedName("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getQName().setSpecifiedName(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getName());
- assertNull(elementFactoryMethod.getQName().getName());
- }
-
- public void testUpdateElementName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getQName().getName());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__NAME, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifyDefaultValue() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getDefaultValue());
-
- elementFactoryMethod.setDefaultValue("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getDefaultValue());
- assertEquals("bar", elementFactoryMethod.getDefaultValue());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.setDefaultValue(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getDefaultValue());
- assertNull(elementFactoryMethod.getDefaultValue());
- }
-
- public void testUpdateDefaultValue() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getDefaultValue());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__DEFAULT_VALUE, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getDefaultValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifyScope() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getScope());
- assertTrue(elementFactoryMethod.isGlobalScope());
-
- elementFactoryMethod.setScope("Bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("Bar", elementDeclAnnotation.getScope());
- assertEquals("Bar", elementFactoryMethod.getScope());
- assertFalse(elementFactoryMethod.isGlobalScope());
-
- elementFactoryMethod.setScope(JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals(JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME, elementDeclAnnotation.getScope());
- assertEquals(JaxbElementFactoryMethod.DEFAULT_SCOPE_CLASS_NAME, elementFactoryMethod.getScope());
- assertTrue(elementFactoryMethod.isGlobalScope());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.setScope(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getScope());
- assertNull(elementFactoryMethod.getScope());
- }
-
- public void testUpdateScope() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getScope());
- assertTrue(elementFactoryMethod.isGlobalScope());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclTypeMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__SCOPE, "Foo");
- }
- });
- assertEquals("Foo", elementFactoryMethod.getScope());
- assertFalse(elementFactoryMethod.isGlobalScope());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifySubstitutionHeadName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedName("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getSubstitutionHeadName());
- assertEquals("bar", elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedName(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getSubstitutionHeadName());
- assertNull(elementFactoryMethod.getSubstitutionHeadQName().getName());
- }
-
- public void testUpdateSubstitutionHeadName() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertNull(elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAME, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getSubstitutionHeadQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifySubstitutionHeadNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedNamespace("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getSubstitutionHeadNamespace());
- assertEquals("bar", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getSubstitutionHeadQName().setSpecifiedNamespace(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getSubstitutionHeadNamespace());
- assertEquals("", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
- }
-
- public void testUpdateSubstitutionHeadNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__SUBSTITUTION_HEAD_NAMESPACE, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getSubstitutionHeadQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- public void testModifyNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getQName().getNamespace());
-
- elementFactoryMethod.getQName().setSpecifiedNamespace("bar");
- XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertEquals("bar", elementDeclAnnotation.getNamespace());
- assertEquals("bar", elementFactoryMethod.getQName().getNamespace());
-
- //verify the xml element decl annotation is not removed when the element name is set to null
- elementFactoryMethod.getQName().setSpecifiedNamespace(null);
- elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(elementDeclAnnotation.getNamespace());
- assertEquals("", elementFactoryMethod.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry xmlRegistry = jaxbClass.getXmlRegistry();
-
- assertEquals(2, xmlRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = xmlRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- JavaResourceMethod resourceMethod = elementFactoryMethod.getResourceMethod();
- assertEquals("", elementFactoryMethod.getQName().getNamespace());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.addXmlElementDeclMemberValuePair(declaration, JAXB.XML_ELEMENT_DECL__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", elementFactoryMethod.getQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaElementFactoryMethodTests.this.removeXmlElementDeclAnnotation(declaration);
- }
- });
- assertEquals(1, xmlRegistry.getElementFactoryMethodsSize());
- }
-
- protected void addXmlElementDeclMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementDeclAnnotation(declaration), name, value);
- }
-
- protected Annotation getXmlElementDeclAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_DECL);
- }
-
- protected void removeXmlElementDeclAnnotation(ModifiedDeclaration declaration) {
- this.removeAnnotation(declaration, JAXB.XML_ELEMENT_DECL);
- }
-
- protected void addXmlElementDeclTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlElementDeclAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java
deleted file mode 100644
index 59b975eeec..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaEnumConstantTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaEnumConstantTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createEnumWithXmlEnum() throws Exception {
- return createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createEnumWithXmlEnum();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JaxbEnumConstant contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertEquals("MONDAY", contextEnumConstant.getName());
-
-
- //add a factoryClass member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumConstantTests.this.changeEnumConstantName((EnumDeclaration) declaration.getDeclaration(), "MONDAY", "MONDAY2");
- }
- });
- contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- assertEquals(2, enumMapping.getEnumConstantsSize());
- assertEquals("MONDAY2", contextEnumConstant.getName());
- }
-
- public void testModifyValue() throws Exception {
- createEnumWithXmlEnum();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JaxbEnumConstant contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- JavaResourceEnumConstant resourceEnumConstant = contextEnumConstant.getResourceEnumConstant();
-
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
-
- contextEnumConstant.setSpecifiedValue("foo");
- XmlEnumValueAnnotation enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertEquals("foo", enumValueAnnotation.getValue());
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("foo", contextEnumConstant.getValue());
- assertEquals("foo", contextEnumConstant.getSpecifiedValue());
-
- contextEnumConstant.setSpecifiedValue(null);
- enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertNull(enumValueAnnotation.getValue());
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
- }
-
- public void testUpdateValue() throws Exception {
- createEnumWithXmlEnum();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JaxbEnumConstant contextEnumConstant = CollectionTools.get(enumMapping.getEnumConstants(), 1);
- JavaResourceEnumConstant resourceEnumConstant = contextEnumConstant.getResourceEnumConstant();
-
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
-
- //add an XmlEnumValue annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnumConstant);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation enumValueAnnotation = GenericJavaEnumConstantTests.this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ENUM_VALUE);
- GenericJavaEnumConstantTests.this.addMemberValuePair(enumValueAnnotation, JAXB.XML_ENUM_VALUE__VALUE, "foo");
- }
- });
-
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("foo", contextEnumConstant.getValue());
- assertEquals("foo", contextEnumConstant.getSpecifiedValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumConstantTests.this.removeAnnotation(declaration, JAXB.XML_ENUM_VALUE);
- }
- });
- assertEquals("MONDAY", contextEnumConstant.getDefaultValue());
- assertEquals("MONDAY", contextEnumConstant.getValue());
- assertNull(contextEnumConstant.getSpecifiedValue());
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java
deleted file mode 100644
index 9b39ca4e72..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumMappingTests.java
+++ /dev/null
@@ -1,381 +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.tests.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.EnumDeclaration;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnum;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant;
-import org.eclipse.jpt.jaxb.core.context.JaxbEnumMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaEnumMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaEnumMappingTests(String name) {
- super(name);
- }
-
-
- protected void addXmlTypeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlTypeAnnotation(declaration), name, value);
- }
-
- protected void addXmlTypeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlTypeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlEnumTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlEnumAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlTypeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_TYPE);
- }
-
- protected Annotation getXmlEnumAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ENUM);
- }
-
- public void testModifySchemaTypeName() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
-
- enumMapping.getQName().setSpecifiedName("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", enumMapping.getQName().getSpecifiedName());
- assertEquals("foo", enumMapping.getQName().getName());
-
- enumMapping.getQName().setSpecifiedName(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getName());
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
-
- resourceEnum.removeAnnotation(JAXB.XML_TYPE);
-
- //set name again, this time starting with no XmlType annotation
- enumMapping.getQName().setSpecifiedName("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getName());
- assertEquals("foo", enumMapping.getQName().getSpecifiedName());
- assertEquals("foo", enumMapping.getQName().getName());
- }
-
- public void testUpdateSchemaTypeName() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
- String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getDefaultName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- GenericJavaEnumMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAME, "foo");
- }
- });
- assertEquals("foo", enumMapping.getQName().getSpecifiedName());
- assertEquals("foo", enumMapping.getQName().getName());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaEnumMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaEnumMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(enumMapping.getQName().getSpecifiedName());
- assertEquals(defaultXmlTypeName, enumMapping.getQName().getName());
- }
-
- public void testModifyNamespace() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getDefaultNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
-
- enumMapping.getQName().setSpecifiedNamespace("foo");
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", enumMapping.getQName().getNamespace());
-
- enumMapping.getQName().setSpecifiedNamespace(null);
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getNamespace());
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
-
- resourceEnum.removeAnnotation(JAXB.XML_TYPE);
-
- //set namespace again, this time starting with no XmlType annotation
- enumMapping.getQName().setSpecifiedNamespace("foo");
- xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE);
- assertEquals("foo", xmlTypeAnnotation.getNamespace());
- assertEquals("foo", enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", enumMapping.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getDefaultNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TYPE);
- GenericJavaEnumMappingTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("foo", enumMapping.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlTypeAnnotation = (NormalAnnotation) GenericJavaEnumMappingTests.this.getXmlTypeAnnotation(declaration);
- GenericJavaEnumMappingTests.this.values(xmlTypeAnnotation).remove(0);
- }
- });
- assertNull(enumMapping.getQName().getSpecifiedNamespace());
- assertEquals("", enumMapping.getQName().getNamespace());
- }
-
- public void testModifyXmlRootElement() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getXmlRootElement());
-
- enumMapping.addXmlRootElement().getQName().setSpecifiedName("foo");
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", xmlRootElementAnnotation.getName());
- assertEquals("foo", enumMapping.getXmlRootElement().getQName().getName());
-
- enumMapping.removeXmlRootElement();
- xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation);
- assertNull(enumMapping.getXmlRootElement());
- }
-
- public void testUpdateXmlRootElement() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getXmlRootElement());
-
- //add a XmlRootElement annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = GenericJavaEnumMappingTests.this.addNormalAnnotation(declaration.getDeclaration(), JAXB.XML_ROOT_ELEMENT);
- GenericJavaEnumMappingTests.this.addMemberValuePair(annotation, JAXB.XML_ROOT_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", enumMapping.getXmlRootElement().getQName().getName());
-
- //remove the XmlRootElement annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(enumMapping.getXmlRootElement());
- }
-
- public void testModifyXmlEnumValue() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
-
- enumMapping.setSpecifiedXmlEnumValue("Integer");
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertEquals("Integer", xmlEnumAnnotation.getValue());
- assertEquals("Integer", enumMapping.getSpecifiedXmlEnumValue());
- assertEquals("Integer", enumMapping.getXmlEnumValue());
-
- enumMapping.setSpecifiedXmlEnumValue(null);
- xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
-
- resourceEnum.addAnnotation(JAXB.XML_TYPE);
- resourceEnum.removeAnnotation(JAXB.XML_ENUM);
- enumMapping = ((JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
- }
-
- public void testUpdateXmlEnumValue() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ENUM);
- GenericJavaEnumMappingTests.this.addXmlEnumTypeMemberValuePair(declaration, JAXB.XML_ENUM__VALUE, "String");
- }
- });
- assertEquals("String", enumMapping.getSpecifiedXmlEnumValue());
- assertEquals("String", enumMapping.getXmlEnumValue());
-
- //remove the factoryClass member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlEnumAnnotation = (NormalAnnotation) GenericJavaEnumMappingTests.this.getXmlEnumAnnotation(declaration);
- GenericJavaEnumMappingTests.this.values(xmlEnumAnnotation).remove(0);
- }
- });
- assertNull(enumMapping.getSpecifiedXmlEnumValue());
- assertEquals(JaxbEnumMapping.DEFAULT_XML_ENUM_VALUE, enumMapping.getXmlEnumValue());
- }
-
- public void testUpdateEnumConstants() throws Exception {
- createEnumWithXmlType();
-
- JaxbEnum jaxbEnum = (JaxbEnum) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbEnumMapping enumMapping = jaxbEnum.getMapping();
- JavaResourceEnum resourceEnum = jaxbEnum.getJavaResourceType();
-
- assertEquals(2, enumMapping.getEnumConstantsSize());
- Iterator<JaxbEnumConstant> enumConstants = enumMapping.getEnumConstants().iterator();
- JaxbEnumConstant enumConstant = enumConstants.next();
- assertEquals("SUNDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("MONDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.addEnumConstant((EnumDeclaration) declaration.getDeclaration(), "TUESDAY");
- GenericJavaEnumMappingTests.this.addEnumConstant((EnumDeclaration) declaration.getDeclaration(), "WEDNESDAY");
- }
- });
- assertEquals(4, enumMapping.getEnumConstantsSize());
- enumConstants = enumMapping.getEnumConstants().iterator();
- enumConstant = enumConstants.next();
- assertEquals("SUNDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("MONDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("TUESDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("WEDNESDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "SUNDAY");
- }
- });
- assertEquals(3, enumMapping.getEnumConstantsSize());
- enumConstants = enumMapping.getEnumConstants().iterator();
- enumConstant = enumConstants.next();
- assertEquals("MONDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("TUESDAY", enumConstant.getName());
- enumConstant = enumConstants.next();
- assertEquals("WEDNESDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "TUESDAY");
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "MONDAY");
- }
- });
- assertEquals(1, enumMapping.getEnumConstantsSize());
- enumConstants = enumMapping.getEnumConstants().iterator();
- enumConstant = enumConstants.next();
- assertEquals("WEDNESDAY", enumConstant.getName());
- assertFalse(enumConstants.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaEnumMappingTests.this.removeEnumConstant((EnumDeclaration) declaration.getDeclaration(), "WEDNESDAY");
- }
- });
- assertEquals(0, enumMapping.getEnumConstantsSize());
- assertFalse(enumMapping.getEnumConstants().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java
deleted file mode 100644
index 410125c98f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java
+++ /dev/null
@@ -1,793 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-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.SubListIterableWrapper;
-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.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaPackageInfoTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorOrder() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)",
- JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
-
- public void testModifyAccessType() throws Exception {
- createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.FIELD, contextPackageInfo.getAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.NONE);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE, accessorTypeAnnotation.getValue());
- assertEquals(XmlAccessType.NONE, contextPackageInfo.getAccessType());
-
- contextPackageInfo.setSpecifiedAccessType(null);
- accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertNull(accessorTypeAnnotation.getValue());
- assertNull(contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
- }
-
- public void testUpdateAccessType() throws Exception {
- createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PROPERTY, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
-
- //set the accesser type value to FIELD
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__FIELD);
- }
- });
- assertEquals(XmlAccessType.FIELD, contextPackageInfo.getAccessType());
-
- //set the accesser type value to PUBLIC_MEMBER
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER);
- }
- });
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
-
- //set the accesser type value to NONE
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__NONE);
- }
- });
- assertEquals(XmlAccessType.NONE, contextPackageInfo.getAccessType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlAccessorTypeAnnotation(declaration);
- }
- });
- assertNull(contextPackageInfo.getSpecifiedAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType());
- assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType());
- }
-
- public void testModifyAccessOrder() throws Exception {
- createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
-
- contextPackageInfo.setSpecifiedAccessOrder(XmlAccessOrder.UNDEFINED);
- XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED, accessorOrderAnnotation.getValue());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
-
- contextPackageInfo.setSpecifiedAccessOrder(null);
- accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNull(accessorOrderAnnotation.getValue());
- assertNull(contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
- }
-
- public void testUpdateAccessOrder() throws Exception {
- createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.ALPHABETICAL, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
-
- //set the access order value to UNDEFINED
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER__UNDEFINED);
- }
- });
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlAccessorOrderAnnotation(declaration);
- }
- });
- assertNull(contextPackageInfo.getSpecifiedAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder());
- assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder());
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlAccessorType annotation. Only "annotated" packages are added to the context model
- protected void removeXmlAccessorTypeAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA);
- this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlAccessorOrder annotation. Only "annotated" packages are added to the context model
- protected void removeXmlAccessorOrderAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA);
- this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_ORDER);
- }
-
- public void testGetXmlSchemaTypes() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlSchemaType> xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- assertFalse(xmlSchemaTypes.iterator().hasNext());
-
- //add 2 XmlSchemaTypes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
- }
-
- protected void addXmlSchemaType(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = this.newXmlSchemaTypeAnnotation(declaration.getAst(), name);
- this.addArrayElement(declaration, JAXB.XML_SCHEMA_TYPES, index, JAXB.XML_SCHEMA_TYPES__VALUE, arrayElement);
- }
-
- protected NormalAnnotation newXmlSchemaTypeAnnotation(AST ast, String name) {
- NormalAnnotation annotation = this.newNormalAnnotation(ast, JAXB.XML_SCHEMA_TYPE);
- this.addMemberValuePair(annotation, JAXB.XML_SCHEMA_TYPE__NAME, name);
- return annotation;
- }
-
- public void testGetXmlSchemaTypesSize() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(0, contextPackageInfo.getXmlSchemaTypesSize());
-
- //add 2 XmlSchemaTypes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- }
- });
- assertEquals(2, contextPackageInfo.getXmlSchemaTypesSize());
- }
-
- public void testAddXmlSchemaType() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
-
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- protected Iterator<XmlSchemaTypeAnnotation> getSchemaTypeAnnotations(JavaResourcePackage resourcePackage) {
- return new SubListIterableWrapper<NestableAnnotation, XmlSchemaTypeAnnotation>(resourcePackage.getAnnotations(JAXB.XML_SCHEMA_TYPE)).iterator();
- }
-
- public void testAddXmlSchemaType2() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
-
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- public void testRemoveXmlSchemaType() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(2).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.removeXmlSchemaType(1);
-
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.removeXmlSchemaType(1);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.removeXmlSchemaType(0);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- public void testMoveXmlSchemaType() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar");
- contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo");
- contextPackageInfo.addXmlSchemaType(2).getQName().setSpecifiedName("baz");
-
- Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.moveXmlSchemaType(2, 0);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
-
- contextPackageInfo.moveXmlSchemaType(0, 1);
- xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage);
- assertEquals("baz", xmlSchemaTypes.next().getName());
- assertEquals("foo", xmlSchemaTypes.next().getName());
- assertEquals("bar", xmlSchemaTypes.next().getName());
- assertFalse(xmlSchemaTypes.hasNext());
- }
-
- public void testSyncXmlSchemaTypes() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlSchemaType> xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- assertFalse(xmlSchemaTypes.iterator().hasNext());
-
- //add 3 XmlSchemaTypes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 2, "baz");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlSchemaType(declaration, 2, 0);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlSchemaType(declaration, 0, 1);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlSchemaType(declaration, 1);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlSchemaType(declaration, 1);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlSchemaType(declaration, 0);
- }
- });
-
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertFalse(xmlSchemaTypesIterator.hasNext());
- }
-
- public void testSyncAddXmlSchemaTypes() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlSchemaType> xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- assertFalse(xmlSchemaTypes.iterator().hasNext());
-
- //add 1 XmlSchemaType when none exist
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "bar");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
-
- //add 1 XmlSchemaType when 1 standalone exists
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 1, "foo");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
- //add 1 XmlSchemaType when a container annotations exists
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 2, "baz");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
-
- //add 1 XmlSchemaType to beginning of list when a container annotations exists
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlSchemaType(declaration, 0, "foobaz");
- }
- });
-
- xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes();
- xmlSchemaTypesIterator = xmlSchemaTypes.iterator();
- assertTrue(xmlSchemaTypesIterator.hasNext());
- assertEquals("foobaz", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName());
- assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName());
- assertFalse(xmlSchemaTypesIterator.hasNext());
- }
-
- protected void moveXmlSchemaType(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPES), JAXB.XML_SCHEMA_TYPES__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlSchemaType(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPES), JAXB.XML_SCHEMA_TYPES__VALUE, index);
- }
-
-
- public void testGetXmlJavaTypeAdapters() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlJavaTypeAdapter> xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- assertFalse(xmlJavaTypeAdapters.iterator().hasNext());
-
- //add 2 XmlJavaTypeAdapters
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 0, "String");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 1, "Integer");
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- ListIterator<XmlJavaTypeAdapter> xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("String", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("Integer", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
- }
-
- protected void addXmlJavaTypeAdapter(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = this.newXmlJavaTypeAdapterAnnotation(declaration.getAst(), name);
- this.addArrayElement(declaration, JAXB.XML_JAVA_TYPE_ADAPTERS, index, JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE, arrayElement);
- }
-
- protected NormalAnnotation newXmlJavaTypeAdapterAnnotation(AST ast, String valueTypeName) {
- NormalAnnotation annotation = this.newNormalAnnotation(ast, JAXB.XML_JAVA_TYPE_ADAPTER);
- this.addMemberValuePair(
- annotation,
- JAXB.XML_JAVA_TYPE_ADAPTER__VALUE,
- this.newTypeLiteral(ast, valueTypeName));
- return annotation;
- }
-
- public void testGetXmlJavaTypeAdaptersSize() throws Exception {
- this.createPackageInfoWithAccessorOrder();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(0, contextPackageInfo.getXmlJavaTypeAdaptersSize());
-
- //add 2 XmlJavaTypeAdapters
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 0, "String");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 1, "Integer");
- }
- });
- assertEquals(2, contextPackageInfo.getXmlJavaTypeAdaptersSize());
- }
-
- public void testAddXmlJavaTypeAdapter() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("bar");
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
-
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- protected Iterator<XmlJavaTypeAdapterAnnotation> getXmlJavaTypeAdapterAnnotations(JavaResourcePackage resourcePackage) {
- return new SubListIterableWrapper<NestableAnnotation, XmlJavaTypeAdapterAnnotation>(resourcePackage.getAnnotations(JAXB.XML_JAVA_TYPE_ADAPTER)).iterator();
- }
-
- public void testAddXmlJavaTypeAdapter2() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("bar");
- contextPackageInfo.addXmlJavaTypeAdapter(1).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
-
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- public void testRemoveXmlJavaTypeAdapter() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("String");
- contextPackageInfo.addXmlJavaTypeAdapter(1).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(2).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- XmlJavaTypeAdapterAnnotation adapterAnnotation = xmlJavaTypeAdapters.next();
- assertEquals("String", adapterAnnotation.getValue());
- assertEquals("java.lang.String", adapterAnnotation.getFullyQualifiedValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.removeXmlJavaTypeAdapter(1);
-
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- adapterAnnotation = xmlJavaTypeAdapters.next();
- assertEquals("String", adapterAnnotation.getValue());
- assertEquals("java.lang.String", adapterAnnotation.getFullyQualifiedValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.removeXmlJavaTypeAdapter(1);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- adapterAnnotation = xmlJavaTypeAdapters.next();
- assertEquals("String", adapterAnnotation.getValue());
- assertEquals("java.lang.String", adapterAnnotation.getFullyQualifiedValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.removeXmlJavaTypeAdapter(0);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- public void testMoveXmlJavaTypeAdapter() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextPackageInfo.addXmlJavaTypeAdapter(0).setValue("bar");
- contextPackageInfo.addXmlJavaTypeAdapter(1).setValue("foo");
- contextPackageInfo.addXmlJavaTypeAdapter(2).setValue("baz");
-
- Iterator<XmlJavaTypeAdapterAnnotation> xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.moveXmlJavaTypeAdapter(2, 0);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
-
- contextPackageInfo.moveXmlJavaTypeAdapter(0, 1);
- xmlJavaTypeAdapters = this.getXmlJavaTypeAdapterAnnotations(resourcePackage);
- assertEquals("baz", xmlJavaTypeAdapters.next().getValue());
- assertEquals("foo", xmlJavaTypeAdapters.next().getValue());
- assertEquals("bar", xmlJavaTypeAdapters.next().getValue());
- assertFalse(xmlJavaTypeAdapters.hasNext());
- }
-
- public void testSyncXmlJavaTypeAdapters() throws Exception {
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlJavaTypeAdapter> xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- assertFalse(xmlJavaTypeAdapters.iterator().hasNext());
-
- //add 3 XmlJavaTypeAdapters
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 0, "bar");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 1, "foo");
- GenericJavaPackageInfoTests.this.addXmlJavaTypeAdapter(declaration, 2, "baz");
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- ListIterator<XmlJavaTypeAdapter> xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("foo", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlJavaTypeAdapter(declaration, 2, 0);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("foo", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.moveXmlJavaTypeAdapter(declaration, 0, 1);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("foo", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlJavaTypeAdapter(declaration, 1);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertEquals("bar", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlJavaTypeAdapter(declaration, 1);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertTrue(xmlJavaTypeAdaptersIterator.hasNext());
- assertEquals("baz", xmlJavaTypeAdaptersIterator.next().getValue());
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageInfoTests.this.removeXmlJavaTypeAdapter(declaration, 0);
- }
- });
-
- xmlJavaTypeAdapters = contextPackageInfo.getXmlJavaTypeAdapters();
- xmlJavaTypeAdaptersIterator = xmlJavaTypeAdapters.iterator();
- assertFalse(xmlJavaTypeAdaptersIterator.hasNext());
- }
-
-
- protected void moveXmlJavaTypeAdapter(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTERS), JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlJavaTypeAdapter(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTERS), JAXB.XML_JAVA_TYPE_ADAPTERS__VALUE, index);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java
deleted file mode 100644
index 0d45116955..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java
+++ /dev/null
@@ -1,160 +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.tests.internal.context.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaPackageXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaPackageXmlJavaTypeAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithXmlJavaTypeAdapter() throws CoreException {
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter",
- JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
-
- public void testModifyValue() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- contextXmlJavaTypeAdapter.setValue("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getValue());
- assertEquals("foo", contextXmlJavaTypeAdapter.getValue());
-
- //verify the xml schema type annotation is not removed when the value is set to null
- contextXmlJavaTypeAdapter.setValue(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getValue());
- assertNull(contextXmlJavaTypeAdapter.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- //add a value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlJavaTypeAdapters().iterator().hasNext());
- }
-
- public void testModifyType() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertNull(contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getType());
-
- //verify the xml schema type annotation is not removed when the type is set to null
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getType());
- assertNull(contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertNull(contextXmlJavaTypeAdapter.getDefaultType());
- }
-
- public void testUpdateType() throws Exception {
- this.createPackageInfoWithXmlJavaTypeAdapter();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertNull(contextXmlJavaTypeAdapter.getDefaultType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaPackageXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlJavaTypeAdapters().iterator().hasNext());
- }
-
- protected void addXmlJavaTypeAdapterTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlJavaTypeAdapterMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlJavaTypeAdapter annotation. Only "annotated" packages are added to the context model
- protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
deleted file mode 100644
index 13bf4b00f7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.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.tests.internal.context.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaPersistentAttributeTests
- extends JaxbContextModelTestCase {
-
- private static String TEST_CLASS_NAME = "TestClass";
-
- public GenericJavaPersistentAttributeTests(String name) {
- super(name);
- }
-
-
- private void createXmlTypeWithVariousAttributes() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JAXB.XML_TYPE).append(";").append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TEST_CLASS_NAME).append("<T extends Number> ").append("{").append(CR);
- sb.append(" public String string;").append(CR);
- sb.append(" public List<String> stringList;").append(CR);
- sb.append(" public String[] stringArray;").append(CR);
- sb.append(" public String[][] stringDoubleArray;").append(CR);
- sb.append(" public T generic;").append(CR);
- sb.append(" public List<T> genericList;").append(CR);
- sb.append(" public T[] genericArray;").append(CR);
- sb.append(" public List<?> wildcardList;").append(CR);
- sb.append(" public byte[] byteArray;").append(CR);
- sb.append(" public List list;").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS_NAME + ".java", sourceWriter);
- }
-
-
- public void testJavaResourceType() throws Exception {
- createXmlTypeWithVariousAttributes();
- JaxbClassMapping classMapping = ((JaxbClass) getContextRoot().getType(PACKAGE_NAME_ + TEST_CLASS_NAME)).getMapping();
-
- // String string
- JaxbPersistentAttribute att = CollectionTools.get(classMapping.getAttributes(), 0);
- assertEquals("java.lang.String", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // List<String> stringList
- att = CollectionTools.get(classMapping.getAttributes(), 1);
- assertEquals("java.lang.String", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // String[] stringArray
- att = CollectionTools.get(classMapping.getAttributes(), 2);
- assertEquals("java.lang.String", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // String[][] stringDoubleArray
- att = CollectionTools.get(classMapping.getAttributes(), 3);
- assertEquals("java.lang.String[][]", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // T generic
- att = CollectionTools.get(classMapping.getAttributes(), 4);
- assertEquals("java.lang.Number", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // List<T> genericList
- att = CollectionTools.get(classMapping.getAttributes(), 5);
- assertEquals("java.lang.Number", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // T[] genericArray
- att = CollectionTools.get(classMapping.getAttributes(), 6);
- assertEquals("java.lang.Number", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // List<?> wildcardList
- att = CollectionTools.get(classMapping.getAttributes(), 7);
- assertEquals("java.lang.Object", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
-
- // byte[] byteArray
- att = CollectionTools.get(classMapping.getAttributes(), 8);
- assertEquals("byte[]", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(false, att.isJavaResourceAttributeCollectionType());
-
- // List list
- att = CollectionTools.get(classMapping.getAttributes(), 9);
- assertEquals("java.lang.Object", att.getJavaResourceAttributeBaseTypeName());
- assertEquals(true, att.isJavaResourceAttributeCollectionType());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java
deleted file mode 100644
index b01ba097ef..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaRegistryTests.java
+++ /dev/null
@@ -1,197 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Block;
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod;
-import org.eclipse.jpt.jaxb.core.context.XmlRegistry;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaRegistryTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaRegistryTests(String name) {
- super(name);
- }
-
- protected ICompilationUnit createClassWithXmlRegistryAndCreateMethods() throws Exception {
- return this.createTestType(PACKAGE_NAME, "ObjectFactory.java", "ObjectFactory", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY, JAXB.XML_ELEMENT_DECL, "javax.xml.bind.JAXBElement");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
-
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl(name=\"foo\")").append(CR);
- sb.append(" JAXBElement<AnnotationTestType> createFoo(AnnotationTestType value) {return null}").append(CR);
- sb.append(CR);
- sb.append(" @XmlElementDecl(name=\"bar\")").append(CR);
- sb.append(" JAXBElement createBar(Object value) {return null}").append(CR);
- sb.append(CR);
- }
- });
- }
-
-
- protected void addElementFactoryMethod(TypeDeclaration typeDeclaration, String methodName) {
- AST ast = typeDeclaration.getAST();
- MethodDeclaration methodDeclaration = this.newMethodDeclaration(ast, methodName);
- Block body = ast.newBlock();
- methodDeclaration.setBody(body);
- methodDeclaration.setReturnType2(ast.newSimpleType(ast.newName("JAXBElement")));
- SingleVariableDeclaration parameter = ast.newSingleVariableDeclaration();
- parameter.setName(ast.newSimpleName("value"));
- parameter.setType(ast.newSimpleType(ast.newName("Object")));
- parameters(methodDeclaration).add(parameter);
- NormalAnnotation elementDeclAnnotation = this.newNormalAnnotation(ast, "XmlElementDecl");
- modifiers(methodDeclaration).add(elementDeclAnnotation);
- this.bodyDeclarations(typeDeclaration).add(methodDeclaration);
- }
-
- protected MethodDeclaration newMethodDeclaration(AST ast, String methodName) {
- MethodDeclaration methodDeclaration = ast.newMethodDeclaration();
- methodDeclaration.setName(ast.newSimpleName(methodName));
- return methodDeclaration;
- }
-
- /**
- * minimize the scope of the suppressed warnings
- */
- @SuppressWarnings("unchecked")
- protected List<BodyDeclaration> bodyDeclarations(TypeDeclaration td) {
- return td.bodyDeclarations();
- }
-
- @SuppressWarnings("unchecked")
- protected List<SingleVariableDeclaration> parameters(MethodDeclaration md) {
- return md.parameters();
- }
-
- @SuppressWarnings("unchecked")
- protected List<IExtendedModifier> modifiers(MethodDeclaration md) {
- return md.modifiers();
- }
-
- protected void removeMethodDeclaration(TypeDeclaration typeDeclaration, String methodName) {
- for (MethodDeclaration md : typeDeclaration.getMethods()) {
- if (md.getName().getFullyQualifiedName().equals(methodName)) {
- this.bodyDeclarations(typeDeclaration).remove(md);
- break;
- }
- }
- }
-
- public void testUpdateElementFactoryMethods() throws Exception {
- createClassWithXmlType();
- createClassWithXmlRegistryAndCreateMethods();
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType("test.ObjectFactory");
- XmlRegistry contextRegistry = jaxbClass.getXmlRegistry();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(2, contextRegistry.getElementFactoryMethodsSize());
- Iterator<JaxbElementFactoryMethod> elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- JaxbElementFactoryMethod elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo", elementFactoryMethod.getName());
- assertEquals("foo", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.addElementFactoryMethod((TypeDeclaration) declaration.getDeclaration(), "createFoo2");
- GenericJavaRegistryTests.this.addElementFactoryMethod((TypeDeclaration) declaration.getDeclaration(), "createBar2");
- }
- });
- assertEquals(4, contextRegistry.getElementFactoryMethodsSize());
- elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo", elementFactoryMethod.getName());
- assertEquals("foo", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createFoo");
- }
- });
- assertEquals(3, contextRegistry.getElementFactoryMethodsSize());
- elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createFoo2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar2", elementFactoryMethod.getName());
- assertEquals(null, elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createFoo2");
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createBar2");
- }
- });
- assertEquals(1, contextRegistry.getElementFactoryMethodsSize());
- elementFactoryMethods = contextRegistry.getElementFactoryMethods().iterator();
- elementFactoryMethod = elementFactoryMethods.next();
- assertEquals("createBar", elementFactoryMethod.getName());
- assertEquals("bar", elementFactoryMethod.getQName().getName());
- assertFalse(elementFactoryMethods.hasNext());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaRegistryTests.this.removeMethodDeclaration((TypeDeclaration) declaration.getDeclaration(), "createBar");
- }
- });
- assertEquals(0, contextRegistry.getElementFactoryMethodsSize());
- assertFalse(contextRegistry.getElementFactoryMethods().iterator().hasNext());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java
deleted file mode 100644
index 6df5f7d855..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java
+++ /dev/null
@@ -1,173 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaTypeXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaTypeXmlJavaTypeAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlJavaTypeAdapter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJavaTypeAdapter");
- }
- });
- }
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- contextXmlJavaTypeAdapter.setValue("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getValue());
- assertEquals("foo", contextXmlJavaTypeAdapter.getValue());
-
- //verify the xml schema type annotation is not removed when the value is set to null
- contextXmlJavaTypeAdapter.setValue(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getValue());
- assertNull(contextXmlJavaTypeAdapter.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextXmlJavaTypeAdapter.getValue());
-
- //add a value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__VALUE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(jaxbClass.getXmlJavaTypeAdapter());
- }
-
- public void testModifyType() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
- XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
- javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(javaTypeAdapterAnnotation.getType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
- }
-
- public void testUpdateType() throws Exception {
- createTypeWithXmlJavaTypeAdapter();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- XmlJavaTypeAdapter contextXmlJavaTypeAdapter = jaxbClass.getXmlJavaTypeAdapter();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlJavaTypeAdapter.getSpecifiedType());
- assertEquals("String", contextXmlJavaTypeAdapter.getType());
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaTypeXmlJavaTypeAdapterTests.this.removeXmlJavaTypeAdapterAnnotation(declaration);
- }
- });
- assertNull(jaxbClass.getXmlJavaTypeAdapter());
- }
-
- protected void addXmlJavaTypeAdapterTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlJavaTypeAdapterMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlJavaTypeAdapterAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlJavaTypeAdapter annotation. Only "annotated" packages are added to the context model
- protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.java
deleted file mode 100644
index 8e79e10763..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAdapterTests.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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAdapter;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlAdapterTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlAdapterTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createXmlType() throws Exception {
- return this.createTestType(
- new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- private void createObjObjXmlAdapter() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import " + JAXB.XML_ADAPTER + ";").append(CR);
- sb.append(CR);
- sb.append("public class ObjObjAdapter extends XmlAdapter<Object, Object> {").append(CR);
- sb.append(" public Object marshal(Object obj) { return null; }").append(CR);
- sb.append(" public Object unmarshal(Object obj) { return null; }").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ObjObjAdapter.java", sourceWriter);
- }
-
- private void createMapCalendarXmlAdapter() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import " + JAXB.XML_ADAPTER + ";").append(CR);
- sb.append("import java.util.Map;").append(CR);
- sb.append("import java.util.GregorianCalendar;").append(CR);
- sb.append(CR);
- sb.append("public class MapCalendarAdapter extends XmlAdapter<GregorianCalendar, Map<String, String>> {").append(CR);
- sb.append(" public GregorianCalendar marshal(Map<String, String> obj) { return null; }").append(CR);
- sb.append(" public GregorianCalendar marshal(Object obj) { return null; }").append(CR);
- sb.append(" public Map<String, String> unmarshal(Gregorian Calendar obj) { return null; }").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "MapCalendarAdapter.java", sourceWriter);
- }
-
-
- public void testBoundAndValueTypes() throws Exception {
- createXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping attributeMapping = (XmlElementMapping) persistentAttribute.getMapping();
-
- XmlJavaTypeAdapter xmlJavaTypeAdapter = attributeMapping.addXmlJavaTypeAdapter();
- xmlJavaTypeAdapter.setValue("test.ObjObjAdapter");
-
- assertEquals("test.ObjObjAdapter", xmlJavaTypeAdapter.getValue());
- assertEquals("test.ObjObjAdapter", xmlJavaTypeAdapter.getFullyQualifiedValue());
- assertNull(xmlJavaTypeAdapter.getXmlAdapter());
-
- createObjObjXmlAdapter();
- XmlAdapter xmlAdapter = xmlJavaTypeAdapter.getXmlAdapter();
- assertNotNull(xmlAdapter);
- assertEquals("java.lang.Object", xmlAdapter.getBoundType());
- assertEquals("java.lang.Object", xmlAdapter.getValueType());
-
- createMapCalendarXmlAdapter();
- xmlJavaTypeAdapter.setValue("test.MapCalendarAdapter");
- xmlAdapter = xmlJavaTypeAdapter.getXmlAdapter();
- assertNotNull(xmlAdapter);
- assertEquals("java.util.Map", xmlAdapter.getBoundType());
- assertEquals("java.util.GregorianCalendar", xmlAdapter.getValueType());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java
deleted file mode 100644
index 2bf708def4..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java
+++ /dev/null
@@ -1,151 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlAnyAttributeMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlAnyAttributeMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlAnyAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ANY_ATTRIBUTE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyAttribute");
- }
- });
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyAttributeMapping attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyAttributeMapping attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- attributeMapping.addXmlJavaTypeAdapter();
-
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- attributeMapping.removeXmlJavaTypeAdapter();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyAttributeMapping attributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java
deleted file mode 100644
index f9f08dd5da..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java
+++ /dev/null
@@ -1,531 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-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.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlAnyElementMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlAnyElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement");
- }
- });
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- assertNotNull(attributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- attributeMapping.addXmlJavaTypeAdapter();
-
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- attributeMapping.removeXmlJavaTypeAdapter();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testModifyLax() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
-
- attributeMapping.setSpecifiedLax(Boolean.TRUE);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertEquals(Boolean.TRUE, xmlAnyElementAnnotation.getLax());
- assertEquals(Boolean.TRUE, attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(true, attributeMapping.isLax());
-
- attributeMapping.setSpecifiedLax(null);
- xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
- }
-
- public void testUpdateLax() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
-
-
- //add a nillable member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addXmlAnyElementMemberValuePair(declaration, JAXB.XML_ANY_ELEMENT__LAX, true);
- }
- });
- assertEquals(Boolean.TRUE, attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(true, attributeMapping.isLax());
-
- //remove the lax member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlAnyElementMappingTests.this.getXmlAnyElementAnnotation(declaration);
- GenericJavaXmlAnyElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(attributeMapping.getSpecifiedLax());
- assertEquals(false, attributeMapping.isDefaultLax());
- assertEquals(false, attributeMapping.isLax());
- }
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedValue());
-
- attributeMapping.setSpecifiedValue("Foo");
- XmlAnyElementAnnotation xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertEquals("Foo", attributeMapping.getSpecifiedValue());
- assertEquals("Foo", attributeMapping.getValue());
-
- attributeMapping.setSpecifiedValue(null);
- xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertNull(xmlElementAnnotation.getValue());
- assertNull(attributeMapping.getSpecifiedValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getSpecifiedValue());
-
-
- //add a Value member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addXmlAnyElementTypeMemberValuePair(declaration, JAXB.XML_ANY_ELEMENT__VALUE, "Foo");
- }
- });
- assertEquals("Foo", attributeMapping.getValue());
-
- //remove the Value member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlAnyElementMappingTests.this.getXmlAnyElementAnnotation(declaration);
- GenericJavaXmlAnyElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(attributeMapping.getSpecifiedValue());
- }
-
- protected Annotation getXmlAnyElementAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ANY_ELEMENT);
- }
-
- protected void addXmlAnyElementMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlAnyElementAnnotation(declaration), name, value);
- }
-
- protected void addXmlAnyElementTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlAnyElementAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
-
- // ***** XmlElementRefs *****
-
- public void testSyncXmlElementRefs() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<XmlElementRef> xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
- assertTrue(CollectionTools.isEmpty(xmlElementRefs));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
-
- //add XmlElementRef annotation
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMemberValuePair(
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_REF),
- JAXB.XML_ELEMENT_REF__NAME, "foo");
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
-
- // add XmlElementRefs annotation with nested annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), JAXB.XML_ELEMENT_REFS);
- NormalAnnotation annotation =
- GenericJavaXmlAnyElementMappingTests.this.newNormalAnnotation(declaration.getAst(), JAXB.XML_ELEMENT_REF);
- GenericJavaXmlAnyElementMappingTests.this.addMemberValuePair(
- annotation, JAXB.XML_ELEMENT_REF__NAME, "bar");
- GenericJavaXmlAnyElementMappingTests.this.addArrayElement(
- declaration, JAXB.XML_ELEMENT_REFS, 0, JAXB.XML_ELEMENT_REFS__VALUE, annotation);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
-
- // add second nested XmlElementRef annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation =
- GenericJavaXmlAnyElementMappingTests.this.newNormalAnnotation(declaration.getAst(), JAXB.XML_ELEMENT_REF);
- GenericJavaXmlAnyElementMappingTests.this.addMemberValuePair(
- annotation, JAXB.XML_ELEMENT_REF__NAME, "baz");
- GenericJavaXmlAnyElementMappingTests.this.addArrayElement(
- declaration, JAXB.XML_ELEMENT_REFS, 1, JAXB.XML_ELEMENT_REFS__VALUE, annotation);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("baz", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // switch nested XmlElementRef annotations
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.moveArrayElement(
- (NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS),
- JAXB.XML_ELEMENT_REFS__VALUE, 0, 1);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("baz", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // remove XmlElementRefs annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeArrayElement(
- (NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS),
- JAXB.XML_ELEMENT_REFS__VALUE, 1);
- GenericJavaXmlAnyElementMappingTests.this.removeArrayElement(
- (NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS),
- JAXB.XML_ELEMENT_REFS__VALUE, 0);
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(
- declaration, JAXB.XML_ELEMENT_REFS);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
-
- // remove XmlElementRef annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(
- declaration, JAXB.XML_ELEMENT_REF);
- }
- });
- xmlElementRefs = attributeMapping.getXmlElementRefs().getXmlElementRefs();
-
- assertTrue(CollectionTools.isEmpty(attributeMapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testModifyXmlElementRefs() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlElementRefsAnnotation xmlElementRefsAnnotation;
- XmlElementRefAnnotation xmlElementRefAnnotation;
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
-
- attributeMapping.getXmlElementRefs().addXmlElementRef(0).getQName().setSpecifiedName("foo");
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefsAnnotation);
- assertNotNull(xmlElementRefAnnotation);
- assertEquals("foo", xmlElementRefAnnotation.getName());
-
- attributeMapping.getXmlElementRefs().addXmlElementRef(1).getQName().setSpecifiedName("bar");
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNotNull(xmlElementRefsAnnotation);
- assertNull(xmlElementRefAnnotation);
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0).getName());
- assertEquals("bar", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 1).getName());
-
- attributeMapping.getXmlElementRefs().moveXmlElementRef(0, 1);
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNotNull(xmlElementRefsAnnotation);
- assertNull(xmlElementRefAnnotation);
- assertEquals(2, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 0).getName());
- assertEquals("foo", CollectionTools.get(xmlElementRefsAnnotation.getXmlElementRefs(), 1).getName());
-
- attributeMapping.getXmlElementRefs().removeXmlElementRef(0);
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefsAnnotation);
- assertNotNull(xmlElementRefAnnotation);
- assertEquals(1, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", xmlElementRefAnnotation.getName());
-
- attributeMapping.getXmlElementRefs().removeXmlElementRef(0);
- xmlElementRefsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertEquals(0, attributeMapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testModifyXmlMixed() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(xmlListAnnotation);
-
- attributeMapping.addXmlMixed();
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(xmlListAnnotation);
-
- attributeMapping.removeXmlMixed();
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- }
-
- public void testUpdateXmlMixed() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAnyElementMapping attributeMapping = (XmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(xmlListAnnotation);
-
-
- //add an XmlMixed annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_MIXED);
- }
- });
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(xmlListAnnotation);
-
- //remove the XmlMixed annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_MIXED);
- }
- });
- xmlListAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(xmlListAnnotation);
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java
deleted file mode 100644
index d78aa5dcf2..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java
+++ /dev/null
@@ -1,727 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-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.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlAttributeMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute");
- }
- });
- }
-
- private ICompilationUnit createTypeWithCollectionXmlAttribute() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append("import javax.xml.bind.annotation.XmlAttribute;").append(CR);
- sb.append("import javax.xml.bind.annotation.XmlType;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" {").append(CR);
- sb.append(" @XmlAttribute").append(CR);
- sb.append(" public List<String> list;").append(CR);
- sb.append("}").append(CR);
- }
- };
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public void testModifyName() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
- assertEquals("id", xmlAttributeMapping.getQName().getDefaultName());
- assertEquals("id", xmlAttributeMapping.getQName().getName());
-
- xmlAttributeMapping.getQName().setSpecifiedName("foo");
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertEquals("foo", xmlAttributeAnnotation.getName());
- assertEquals("foo", xmlAttributeMapping.getQName().getSpecifiedName());
- assertEquals("id", xmlAttributeMapping.getQName().getDefaultName());
- assertEquals("foo", xmlAttributeMapping.getQName().getName());
-
- xmlAttributeMapping.getQName().setSpecifiedName(null);
- xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getName());
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
-
-
- //add a Name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__NAME, "foo");
- }
- });
- assertEquals("foo", xmlAttributeMapping.getQName().getName());
-
- //remove the Name member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlAttributeAnnotation = (NormalAnnotation) GenericJavaXmlAttributeMappingTests.this.getXmlAttributeAnnotation(declaration);
- GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0);
- }
- });
- assertNull(xmlAttributeMapping.getQName().getSpecifiedName());
- }
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
-
- xmlAttributeMapping.getQName().setSpecifiedNamespace("foo");
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertEquals("foo", xmlAttributeAnnotation.getNamespace());
- assertEquals("foo", xmlAttributeMapping.getQName().getNamespace());
-
- xmlAttributeMapping.getQName().setSpecifiedNamespace(null);
- xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getNamespace());
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
-
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", xmlAttributeMapping.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlAttributeAnnotation = (NormalAnnotation) GenericJavaXmlAttributeMappingTests.this.getXmlAttributeAnnotation(declaration);
- GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0);
- }
- });
- assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace());
- }
-
- public void testModifyRequired() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
-
- xmlAttributeMapping.setSpecifiedRequired(Boolean.TRUE);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertEquals(Boolean.TRUE, xmlAttributeAnnotation.getRequired());
- assertEquals(Boolean.TRUE, xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(true, xmlAttributeMapping.isRequired());
-
- xmlAttributeMapping.setSpecifiedRequired(null);
- xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getName());
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
- }
-
- public void testUpdateRequired() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
-
-
- //add a required member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__REQUIRED, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(true, xmlAttributeMapping.isRequired());
-
- //remove the required member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlAttributeAnnotation = (NormalAnnotation) GenericJavaXmlAttributeMappingTests.this.getXmlAttributeAnnotation(declaration);
- GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0);
- }
- });
- assertNull(xmlAttributeMapping.getSpecifiedRequired());
- assertEquals(false, xmlAttributeMapping.isDefaultRequired());
- assertEquals(false, xmlAttributeMapping.isRequired());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlAttributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping attributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- attributeMapping.addXmlJavaTypeAdapter();
-
- assertNotNull(attributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- attributeMapping.removeXmlJavaTypeAdapter();
-
- assertNull(attributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testModifyXmlSchemaType() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
-
- xmlAttributeMapping.addXmlSchemaType();
-
- assertNotNull(xmlAttributeMapping.getXmlSchemaType());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE));
-
- xmlAttributeMapping.removeXmlSchemaType();
-
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- }
-
- public void testUpdateXmlSchemaType() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
-
- //add an XmlSchemaType annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA_TYPE);
- }
- });
-
- assertNotNull(xmlAttributeMapping.getXmlSchemaType());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE));
-
- //remove the XmlSchemaType annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE);
- }
- });
-
- assertNull(xmlAttributeMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- }
-
- protected void addXmlAttributeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlAttributeAnnotation(declaration), name, value);
- }
-
- protected void addXmlAttributeMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlAttributeAnnotation(declaration), name, value);
- }
-
- protected void addXmlAttributeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlAttributeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlAttributeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ATTRIBUTE);
- }
-
- public void testModifyXmlList1() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlAttributeMapping.isXmlList());
- assertFalse(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlAttributeMapping.setSpecifiedXmlList(true);
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertFalse(xmlAttributeMapping.isDefaultXmlList());
- assertTrue(xmlAttributeMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlAttributeMapping.setSpecifiedXmlList(false);
-
- assertFalse(xmlAttributeMapping.isXmlList());
- assertFalse(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testModifyXmlList2() throws Exception {
- createTypeWithCollectionXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertTrue(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlAttributeMapping.setSpecifiedXmlList(true);
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertTrue(xmlAttributeMapping.isDefaultXmlList());
- assertTrue(xmlAttributeMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlAttributeMapping.setSpecifiedXmlList(false);
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertTrue(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testUpdateXmlList1() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlAttributeMapping.isXmlList());
- assertFalse(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertFalse(xmlAttributeMapping.isDefaultXmlList());
- assertTrue(xmlAttributeMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
-
- assertFalse(xmlAttributeMapping.isXmlList());
- assertFalse(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testUpdateXmlList2() throws Exception {
- createTypeWithCollectionXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertTrue(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertTrue(xmlAttributeMapping.isDefaultXmlList());
- assertTrue(xmlAttributeMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlAttributeMapping.isXmlList());
- assertTrue(xmlAttributeMapping.isDefaultXmlList());
- assertFalse(xmlAttributeMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testModifyXmlID() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlAttributeMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
- xmlAttributeMapping.addXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlAttributeMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- xmlAttributeMapping.removeXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- }
-
- public void testUpdateXmlID() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlAttributeMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
-
- //add an XmlID annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlAttributeMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- //remove the XmlID annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlAttributeMapping.getXmlID());
- assertNull(xmlIDAnnotation);
- }
-
- public void testModifyXmlIDREF() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlAttributeMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- xmlAttributeMapping.addXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlAttributeMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- xmlAttributeMapping.removeXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- }
-
- public void testUpdateXmlIDREF() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlAttributeMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
-
- //add an XmlIDREF annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlAttributeMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- //remove the XmlIDREF annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlAttributeMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testModifyXmlAttachmentRef() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
- xmlAttributeMapping.addXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- xmlAttributeMapping.removeXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- public void testUpdateXmlAttachmentRef() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
-
- //add an XmlAttachmentRef annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- //remove the XmlAttachmentRef annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlAttributeMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java
deleted file mode 100644
index df976ef5ec..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java
+++ /dev/null
@@ -1,1050 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-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.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlElementMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement");
- }
- });
- }
-
- private ICompilationUnit createTypeWithCollectionXmlElement() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append("import javax.xml.bind.annotation.XmlElement;").append(CR);
- sb.append("import javax.xml.bind.annotation.XmlType;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" {").append(CR);
- sb.append(" @XmlElement").append(CR);
- sb.append(" public List<String> list;").append(CR);
- sb.append("}").append(CR);
- }
- };
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createXmlTypeWithVariousAttributes() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JAXB.XML_TYPE).append(";").append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TYPE_NAME).append("{").append(CR);
- sb.append(" public String string;").append(CR);
- sb.append(" public List<String> stringList;").append(CR);
- sb.append(" public String[] stringArray;").append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TYPE_NAME + ".java", sourceWriter);
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedName());
- assertEquals("id", xmlElement.getQName().getDefaultName());
- assertEquals("id", xmlElement.getQName().getName());
-
- xmlElement.getQName().setSpecifiedName("foo");
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals("foo", xmlElementAnnotation.getName());
- assertEquals("foo", xmlElement.getQName().getSpecifiedName());
- assertEquals("id", xmlElement.getQName().getDefaultName());
- assertEquals("foo", xmlElement.getQName().getName());
-
- xmlElement.getQName().setSpecifiedName(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElement.getQName().getSpecifiedName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedName());
-
-
- //add a Name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", xmlElement.getQName().getName());
-
- //remove the Name member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getQName().getSpecifiedName());
- }
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
-
- xmlElement.getQName().setSpecifiedNamespace("foo");
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals("foo", xmlElementAnnotation.getNamespace());
- assertEquals("foo", xmlElement.getQName().getNamespace());
-
- xmlElement.getQName().setSpecifiedNamespace(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getNamespace());
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
-
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", xmlElement.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getQName().getSpecifiedNamespace());
- }
-
- public void testModifyRequired() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
-
- xmlElement.setSpecifiedRequired(Boolean.TRUE);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(true, xmlElement.isRequired());
-
- xmlElement.setSpecifiedRequired(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
- }
-
- public void testUpdateRequired() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
-
-
- //add a required member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__REQUIRED, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(true, xmlElement.isRequired());
-
- //remove the required member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getSpecifiedRequired());
- assertEquals(false, xmlElement.isDefaultRequired());
- assertEquals(false, xmlElement.isRequired());
- }
-
- public void testModifyNillable() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
-
- xmlElement.setSpecifiedNillable(Boolean.TRUE);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(true, xmlElement.isNillable());
-
- xmlElement.setSpecifiedNillable(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
- }
-
- public void testUpdateNillable() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
-
-
- //add a nillable member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NILLABLE, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(true, xmlElement.isNillable());
-
- //remove the nillable member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getSpecifiedNillable());
- assertEquals(false, xmlElement.isDefaultNillable());
- assertEquals(false, xmlElement.isNillable());
- }
-
- public void testDefaultNillable() throws Exception {
- createXmlTypeWithVariousAttributes();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
-
- // string
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = persistentAttribute.getJavaResourceAttribute();
-
- assertEquals(false, xmlElement.isDefaultNillable());
-
- annotatedElement(resourceAttribute).edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(false, xmlElement.isDefaultNillable());
-
- // string list
- persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 1);
- xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- xmlElement = xmlElementMapping.getXmlElement();
- resourceAttribute = persistentAttribute.getJavaResourceAttribute();
-
- assertEquals(true, xmlElement.isDefaultNillable());
-
- annotatedElement(resourceAttribute).edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(false, xmlElement.isDefaultNillable());
-
- // string array
- persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 2);
- xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- xmlElement = xmlElementMapping.getXmlElement();
- resourceAttribute = persistentAttribute.getJavaResourceAttribute();
-
- assertEquals(true, xmlElement.isDefaultNillable());
-
- annotatedElement(resourceAttribute).edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT);
- }
- });
-
- assertEquals(false, xmlElement.isDefaultNillable());
- }
-
- public void testModifyDefaultValue() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getDefaultValue());
-
- xmlElement.setDefaultValue("foo");
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertEquals("foo", xmlElementAnnotation.getDefaultValue());
- assertEquals("foo", xmlElement.getDefaultValue());
-
- xmlElement.setDefaultValue(null);
- xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertNull(xmlElement.getDefaultValue());
- }
-
- public void testUpdateDefaultValue() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getDefaultValue());
-
-
- //add a DefaultValue member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__DEFAULT_VALUE, "foo");
- }
- });
- assertEquals("foo", xmlElement.getDefaultValue());
-
- //remove the DefaultValue member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getDefaultValue());
- }
-
- public void testModifyType() throws Exception {
- createTypeWithXmlElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
-
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getType());
- assertEquals("int", xmlElement.getDefaultType());
-
- xmlElement.setSpecifiedType("Foo");
- assertEquals("Foo", xmlElement.getSpecifiedType());
- assertEquals("Foo", xmlElement.getType());
-
- xmlElement.setSpecifiedType(null);
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getType());
- }
-
- public void testUpdateType() throws Exception {
- createTypeWithXmlElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- XmlElement xmlElement = xmlElementMapping.getXmlElement();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getDefaultType());
- assertEquals("int", xmlElement.getType());
-
- //add a Type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addXmlElementTypeMemberValuePair(declaration, JAXB.XML_ELEMENT__TYPE, "Foo");
- }
- });
- assertEquals("Foo", xmlElement.getSpecifiedType());
- assertEquals("Foo", xmlElement.getType());
-
- //remove the Type member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementAnnotation = (NormalAnnotation) GenericJavaXmlElementMappingTests.this.getXmlElementAnnotation(declaration);
- GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0);
- }
- });
- assertNull(xmlElement.getSpecifiedType());
- assertEquals("int", xmlElement.getType());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlElementMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- xmlElementMapping.addXmlJavaTypeAdapter();
-
- assertNotNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- xmlElementMapping.removeXmlJavaTypeAdapter();
-
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(xmlElementMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testModifyXmlSchemaType() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
-
- xmlElementMapping.addXmlSchemaType();
-
- assertNotNull(xmlElementMapping.getXmlSchemaType());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE));
-
- xmlElementMapping.removeXmlSchemaType();
-
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- }
-
- public void testUpdateXmlSchemaType() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
-
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
-
- //add an XmlSchemaType annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA_TYPE);
- }
- });
-
- assertNotNull(xmlElementMapping.getXmlSchemaType());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE));
-
- //remove the XmlSchemaType annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE);
- }
- });
-
- assertNull(xmlElementMapping.getXmlSchemaType());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- }
-
- protected void addXmlElementMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlElementAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlElementAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT);
- }
-
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- xmlElementMapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- xmlElementMapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- public void testUpdateXmlElementWrapper() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
-
- //add an XmlElementWrapper annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- //remove the XmlElementWrapper annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlList1() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlElementMapping.setSpecifiedXmlList(true);
-
- assertTrue(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertTrue(xmlElementMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlElementMapping.setSpecifiedXmlList(false);
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testModifyXmlList2() throws Exception {
- createTypeWithCollectionXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlElementMapping.setSpecifiedXmlList(true);
-
- assertTrue(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertTrue(xmlElementMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlElementMapping.setSpecifiedXmlList(false);
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testUpdateXmlList1() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertTrue(xmlElementMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testUpdateXmlList2() throws Exception {
- createTypeWithCollectionXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertTrue(xmlElementMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
-
- assertFalse(xmlElementMapping.isXmlList());
- assertFalse(xmlElementMapping.isDefaultXmlList());
- assertFalse(xmlElementMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testModifyXmlID() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlElementMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
- xmlElementMapping.addXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlElementMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- xmlElementMapping.removeXmlID();
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- }
-
- public void testUpdateXmlID() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlElementMapping.getXmlID());
- assertNull(xmlIDAnnotation);
-
-
- //add an XmlID annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNotNull(xmlElementMapping.getXmlID());
- assertNotNull(xmlIDAnnotation);
-
- //remove the XmlID annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ID);
- }
- });
- xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertNull(xmlElementMapping.getXmlID());
- assertNull(xmlIDAnnotation);
- }
-
- public void testModifyXmlIDREF() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- xmlElementMapping.addXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlElementMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- xmlElementMapping.removeXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testUpdateXmlIDREF() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
-
- //add an XmlIDREF annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNotNull(xmlElementMapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- //remove the XmlIDREF annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertNull(xmlElementMapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testModifyXmlAttachmentRef() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlElementMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
- xmlElementMapping.addXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlElementMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- xmlElementMapping.removeXmlAttachmentRef();
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- }
-
- public void testUpdateXmlAttachmentRef() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlElementMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
-
-
- //add an XmlAttachmentRef annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNotNull(xmlElementMapping.getXmlAttachmentRef());
- assertNotNull(xmlAttachmentRefAnnotation);
-
- //remove the XmlAttachmentRef annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTACHMENT_REF);
- }
- });
- xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertNull(xmlElementMapping.getXmlAttachmentRef());
- assertNull(xmlAttachmentRefAnnotation);
- }
-
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java
deleted file mode 100644
index 971bb119cd..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java
+++ /dev/null
@@ -1,590 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlElementRefMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlElementRefMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElementRef() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef");
- }
- });
- }
-
- private ICompilationUnit createTypeWithJAXBElementXmlElementRef() throws Exception {
- return this.createTestType(TYPE_NAME + "2", new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REF, JAXB.JAXB_ELEMENT);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef").append(CR);
- sb.append("private JAXBElement foo;").append(CR).append(CR);
- }
- });
- }
-
- private ICompilationUnit createTypeWithRootElementXmlElementRef() throws Exception {
- return this.createTestType(TYPE_NAME + "3", new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REF, JAXB.XML_ROOT_ELEMENT);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlRootElement(name=\"foo\")");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef").append(CR);
- sb.append("private " + TYPE_NAME + "3 foo;").append(CR).append(CR);
- }
- });
- }
-
-
- public void testDefaultName() throws Exception {
- createTypeWithXmlElementRef();
- createTypeWithJAXBElementXmlElementRef(); // FULLY_QUALIFIED_TYPE_NAME + "2"
- createTypeWithRootElementXmlElementRef(); // FULLY_QUALIFIED_TYPE_NAME + "3"
-
- JaxbClass jaxbClass = (JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- // XmlElementRef type is java.lang.String -> no default name or namespace
- assertEquals("", xmlElementRef.getQName().getName());
- assertEquals("", xmlElementRef.getQName().getNamespace());
-
- classMapping = ((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME + "2")).getMapping();
- xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- // XmlElementRef type is JAXBElement -> default name is name of attribute
- assertEquals("foo", xmlElementRef.getQName().getName());
- assertEquals("", xmlElementRef.getQName().getNamespace());
-
- classMapping = ((JaxbClass) getContextRoot().getType(FULLY_QUALIFIED_TYPE_NAME + "3")).getMapping();
- xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- // XmlElementRef type is type with root element -> default name is root element name
- assertEquals("foo", xmlElementRef.getQName().getName());
- assertEquals("", xmlElementRef.getQName().getNamespace());
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedName());
- assertEquals("", xmlElementRef.getQName().getDefaultName());
- assertEquals("", xmlElementRef.getQName().getName());
-
- xmlElementRef.getQName().setSpecifiedName("foo");
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertEquals("foo", xmlElementRefAnnotation.getName());
- assertEquals("foo", xmlElementRef.getQName().getSpecifiedName());
- assertEquals("foo", xmlElementRef.getQName().getName());
-
- xmlElementRef.getQName().setSpecifiedName(null);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRef.getQName().getSpecifiedName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedName());
-
-
- //add a Name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__NAME, "foo");
- }
- });
- assertEquals("foo", xmlElementRef.getQName().getName());
-
- //remove the Name member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getQName().getSpecifiedName());
- }
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
-
- xmlElementRef.getQName().setSpecifiedNamespace("foo");
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertEquals("foo", xmlElementRefAnnotation.getNamespace());
- assertEquals("foo", xmlElementRef.getQName().getNamespace());
-
- xmlElementRef.getQName().setSpecifiedNamespace(null);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
-
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", xmlElementRef.getQName().getNamespace());
-
- //remove the namespace member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getQName().getSpecifiedNamespace());
- }
-
- public void testModifyRequired() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
-
- xmlElementRef.setSpecifiedRequired(Boolean.TRUE);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertEquals(Boolean.TRUE, xmlElementRefAnnotation.getRequired());
- assertEquals(Boolean.TRUE, xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(true, xmlElementRef.isRequired());
-
- xmlElementRef.setSpecifiedRequired(null);
- xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
- }
-
- public void testUpdateRequired() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
-
-
- //add a required member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__REQUIRED, true);
- }
- });
- assertEquals(Boolean.TRUE, xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(true, xmlElementRef.isRequired());
-
- //remove the required member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getSpecifiedRequired());
- assertEquals(false, xmlElementRef.isDefaultRequired());
- assertEquals(false, xmlElementRef.isRequired());
- }
-
- public void testModifyType() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
-
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getType());
- assertEquals("int", xmlElementRef.getDefaultType());
-
- xmlElementRef.setSpecifiedType("Foo");
- assertEquals("Foo", xmlElementRef.getSpecifiedType());
- assertEquals("Foo", xmlElementRef.getType());
-
- xmlElementRef.setSpecifiedType(null);
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getType());
- }
-
- public void testUpdateType() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getDefaultType());
- assertEquals("int", xmlElementRef.getType());
-
- //add a Type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addXmlElementRefTypeMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__TYPE, "Foo");
- }
- });
- assertEquals("Foo", xmlElementRef.getSpecifiedType());
- assertEquals("Foo", xmlElementRef.getType());
-
- //remove the Type member value pair
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation xmlElementRefAnnotation = (NormalAnnotation) GenericJavaXmlElementRefMappingTests.this.getXmlElementRefAnnotation(declaration);
- GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0);
- }
- });
- assertNull(xmlElementRef.getSpecifiedType());
- assertEquals("int", xmlElementRef.getType());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlElementRefMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY);
- xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementRefMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- xmlElementRefMapping.addXmlJavaTypeAdapter();
-
- assertNotNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- xmlElementRefMapping.removeXmlJavaTypeAdapter();
-
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- protected void addXmlElementRefMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementRefAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlElementRefAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlElementRefAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected Annotation getXmlElementRefAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REF);
- }
-
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- xmlElementRefMapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- xmlElementRefMapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- public void testUpdateXmlElementRefWrapper() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- //add an XmlElementWrapper annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- //remove the XmlElementWrapper annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementRefMapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlMixed() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping attributeMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
-
- attributeMapping.addXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(annotation);
-
- attributeMapping.removeXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
- }
-
- public void testUpdateXmlMixed() throws Exception {
- createTypeWithXmlElementRef();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefMapping attributeMapping = (XmlElementRefMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = attributeMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
-
- //add an XmlMixed annotation
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(attributeMapping.getXmlMixed());
- assertNotNull(annotation);
-
- //remove the XmlMixed annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(attributeMapping.getXmlMixed());
- assertNull(annotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java
deleted file mode 100644
index c5468d224f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefsMappingTests.java
+++ /dev/null
@@ -1,411 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRef;
-import org.eclipse.jpt.jaxb.core.context.XmlElementRefsMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlElementRefsMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlElementRefsMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElementRefs() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs");
- }
- });
- }
-
- protected Annotation getXmlElementRefsAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS);
- }
-
- protected void addXmlElementRefsMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- addMemberValuePair((MarkerAnnotation) this.getXmlElementRefsAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefsMemberValuePair(ModifiedDeclaration declaration, String name, boolean value) {
- addMemberValuePair((MarkerAnnotation) getXmlElementRefsAnnotation(declaration), name, value);
- }
-
- protected void addXmlElementRefsTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- addMemberValuePair(
- (MarkerAnnotation) getXmlElementRefsAnnotation(declaration),
- name,
- newTypeLiteral(declaration.getAst(), typeName));
- }
-
-
- // ***** XmlElementRefs *****
-
- protected NormalAnnotation newXmlElementRefAnnotation(AST ast, String name) {
- NormalAnnotation annotation = newNormalAnnotation(ast, JAXB.XML_ELEMENT_REF);
- addMemberValuePair(annotation, JAXB.XML_ELEMENT_REF__NAME, name);
- return annotation;
- }
-
- protected void addXmlElementRef(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = newXmlElementRefAnnotation(declaration.getAst(), name);
- addArrayElement(declaration, JAXB.XML_ELEMENT_REFS, index, JAXB.XML_ELEMENT_REFS__VALUE, arrayElement);
- }
-
- protected void moveXmlElementRef(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS), JAXB.XML_ELEMENT_REFS__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlElementRef(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REFS), JAXB.XML_ELEMENT_REFS__VALUE, index);
- }
-
- public void testSyncXmlElementRefs() throws Exception {
- createTypeWithXmlElementRefs();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<XmlElementRef> xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
- assertTrue(CollectionTools.isEmpty(xmlElementRefs));
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
-
- //add 2 XmlElementRef annotations
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addXmlElementRef(declaration, 0, "foo");
- GenericJavaXmlElementRefsMappingTests.this.addXmlElementRef(declaration, 1, "bar");
- }
- });
-
- xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // switch XmlElementRef annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.moveXmlElementRef(declaration, 0, 1);
- }
- });
-
- xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElementRefs().getXmlElementRefs()));
- assertEquals(2, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("bar", CollectionTools.get(xmlElementRefs, 0).getQName().getName());
- assertEquals("foo", CollectionTools.get(xmlElementRefs, 1).getQName().getName());
-
- // remove XmlElementRef annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeXmlElementRef(declaration, 1);
- GenericJavaXmlElementRefsMappingTests.this.removeXmlElementRef(declaration, 0);
- }
- });
-
- xmlElementRefs = mapping.getXmlElementRefs().getXmlElementRefs();
-
- assertTrue(CollectionTools.isEmpty(xmlElementRefs));
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testModifyXmlElementRefs() throws Exception {
- createTypeWithXmlElementRefs();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlElementRefsAnnotation annotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
-
- Iterable<XmlElementRefAnnotation> annotations = annotation.getXmlElementRefs();
-
- assertEquals(0, annotation.getXmlElementRefsSize());
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
-
- mapping.getXmlElementRefs().addXmlElementRef(0).getQName().setSpecifiedName("foo");
- mapping.getXmlElementRefs().addXmlElementRef(1).getQName().setSpecifiedName("baz");
- mapping.getXmlElementRefs().addXmlElementRef(1).getQName().setSpecifiedName("bar");
-
- annotations = annotation.getXmlElementRefs();
-
- assertEquals(3, annotation.getXmlElementRefsSize());
- assertEquals(3, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(annotations, 0).getName());
- assertEquals("bar", CollectionTools.get(annotations, 1).getName());
- assertEquals("baz", CollectionTools.get(annotations, 2).getName());
-
- mapping.getXmlElementRefs().moveXmlElementRef(1, 2);
-
- annotations = annotation.getXmlElementRefs();
-
- assertEquals(3, annotation.getXmlElementRefsSize());
- assertEquals(3, mapping.getXmlElementRefs().getXmlElementRefsSize());
- assertEquals("foo", CollectionTools.get(annotations, 0).getName());
- assertEquals("baz", CollectionTools.get(annotations, 1).getName());
- assertEquals("bar", CollectionTools.get(annotations, 2).getName());
-
- mapping.getXmlElementRefs().removeXmlElementRef(2);
- mapping.getXmlElementRefs().removeXmlElementRef(0);
- mapping.getXmlElementRefs().removeXmlElementRef(0);
-
- assertEquals(0, annotation.getXmlElementRefsSize());
- assertEquals(0, mapping.getXmlElementRefs().getXmlElementRefsSize());
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(mapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_REFS_ATTRIBUTE_MAPPING_KEY);
- mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- assertNotNull(mapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- mapping.addXmlJavaTypeAdapter();
-
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- mapping.removeXmlJavaTypeAdapter();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- mapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- mapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- }
-
- public void testUpdateXmlElementWrapper() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- //add an XmlElementWrapper annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- //remove the XmlElementWrapper annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlMixed() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
-
- mapping.addXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(mapping.getXmlMixed());
- assertNotNull(annotation);
-
- mapping.removeXmlMixed();
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
- }
-
- public void testUpdateXmlMixed() throws Exception {
- createTypeWithXmlElementRefs();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlElementRefsMapping mapping = (XmlElementRefsMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlMixedAnnotation annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
-
- //add an XmlMixed annotation
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNotNull(mapping.getXmlMixed());
- assertNotNull(annotation);
-
- //remove the XmlMixed annotation
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementRefsMappingTests.this.removeAnnotation(declaration, JAXB.XML_MIXED);
- }
- });
- annotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertNull(mapping.getXmlMixed());
- assertNull(annotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java
deleted file mode 100644
index 74e2a22167..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java
+++ /dev/null
@@ -1,363 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElement;
-import org.eclipse.jpt.jaxb.core.context.XmlElementsMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlElementsMappingTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlElementsMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElements() throws Exception {
- return this.createTestType(
- new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENTS);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements");
- }
- });
- }
-
-
- // ***** XmlElements *****
-
- protected NormalAnnotation newXmlElementAnnotation(AST ast, String name) {
- NormalAnnotation annotation = newNormalAnnotation(ast, JAXB.XML_ELEMENT);
- addMemberValuePair(annotation, JAXB.XML_ELEMENT__NAME, name);
- return annotation;
- }
-
- protected void addXmlElement(ModifiedDeclaration declaration, int index, String name) {
- NormalAnnotation arrayElement = newXmlElementAnnotation(declaration.getAst(), name);
- addArrayElement(declaration, JAXB.XML_ELEMENTS, index, JAXB.XML_ELEMENTS__VALUE, arrayElement);
- }
-
- protected void moveXmlElement(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENTS), JAXB.XML_ELEMENTS__VALUE, targetIndex, sourceIndex);
- }
-
- protected void removeXmlElement(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(JAXB.XML_ELEMENTS), JAXB.XML_ELEMENTS__VALUE, index);
- }
-
- public void testSyncXmlElements() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<XmlElement> xmlElements = mapping.getXmlElements();
- assertTrue(CollectionTools.isEmpty(xmlElements));
- assertEquals(0, mapping.getXmlElementsSize());
-
- //add 2 XmlElement annotations
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addXmlElement(declaration, 0, "foo");
- GenericJavaXmlElementsMappingTests.this.addXmlElement(declaration, 1, "bar");
- }
- });
-
- xmlElements = mapping.getXmlElements();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElements()));
- assertEquals(2, mapping.getXmlElementsSize());
- assertEquals("foo", CollectionTools.get(xmlElements, 0).getQName().getName());
- assertEquals("bar", CollectionTools.get(xmlElements, 1).getQName().getName());
-
- // switch XmlElement annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.moveXmlElement(declaration, 0, 1);
- }
- });
-
- xmlElements = mapping.getXmlElements();
-
- assertFalse(CollectionTools.isEmpty(mapping.getXmlElements()));
- assertEquals(2, mapping.getXmlElementsSize());
- assertEquals("bar", CollectionTools.get(xmlElements, 0).getQName().getName());
- assertEquals("foo", CollectionTools.get(xmlElements, 1).getQName().getName());
-
- // remove XmlElement annotations
- annotatedElement.edit(
- new Member.Editor() {
-
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeXmlElement(declaration, 1);
- GenericJavaXmlElementsMappingTests.this.removeXmlElement(declaration, 0);
- }
- });
-
- xmlElements = mapping.getXmlElements();
-
- assertTrue(CollectionTools.isEmpty(xmlElements));
- assertEquals(0, mapping.getXmlElementsSize());
- }
-
- public void testModifyXmlElements() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlElementsAnnotation xmlElementsAnnotation = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
-
- Iterable<XmlElementAnnotation> xmlElementAnnotations = xmlElementsAnnotation.getXmlElements();
-
- assertEquals(0, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(0, mapping.getXmlElementsSize());
-
- mapping.addXmlElement(0).getQName().setSpecifiedName("foo");
- mapping.addXmlElement(1).getQName().setSpecifiedName("baz");
- mapping.addXmlElement(1).getQName().setSpecifiedName("bar");
-
- xmlElementAnnotations = xmlElementsAnnotation.getXmlElements();
-
- assertEquals(3, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(3, mapping.getXmlElementsSize());
- assertEquals("foo", CollectionTools.get(xmlElementAnnotations, 0).getName());
- assertEquals("bar", CollectionTools.get(xmlElementAnnotations, 1).getName());
- assertEquals("baz", CollectionTools.get(xmlElementAnnotations, 2).getName());
-
- mapping.moveXmlElement(1, 2);
-
- xmlElementAnnotations = xmlElementsAnnotation.getXmlElements();
-
- assertEquals(3, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(3, mapping.getXmlElementsSize());
- assertEquals("foo", CollectionTools.get(xmlElementAnnotations, 0).getName());
- assertEquals("baz", CollectionTools.get(xmlElementAnnotations, 1).getName());
- assertEquals("bar", CollectionTools.get(xmlElementAnnotations, 2).getName());
-
- mapping.removeXmlElement(2);
- mapping.removeXmlElement(0);
- mapping.removeXmlElement(0);
-
- assertEquals(0, xmlElementsAnnotation.getXmlElementsSize());
- assertEquals(0, mapping.getXmlElementsSize());
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- mapping.addXmlJavaTypeAdapter();
-
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- mapping.removeXmlJavaTypeAdapter();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testModifyXmlElementWrapper() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- mapping.addXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- mapping.removeXmlElementWrapper();
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testUpdateXmlElementWrapper() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
-
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(mapping.getXmlElementWrapper());
- assertNotNull(xmlElementWrapperAnnotation);
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(
- ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER);
- }
- });
- xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNull(mapping.getXmlElementWrapper());
- assertNull(xmlElementWrapperAnnotation);
- }
-
- public void testModifyXmlIDREF() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- mapping.addXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNotNull(mapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- mapping.removeXmlIDREF();
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-
- public void testUpdateXmlIDREF() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlElementsMapping mapping = (XmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
-
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNotNull(mapping.getXmlIDREF());
- assertNotNull(xmlIDREFAnnotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlElementsMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF);
- }
- });
- xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
-
- assertNull(mapping.getXmlIDREF());
- assertNull(xmlIDREFAnnotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java
deleted file mode 100644
index c4382408a0..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.beans.Introspector;
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlRootElement;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlRootElementTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlRootElementTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlTypeWithXmlRootElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlRootElement").append(CR);
- }
- });
- }
-
-
- public void testModifyNamespace() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("", contextRootElement.getQName().getDefaultNamespace());
- assertEquals("", contextRootElement.getQName().getNamespace());
-
- contextRootElement.getQName().setSpecifiedNamespace("foo");
- XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", rootElementAnnotation.getNamespace());
- assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextRootElement.getQName().getNamespace());
-
- contextRootElement.getQName().setSpecifiedNamespace(null);
- rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(rootElementAnnotation.getNamespace());
- assertNull(contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("", contextRootElement.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
-
- assertNull(contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("", contextRootElement.getQName().getDefaultNamespace());
- assertEquals("", contextRootElement.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.addXmlRootElementMemberValuePair(declaration, JAXB.XML_ROOT_ELEMENT__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextRootElement.getQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(classMapping.getXmlRootElement());
- }
-
- public void testModifyName() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(contextRootElement.getQName().getSpecifiedName());
- assertEquals(defaultName, contextRootElement.getQName().getDefaultName());
- assertEquals(defaultName, contextRootElement.getQName().getName());
-
- contextRootElement.getQName().setSpecifiedName("foo");
- XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertEquals("foo", rootElementAnnotation.getName());
- assertEquals("foo", contextRootElement.getQName().getSpecifiedName());
- assertEquals("foo", contextRootElement.getQName().getName());
-
- contextRootElement.getQName().setSpecifiedName(null);
- rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(rootElementAnnotation.getName());
- assertNull(contextRootElement.getQName().getSpecifiedName());
- assertEquals(defaultName, contextRootElement.getQName().getName());
- }
-
- public void testUpdateName() throws Exception {
- createTypeWithXmlTypeWithXmlRootElement();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlRootElement contextRootElement = classMapping.getXmlRootElement();
- JavaResourceAbstractType resourceType = jaxbClass.getJavaResourceType();
- String defaultName = Introspector.decapitalize(TYPE_NAME);
-
- assertNull(contextRootElement.getQName().getSpecifiedName());
- assertEquals(defaultName, contextRootElement.getQName().getDefaultName());
- assertEquals(defaultName, contextRootElement.getQName().getName());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.addXmlRootElementMemberValuePair(declaration, JAXB.XML_ROOT_ELEMENT__NAME, "foo");
- }
- });
- assertEquals("foo", contextRootElement.getQName().getSpecifiedName());
- assertEquals("foo", contextRootElement.getQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT);
- }
- });
- assertNull(classMapping.getXmlRootElement());
- }
-
- protected void addXmlRootElementMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlRootElementAnnotation(declaration), name, value);
- }
-
- protected Annotation getXmlRootElementAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_ROOT_ELEMENT);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
deleted file mode 100644
index 05f0a4c3a3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
+++ /dev/null
@@ -1,669 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.context.XmlNs;
-import org.eclipse.jpt.jaxb.core.context.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.context.XmlSchema;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlSchemaTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithXmlSchema() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema",
- JAXB.XML_SCHEMA);
- }
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- public void testModifyNamespace() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
-
- contextXmlSchema.setSpecifiedNamespace("foo");
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getNamespace());
- assertEquals("foo", contextXmlSchema.getNamespace());
- assertEquals("foo", contextXmlSchema.getSpecifiedNamespace());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedNamespace(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getNamespace());
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
-
- //set namespace again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedNamespace("foo");
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getNamespace());
- assertEquals("foo", contextXmlSchema.getSpecifiedNamespace());
- assertEquals("foo", contextXmlSchema.getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaMemberValuePair(declaration, JAXB.XML_SCHEMA__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", contextXmlSchema.getNamespace());
- assertEquals("foo", contextXmlSchema.getSpecifiedNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertEquals("", contextXmlSchema.getNamespace());
- assertNull(contextXmlSchema.getSpecifiedNamespace());
- }
-
- public void testModifyLocation() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getLocation());
-
- contextXmlSchema.setLocation("foo");
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getLocation());
- assertEquals("foo", contextXmlSchema.getLocation());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setLocation(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getLocation());
- assertNull(contextXmlSchema.getLocation());
-
- //set location again, this time starting with no XmlSchema annotation
- contextXmlSchema.setLocation("foo");
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals("foo", schemaAnnotation.getLocation());
- assertEquals("foo", contextXmlSchema.getLocation());
- }
-
- public void testUpdateLocation() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getLocation());
-
- //add a location member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaMemberValuePair(declaration, JAXB.XML_SCHEMA__LOCATION, "foo");
- }
- });
-
- assertEquals("foo", contextXmlSchema.getLocation());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertNull(contextXmlSchema.getLocation());
- }
-
- public void testModifyAttributeFormDefault() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
-
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED);
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedAttributeFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getAttributeFormDefault());
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
-
- //set attribute form default again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
- }
-
- public void testUpdateAttributeFormDefault() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
-
- //set the attribute form default value to QUALIFIED
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT,
- JAXB.XML_NS_FORM__QUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- //set the attribute form default value to UNQUALIFIED
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.setXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ATTRIBUTE_FORM_DEFAULT,
- JAXB.XML_NS_FORM__UNQUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getAttributeFormDefault());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
-
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
- }
-
- public void testModifyElementFormDefault() throws Exception {
- createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
-
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED);
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
-
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getElementFormDefault());
-
- //set another annotation so the context model is not blown away by removing the XmlSchema annotation
- contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedElementFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getElementFormDefault());
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
-
- //set element form default again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED);
- schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
- }
-
- public void testUpdateElementFormDefault() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
-
- //set the element form default value to QUALIFIED
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT,
- JAXB.XML_NS_FORM__QUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
-
- //set the element form default value to UNQUALIFIED
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.setXmlSchemaEnumMemberValuePair(
- declaration,
- JAXB.XML_SCHEMA__ELEMENT_FORM_DEFAULT,
- JAXB.XML_NS_FORM__UNQUALIFIED);
- }
- });
-
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getElementFormDefault());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlSchemaAnnotation(declaration);
- }
- });
-
- contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
- }
-
- public void testGetXmlNsPrefixes() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlNs> xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- assertFalse(xmlNsPrefixes.iterator().hasNext());
-
- //add 2 XmlNs prefixes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 0, "bar", "barPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 1, "foo", "fooPrefix");
- }
- });
-
- xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- ListIterator<XmlNs> xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- XmlNs xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
- }
-
- protected void addXmlNs(ModifiedDeclaration declaration, int index, String namespaceURI, String prefix) {
- NormalAnnotation arrayElement = this.newXmlNsAnnotation(declaration.getAst(), namespaceURI, prefix);
- this.addArrayElement(declaration, JAXB.XML_SCHEMA, index, JAXB.XML_SCHEMA__XMLNS, arrayElement);
- }
-
- protected NormalAnnotation newXmlNsAnnotation(AST ast, String namespaceURI, String prefix) {
- NormalAnnotation annotation = this.newNormalAnnotation(ast, JAXB.XML_NS);
- this.addMemberValuePair(annotation, JAXB.XML_NS__NAMESPACE_URI, namespaceURI);
- this.addMemberValuePair(annotation, JAXB.XML_NS__PREFIX, prefix);
- return annotation;
- }
-
- public void testGetXmlNsPrexiesSize() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertEquals(0, contextXmlSchema.getXmlNsPrefixesSize());
-
- //add 2 XmlNs prefixes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 0, "bar", "barPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 1, "foo", "fooPrefix");
- }
- });
- assertEquals(2, contextXmlSchema.getXmlNsPrefixesSize());
- }
-
- public void testAddXmlNsPrefix() throws Exception {
- //create a package info with an annotation other than XmlSchema to test
- //adding things to the null schema annotation
- this.createPackageInfoWithAccessorType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- XmlNs xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("bar");
- xmlNsPrefix.setPrefix("barPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("foo");
- xmlNsPrefix.setPrefix("fooPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("baz");
- xmlNsPrefix.setPrefix("bazPrefix");
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- ListIterator<XmlNsAnnotation> xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
-
- XmlNsAnnotation xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("baz", xmlNsAnnotation.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("foo", xmlNsAnnotation.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("bar", xmlNsAnnotation.getNamespaceURI());
- assertEquals("barPrefix", xmlNsAnnotation.getPrefix());
- assertFalse(xmlNsPrefixes.hasNext());
- }
-
- public void testAddXmlNsPrefix2() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- XmlNs xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("bar");
- xmlNsPrefix.setPrefix("barPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(1);
- xmlNsPrefix.setNamespaceURI("foo");
- xmlNsPrefix.setPrefix("fooPrefix");
- xmlNsPrefix = contextXmlSchema.addXmlNsPrefix(0);
- xmlNsPrefix.setNamespaceURI("baz");
- xmlNsPrefix.setPrefix("bazPrefix");
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- ListIterator<XmlNsAnnotation> xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
-
- XmlNsAnnotation xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("baz", xmlNsAnnotation.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("bar", xmlNsAnnotation.getNamespaceURI());
- assertEquals("barPrefix", xmlNsAnnotation.getPrefix());
- xmlNsAnnotation = xmlNsPrefixes.next();
- assertEquals("foo", xmlNsAnnotation.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsAnnotation.getPrefix());
- assertFalse(xmlNsPrefixes.hasNext());
- }
-
- public void testRemoveXmlNsPrefix() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextXmlSchema.addXmlNsPrefix(0).setNamespaceURI("bar");
- contextXmlSchema.addXmlNsPrefix(1).setNamespaceURI("foo");
- contextXmlSchema.addXmlNsPrefix(2).setNamespaceURI("baz");
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
- assertEquals(3, schemaAnnotation.getXmlnsSize());
-
- contextXmlSchema.removeXmlNsPrefix(1);
-
- ListIterator<XmlNsAnnotation> xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("baz", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- contextXmlSchema.removeXmlNsPrefix(1);
- xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- contextXmlSchema.removeXmlNsPrefix(0);
- xmlNsPrefixes = schemaAnnotation.getXmlns().iterator();
- assertFalse(xmlNsPrefixes.hasNext());
- }
-
- public void testMoveXmlNsPrefix() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- contextXmlSchema.addXmlNsPrefix(0).setNamespaceURI("bar");
- contextXmlSchema.addXmlNsPrefix(1).setNamespaceURI("foo");
- contextXmlSchema.addXmlNsPrefix(2).setNamespaceURI("baz");
-
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA);
-
- assertEquals(3, schemaAnnotation.getXmlnsSize());
-
- contextXmlSchema.moveXmlNsPrefix(2, 0);
- ListIterator<XmlNs> xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes().iterator();
- assertEquals("foo", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("baz", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- ListIterator<XmlNsAnnotation> xmlNsAnnotations = schemaAnnotation.getXmlns().iterator();
- assertEquals("foo", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("baz", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("bar", xmlNsAnnotations.next().getNamespaceURI());
-
-
- contextXmlSchema.moveXmlNsPrefix(0, 1);
- xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes().iterator();
- assertEquals("baz", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("foo", xmlNsPrefixes.next().getNamespaceURI());
- assertEquals("bar", xmlNsPrefixes.next().getNamespaceURI());
- assertFalse(xmlNsPrefixes.hasNext());
-
- xmlNsAnnotations = schemaAnnotation.getXmlns().iterator();
- assertEquals("baz", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("foo", xmlNsAnnotations.next().getNamespaceURI());
- assertEquals("bar", xmlNsAnnotations.next().getNamespaceURI());
- }
-
- public void testSyncXmlNsPrefixes() throws Exception {
- this.createPackageInfoWithXmlSchema();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- ListIterable<XmlNs> xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- assertFalse(xmlNsPrefixes.iterator().hasNext());
-
- //add 3 XmlNs prefixes
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 0, "bar", "barPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 1, "foo", "fooPrefix");
- GenericJavaXmlSchemaTests.this.addXmlNs(declaration, 2, "baz", "bazPrefix");
- }
- });
-
- xmlNsPrefixes = contextXmlSchema.getXmlNsPrefixes();
- ListIterator<XmlNs> xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- XmlNs xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.moveXmlNsPrefix(declaration, 2, 0);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.moveXmlNsPrefix(declaration, 0, 1);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("foo", xmlNsPref.getNamespaceURI());
- assertEquals("fooPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlNsPrefix(declaration, 1);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("bar", xmlNsPref.getNamespaceURI());
- assertEquals("barPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlNsPrefix(declaration, 1);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertTrue(xmlNsPrefixesIterator.hasNext());
- xmlNsPref = xmlNsPrefixesIterator.next();
- assertEquals("baz", xmlNsPref.getNamespaceURI());
- assertEquals("bazPrefix", xmlNsPref.getPrefix());
- assertFalse(xmlNsPrefixesIterator.hasNext());
-
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTests.this.removeXmlNsPrefix(declaration, 0);
- }
- });
-
- xmlNsPrefixesIterator = xmlNsPrefixes.iterator();
- assertFalse(xmlNsPrefixesIterator.hasNext());
- }
-
- protected void addXmlSchemaEnumMemberValuePair(ModifiedDeclaration declaration, String elementName, String value) {
- this.addEnumMemberValuePair((MarkerAnnotation) this.getXmlSchemaAnnotation(declaration), elementName, value);
- }
-
- protected void setXmlSchemaEnumMemberValuePair(ModifiedDeclaration declaration, String elementName, String enumValue) {
- this.setEnumMemberValuePair((NormalAnnotation) this.getXmlSchemaAnnotation(declaration), elementName, enumValue);
- }
-
- protected void addXmlSchemaMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlSchemaAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlSchema annotation. Only "annotated" packages are added to the context model
- protected void removeXmlSchemaAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_SCHEMA);
- }
-
- protected Annotation getXmlSchemaAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_SCHEMA);
- }
-
- protected void moveXmlNsPrefix(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- this.moveArrayElement((NormalAnnotation) getXmlSchemaAnnotation(declaration), JAXB.XML_SCHEMA__XMLNS, targetIndex, sourceIndex);
- }
-
- protected void removeXmlNsPrefix(ModifiedDeclaration declaration, int index) {
- this.removeArrayElement((NormalAnnotation) getXmlSchemaAnnotation(declaration), JAXB.XML_SCHEMA__XMLNS, index);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
deleted file mode 100644
index 412482cabb..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
+++ /dev/null
@@ -1,206 +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.tests.internal.context.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
-import org.eclipse.jpt.jaxb.core.context.XmlSchemaType;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-import org.eclipse.xsd.util.XSDUtil;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlSchemaTypeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createPackageInfoWithXmlSchemaType() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- public void testModifyName() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getName());
-
- contextXmlSchemaType.getQName().setSpecifiedName("foo");
- XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertEquals("foo", schemaTypeAnnotation.getName());
- assertEquals("foo", contextXmlSchemaType.getQName().getName());
-
- //verify the xml schema type annotation is not removed when the name is set to null
- contextXmlSchemaType.getQName().setSpecifiedName(null);
- schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(schemaTypeAnnotation.getName());
- assertNull(contextXmlSchemaType.getQName().getName());
- }
-
- public void testUpdateName() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getName());
-
- //add a name member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAME, "foo");
- }
- });
- assertEquals("foo", contextXmlSchemaType.getQName().getName());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.removeXmlSchemaTypeAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlSchemaTypes().iterator().hasNext());
- }
-
- public void testModifyNamespace() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getDefaultNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace());
-
- contextXmlSchemaType.getQName().setSpecifiedNamespace("foo");
- XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertEquals("foo", schemaTypeAnnotation.getNamespace());
- assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextXmlSchemaType.getQName().getNamespace());
-
- //verify the xml schema type annotation is not removed when the namespace is set to null
- contextXmlSchemaType.getQName().setSpecifiedNamespace(null);
- schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(schemaTypeAnnotation.getNamespace());
- assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace());
- }
-
- public void testUpdateNamespace() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getDefaultNamespace());
- assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace());
-
- //add a namespace member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAMESPACE, "foo");
- }
- });
- assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace());
- assertEquals("foo", contextXmlSchemaType.getQName().getNamespace());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.removeXmlSchemaTypeAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlSchemaTypes().iterator().hasNext());
- }
-
- public void testModifyType() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getType());
-
- contextXmlSchemaType.setType("foo");
- XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertEquals("foo", schemaTypeAnnotation.getType());
- assertEquals("foo", contextXmlSchemaType.getType());
-
- //verify the xml schema type annotation is not removed when the type is set to null
- contextXmlSchemaType.setType(null);
- schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertNull(schemaTypeAnnotation.getType());
- assertNull(contextXmlSchemaType.getType());
- }
-
- public void testUpdateType() throws Exception {
- this.createPackageInfoWithXmlSchemaType();
- JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo();
- XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
- JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
-
- assertNull(contextXmlSchemaType.getType());
-
- //add a type member value pair
- AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__TYPE, "String");
- }
- });
- assertEquals("String", contextXmlSchemaType.getType());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSchemaTypeTests.this.removeXmlSchemaTypeAnnotation(declaration);
- }
- });
- assertFalse(contextPackageInfo.getXmlSchemaTypes().iterator().hasNext());
- }
-
- protected void addXmlSchemaTypeTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) {
- this.addMemberValuePair(
- (MarkerAnnotation) this.getXmlSchemaTypeAnnotation(declaration),
- name,
- this.newTypeLiteral(declaration.getAst(), typeName));
- }
-
- protected void addXmlSchemaTypeMemberValuePair(ModifiedDeclaration declaration, String name, String value) {
- this.addMemberValuePair((MarkerAnnotation) this.getXmlSchemaTypeAnnotation(declaration), name, value);
- }
-
- //add another package annotation so that the context model object doesn't get removed when
- //removing the XmlSchemaType annotation. Only "annotated" packages are added to the context model
- protected void removeXmlSchemaTypeAnnotation(ModifiedDeclaration declaration) {
- this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER);
- this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE);
- }
-
- protected Annotation getXmlSchemaTypeAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPE);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java
deleted file mode 100644
index 0ede8a964d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSeeAlsoTests.java
+++ /dev/null
@@ -1,152 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlSeeAlso;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-public class GenericJavaXmlSeeAlsoTests
- extends JaxbContextModelTestCase {
-
- public GenericJavaXmlSeeAlsoTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createAnnotatedPersistentClassWithXmlSeeAlso() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_SEE_ALSO);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType" + CR);
- sb.append("@XmlSeeAlso");
- }
- });
- }
-
- public void testModifyClasses() throws Exception {
- createAnnotatedPersistentClassWithXmlSeeAlso();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlSeeAlso contextXmlSeeAlso = classMapping.getXmlSeeAlso();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- assertEquals(0, contextXmlSeeAlso.getClassesSize());
-
- // add a class
- contextXmlSeeAlso.addClass(0, "foo");
- XmlSeeAlsoAnnotation annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(1, annotation.getClassesSize());
- assertTrue(CollectionTools.contains(annotation.getClasses(), "foo"));
- assertFalse(CollectionTools.contains(annotation.getClasses(), "bar"));
-
- // add another
- contextXmlSeeAlso.addClass(0, "bar");
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(2, annotation.getClassesSize());
- assertTrue(CollectionTools.contains(annotation.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(annotation.getClasses(), "bar"));
-
- // remove one
- contextXmlSeeAlso.removeClass(1);
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(1, annotation.getClassesSize());
- assertFalse(CollectionTools.contains(annotation.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(annotation.getClasses(), "bar"));
-
- // remove the other
- contextXmlSeeAlso.removeClass(0);
- annotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertEquals(0, annotation.getClassesSize());
- assertFalse(CollectionTools.contains(annotation.getClasses(), "bar"));
- assertFalse(CollectionTools.contains(annotation.getClasses(), "foo"));
- }
-
- public void testUpdateClasses() throws Exception {
- createAnnotatedPersistentClassWithXmlSeeAlso();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- XmlSeeAlso contextXmlSeeAlso = classMapping.getXmlSeeAlso();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
- AnnotatedElement annotatedElement = annotatedElement(resourceType);
-
- assertEquals(0, contextXmlSeeAlso.getClassesSize());
-
- // add a class
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.addClass(declaration, 0, "foo");
- }
- });
- assertEquals(1, contextXmlSeeAlso.getClassesSize());
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
-
- // add another
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.addClass(declaration, 0, "bar");
- }
- });
- assertEquals(2, contextXmlSeeAlso.getClassesSize());
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
-
- // remove one
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.removeClass(declaration, 1);
- }
- });
- assertEquals(1, contextXmlSeeAlso.getClassesSize());
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- assertTrue(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
-
- // remove the other
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlSeeAlsoTests.this.removeClass(declaration, 0);
- }
- });
- assertEquals(0, contextXmlSeeAlso.getClassesSize());
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "bar"));
- assertFalse(CollectionTools.contains(contextXmlSeeAlso.getClasses(), "foo"));
- }
-
- protected void addClass(ModifiedDeclaration declaration, int index, String clazz) {
- addArrayElement(declaration, JAXB.XML_SEE_ALSO, index, JAXB.XML_SEE_ALSO__VALUE, newTypeLiteral(declaration.getAst(), clazz));
- }
-
- protected void removeClass(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) getXmlSeeAlsoAnnotation(declaration), JAXB.XML_SEE_ALSO__VALUE, index);
- }
-
- protected Annotation getXmlSeeAlsoAnnotation(ModifiedDeclaration declaration) {
- return declaration.getAnnotationNamed(JAXB.XML_SEE_ALSO);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java
deleted file mode 100644
index 09e047f796..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java
+++ /dev/null
@@ -1,304 +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.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlElementMapping;
-import org.eclipse.jpt.jaxb.core.context.XmlValueMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaXmlValueMappingTests extends JaxbContextModelTestCase
-{
-
- public GenericJavaXmlValueMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlValue");
- }
- });
- }
-
- private ICompilationUnit createTypeWithCollectionXmlValue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import java.util.List;").append(CR);
- sb.append("import javax.xml.bind.annotation.XmlValue;").append(CR);
- sb.append("import javax.xml.bind.annotation.XmlType;").append(CR);
- sb.append(CR);
- sb.append("@XmlType").append(CR);
- sb.append("public class ").append(TYPE_NAME).append(" {").append(CR);
- sb.append(" @XmlValue").append(CR);
- sb.append(" public List<String> list;").append(CR);
- sb.append("}").append(CR);
- }
- };
- return this.javaProject.createCompilationUnit(PACKAGE_NAME, TYPE_NAME + ".java", sourceWriter);
- }
-
- public void testChangeMappingType() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClassMapping classMapping = ((JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNotNull(xmlValueMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping();
- assertNotNull(xmlAttributeMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY);
- xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- assertNotNull(xmlValueMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE));
-
-
- persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping();
- assertNotNull(xmlElementMapping);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
-
- persistentAttribute.setMappingKey(MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY);
- xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- assertNotNull(xmlValueMapping);
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE));
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- }
-
- public void testModifyXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClassMapping classMapping = ((JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping mapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- mapping.addXmlJavaTypeAdapter();
-
- assertNotNull(mapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- mapping.removeXmlJavaTypeAdapter();
-
- assertNull(mapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testUpdateXmlJavaTypeAdapter() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClassMapping classMapping = ((JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0)).getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //add an XmlJavaTypeAdapter annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNotNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertNotNull(resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER));
-
- //remove the XmlJavaTypeAdapter annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- });
-
- assertNull(xmlValueMapping.getXmlJavaTypeAdapter());
- assertEquals(0, resourceAttribute.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- }
-
- public void testModifyXmlList1() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlMapping.isXmlList());
- assertFalse(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlMapping.setSpecifiedXmlList(true);
-
- assertTrue(xmlMapping.isXmlList());
- assertFalse(xmlMapping.isDefaultXmlList());
- assertTrue(xmlMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlMapping.setSpecifiedXmlList(false);
-
- assertFalse(xmlMapping.isXmlList());
- assertFalse(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testModifyXmlList2() throws Exception {
- createTypeWithCollectionXmlValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertTrue(xmlMapping.isXmlList());
- assertTrue(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlMapping.setSpecifiedXmlList(true);
-
- assertTrue(xmlMapping.isXmlList());
- assertTrue(xmlMapping.isDefaultXmlList());
- assertTrue(xmlMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- xmlMapping.setSpecifiedXmlList(false);
-
- assertTrue(xmlMapping.isXmlList());
- assertTrue(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testUpdateXmlList1() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertFalse(xmlMapping.isXmlList());
- assertFalse(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlMapping.isXmlList());
- assertFalse(xmlMapping.isDefaultXmlList());
- assertTrue(xmlMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
-
- assertFalse(xmlMapping.isXmlList());
- assertFalse(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-
- public void testUpdateXmlList2() throws Exception {
- createTypeWithCollectionXmlValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- XmlValueMapping xmlMapping = (XmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = xmlMapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertTrue(xmlMapping.isXmlList());
- assertTrue(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //add an XmlList annotation
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlMapping.isXmlList());
- assertTrue(xmlMapping.isDefaultXmlList());
- assertTrue(xmlMapping.isSpecifiedXmlList());
- assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
-
- //remove the XmlList annotation
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- GenericJavaXmlValueMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST);
- }
- });
-
- assertTrue(xmlMapping.isXmlList());
- assertTrue(xmlMapping.isDefaultXmlList());
- assertFalse(xmlMapping.isSpecifiedXmlList());
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_LIST));
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java
deleted file mode 100644
index 5ff192e9f1..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/JaxbCoreJavaContextModelTests.java
+++ /dev/null
@@ -1,52 +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.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JaxbCoreJavaContextModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreJavaContextModelTests.class.getName());
- suite.addTestSuite(GenericJavaElementFactoryMethodTests.class);
- suite.addTestSuite(GenericJavaEnumConstantTests.class);
- suite.addTestSuite(GenericJavaPackageInfoTests.class);
- suite.addTestSuite(GenericJavaPersistentAttributeTests.class);
- suite.addTestSuite(GenericJavaClassMappingTests.class);
- suite.addTestSuite(GenericJavaEnumMappingTests.class);
- suite.addTestSuite(GenericJavaRegistryTests.class);
- suite.addTestSuite(GenericJavaXmlAdapterTests.class);
- suite.addTestSuite(GenericJavaXmlAnyAttributeMappingTests.class);
- suite.addTestSuite(GenericJavaXmlAnyElementMappingTests.class);
- suite.addTestSuite(GenericJavaXmlAttributeMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementRefMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementRefsMappingTests.class);
- suite.addTestSuite(GenericJavaXmlElementsMappingTests.class);
- suite.addTestSuite(GenericJavaPackageXmlJavaTypeAdapterTests.class);
- suite.addTestSuite(GenericJavaTypeXmlJavaTypeAdapterTests.class);
- suite.addTestSuite(GenericJavaAttributeXmlJavaTypeAdapterTests.class);
- suite.addTestSuite(GenericJavaXmlRootElementTests.class);
- suite.addTestSuite(GenericJavaXmlSchemaTests.class);
- suite.addTestSuite(GenericJavaXmlSchemaTypeTests.class);
- suite.addTestSuite(GenericJavaXmlSeeAlsoTests.class);
- suite.addTestSuite(GenericJavaXmlValueMappingTests.class);
- return suite;
- }
-
-
- private JaxbCoreJavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
deleted file mode 100644
index bba329c672..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/projects/TestJaxbProject.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.command.Command;
-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.JaxbProject;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * This builds and holds a "JAXB" project.
- * Support for adding packages and types.
- *
- * The JPA project's settings (platform, database connection, etc.) can be
- * controlled by building a data model and passing it into the constructor.
- */
-public class TestJaxbProject
- extends TestJavaProject {
-
- private final JaxbProject jaxbProject;
-
-
- // ***** static methods *****
-
- public static final String JAXB_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jaxb.jar";
- public static final String ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.eclipselink.jar";
-
- public static String jaxbJarName() {
- return getSystemProperty(JAXB_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- public static String eclipselinkJarName() {
- return getSystemProperty(ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
-
- // ********** builders **********
-
- public static TestJaxbProject buildJaxbProject(
- String baseProjectName, boolean autoBuild, IDataModel config)
- throws CoreException {
- return new TestJaxbProject(baseProjectName, autoBuild, config);
- }
-
-
- // ********** constructors/initialization **********
-
- public TestJaxbProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJaxbProject(String projectName, boolean autoBuild) throws CoreException {
- this(projectName, autoBuild, null);
- }
-
- public TestJaxbProject(String projectName, boolean autoBuild, IDataModel config) throws CoreException {
- super(projectName, autoBuild);
- String jaxbFacetVersion =
- ((IProjectFacetVersion) config.getProperty(IFacetDataModelProperties.FACET_VERSION)).getVersionString();
- this.installFacet(JaxbFacet.ID, jaxbFacetVersion, config);
- this.addJar(jaxbJarName());
- if (eclipselinkJarName() != null) {
- this.addJar(eclipselinkJarName());
- }
- this.jaxbProject = JptJaxbCorePlugin.getJaxbProject(this.getProject());
- this.jaxbProject.setContextModelSynchronizer(this.buildSynchronousContextModelSynchronizer());
- this.jaxbProject.setUpdateSynchronizer(this.buildSynchronousUpdateSynchronizer());
- }
-
- protected Synchronizer buildSynchronousContextModelSynchronizer() {
- return new SynchronousSynchronizer(this.buildSynchronousContextModelSynchronizerCommand());
- }
-
- protected Command buildSynchronousContextModelSynchronizerCommand() {
- return new SynchronousContextModelSynchronizerCommand();
- }
-
- protected class SynchronousContextModelSynchronizerCommand implements Command {
- public void execute() {
- TestJaxbProject.this.jaxbProject.synchronizeContextModel(new NullProgressMonitor());
- }
- }
-
- protected CallbackSynchronizer buildSynchronousUpdateSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildSynchronousUpdateSynchronizerCommand());
- }
-
- protected Command buildSynchronousUpdateSynchronizerCommand() {
- return new SynchronousUpdateSynchronizerCommand();
- }
-
- protected class SynchronousUpdateSynchronizerCommand implements Command {
- public void execute() {
- TestJaxbProject.this.jaxbProject.update(new NullProgressMonitor());
- }
- }
-
-
- // ********** public methods **********
-
- public JaxbProject getJaxbProject() {
- return this.jaxbProject;
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.java
deleted file mode 100644
index 86faa8d47d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbCoreResourceModelTests.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.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.jpt.jaxb.core.tests.internal.JaxbCoreTests;
-import org.eclipse.jpt.jaxb.core.tests.internal.resource.java.JaxbJavaResourceModelTests;
-
-
-public class JaxbCoreResourceModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbCoreResourceModelTests.class.getName());
-
- if (JaxbCoreTests.requiredJarsExists()) {
- suite.addTestSuite(JaxbIndexResourceTests.class);
- suite.addTestSuite(JaxbPropertiesResourceTests.class);
- suite.addTest(JaxbJavaResourceModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JaxbCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JaxbCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java
deleted file mode 100644
index e066113983..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbIndexResourceTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbindex.JaxbIndexResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.resource.jaxbindex.JaxbIndexResource;
-
-
-public class JaxbIndexResourceTests
- extends AnnotationTestCase {
-
- private static String JAXB_INDEX = "jaxb.index";
-
-
- public JaxbIndexResourceTests(String name) {
- super(name);
- }
-
-
- private IFile createJaxbIndex(IPath projectRelativePath, String... classNames) throws Exception {
- IFolder folder = getJavaProject().getProject().getFolder(projectRelativePath);
- if (! folder.exists()) {
- folder.create(true, false, null);
- }
- IFile jaxbIndex = getJavaProject().getProject().getFile(projectRelativePath.append(new Path(JAXB_INDEX)));
- InputStream stream = inputStream(classNames);
- jaxbIndex.create(stream, true, null);
- return jaxbIndex;
- }
-
- private void setClassNames(IFile jaxbIndex, String... classNames) throws Exception {
- jaxbIndex.setContents(inputStream(classNames), true, false, null);
- }
-
- private InputStream inputStream(String... classNames) {
- StringBuffer sb = new StringBuffer();
- for (String className : classNames) {
- sb.append(className + CR);
- }
- return new ByteArrayInputStream(sb.toString().getBytes());
- }
-
- public void testUpdateClasses() throws Exception {
- IFile jaxbIndex = createJaxbIndex(new Path("src/test"), "foo", "bar");
- JaxbIndexResource resource = JaxbIndexResourceModelProvider.instance().buildResourceModel(jaxbIndex);
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"test.foo", "test.bar"})));
-
- setClassNames(jaxbIndex, "foo", "bar", "baz");
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"test.foo", "test.bar", "test.baz"})));
-
- setClassNames(jaxbIndex);
-
- assertTrue(CollectionTools.isEmpty(resource.getFullyQualifiedClassNames()));
-
- jaxbIndex = createJaxbIndex(new Path("src"), "foo", "bar");
- resource = JaxbIndexResourceModelProvider.instance().buildResourceModel(jaxbIndex);
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"foo", "bar"})));
-
- setClassNames(jaxbIndex, "foo", "bar", "baz");
-
- assertTrue(CollectionTools.elementsAreEqual(
- resource.getFullyQualifiedClassNames(),
- new ArrayIterable<String>(new String[] {"foo", "bar", "baz"})));
-
- setClassNames(jaxbIndex);
-
- assertTrue(CollectionTools.isEmpty(resource.getFullyQualifiedClassNames()));
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java
deleted file mode 100644
index bc0684fc7a..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/JaxbPropertiesResourceTests.java
+++ /dev/null
@@ -1,76 +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.tests.internal.resource;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.jaxb.core.internal.resource.jaxbprops.JaxbPropertiesResourceModelProvider;
-import org.eclipse.jpt.jaxb.core.resource.jaxbprops.JaxbPropertiesResource;
-
-
-public class JaxbPropertiesResourceTests
- extends AnnotationTestCase {
-
- private static String JAXB_PROPERTIES = "jaxb.properties";
-
-
- public JaxbPropertiesResourceTests(String name) {
- super(name);
- }
-
-
- private IFile createJaxbProperties(IPath projectRelativePath, String[] ... propertyValuePairs) throws Exception {
- IFolder folder = getJavaProject().getProject().getFolder(projectRelativePath);
- if (! folder.exists()) {
- folder.create(true, false, null);
- }
- IFile jaxbProperties = getJavaProject().getProject().getFile(projectRelativePath.append(new Path(JAXB_PROPERTIES)));
- InputStream stream = inputStream(propertyValuePairs);
- jaxbProperties.create(stream, true, null);
- return jaxbProperties;
- }
-
- private void setProperties(IFile jaxbProperties, String[] ... propertyValuePairs) throws Exception {
- jaxbProperties.setContents(inputStream(propertyValuePairs), true, false, null);
- }
-
- private InputStream inputStream(String[] ... propertyValuePairs) {
- StringBuffer sb = new StringBuffer();
- for (String[] propertyValuePair : propertyValuePairs) {
- sb.append(propertyValuePair[0] + "=" + propertyValuePair[1] + CR);
- }
- return new ByteArrayInputStream(sb.toString().getBytes());
- }
-
- public void testUpdateProperties() throws Exception {
- IFile jaxbProperties = createJaxbProperties(new Path("src/test"), new String[] {"foo", "fooProp"}, new String[] {"bar", "barProp"});
- JaxbPropertiesResource resource = JaxbPropertiesResourceModelProvider.instance().buildResourceModel(jaxbProperties);
-
- assertEquals(resource.getProperty("foo"), "fooProp");
- assertEquals(resource.getProperty("bar"), "barProp");
-
- setProperties(jaxbProperties, new String[] {"foo", "fooProp2"}, new String[] {"baz", "bazProp"});
-
- assertEquals(resource.getProperty("foo"), "fooProp2");
- assertNull(resource.getProperty("bar"));
- assertEquals(resource.getProperty("baz"), "bazProp");
-
- setProperties(jaxbProperties);
-
- assertNull(resource.getProperty("foo"));
- assertNull(resource.getProperty("bar"));
- assertNull(resource.getProperty("baz"));
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
deleted file mode 100644
index 21427213ba..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,41 +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.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.tests.internal.resource.java.JavaResourceModelTestCase;
-import org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_PlatformDefinition;
-import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
-
-public class JaxbJavaResourceModelTestCase
- extends JavaResourceModelTestCase {
-
- public JaxbJavaResourceModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject.addJar(TestJaxbProject.jaxbJarName());
- }
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return GenericJaxb_2_1_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return GenericJaxb_2_1_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java
deleted file mode 100644
index e3864f284e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JaxbJavaResourceModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JaxbJavaResourceModelTests.class.getName());
- suite.addTestSuite(XmlAccessorOrderPackageAnnotationTests.class);
- suite.addTestSuite(XmlAccessorOrderTypeAnnotationTests.class);
- suite.addTestSuite(XmlAccessorTypePackageAnnotationTests.class);
- suite.addTestSuite(XmlAccessorTypeTypeAnnotationTests.class);
- suite.addTestSuite(XmlAnyAttributeAnnotationTests.class);
- suite.addTestSuite(XmlAnyElementAnnotationTests.class);
- suite.addTestSuite(XmlAttachmentRefAnnotationTests.class);
- suite.addTestSuite(XmlAttributeAnnotationTests.class);
- suite.addTestSuite(XmlElementAnnotationTests.class);
- suite.addTestSuite(XmlElementDeclAnnotationTests.class);
- suite.addTestSuite(XmlElementRefAnnotationTests.class);
- suite.addTestSuite(XmlElementRefsAnnotationTests.class);
- suite.addTestSuite(XmlElementsAnnotationTests.class);
- suite.addTestSuite(XmlElementWrapperAnnotationTests.class);
- suite.addTestSuite(XmlEnumAnnotationTests.class);
- suite.addTestSuite(XmlEnumValueAnnotationTests.class);
- suite.addTestSuite(XmlIDAnnotationTests.class);
- suite.addTestSuite(XmlIDREFAnnotationTests.class);
- suite.addTestSuite(XmlInlineBinaryDataAttributeAnnotationTests.class);
- suite.addTestSuite(XmlInlineBinaryDataTypeAnnotationTests.class);
- suite.addTestSuite(XmlJavaTypeAdapterPackageAnnotationTests.class);
- suite.addTestSuite(XmlJavaTypeAdapterTypeAnnotationTests.class);
- suite.addTestSuite(XmlListAnnotationTests.class);
- suite.addTestSuite(XmlMimeTypeAnnotationTests.class);
- suite.addTestSuite(XmlMixedAnnotationTests.class);
- suite.addTestSuite(XmlRegistryAnnotationTests.class);
- suite.addTestSuite(XmlRootElementAnnotationTests.class);
- suite.addTestSuite(XmlSchemaAnnotationTests.class);
- suite.addTestSuite(XmlSchemaTypeAttributeAnnotationTests.class);
- suite.addTestSuite(XmlSchemaTypePackageAnnotationTests.class);
- suite.addTestSuite(XmlSeeAlsoAnnotationTests.class);
- suite.addTestSuite(XmlTransientAttributeAnnotationTests.class);
- suite.addTestSuite(XmlTransientTypeAnnotationTests.class);
- suite.addTestSuite(XmlTypeAnnotationTests.class);
- suite.addTestSuite(XmlValueAnnotationTests.class);
-
- return suite;
- }
-
- private JaxbJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java
deleted file mode 100644
index 32cb73c062..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.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.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorOrderPackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorOrderPackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithAccessorOrder() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorOrder(XmlAccessOrder.UNDEFINED)",
- JAXB.XML_ACCESS_ORDER, JAXB.XML_ACCESSOR_ORDER);
- }
-
- public void testValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithAccessorOrder();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlAccessorOrderAnnotation annotation =
- (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNotNull(annotation);
- assertEquals(XmlAccessOrder.UNDEFINED, annotation.getValue());
-
- annotation.setValue(XmlAccessOrder.ALPHABETICAL);
- assertEquals(XmlAccessOrder.ALPHABETICAL, annotation.getValue());
- assertSourceContains("@XmlAccessorOrder(ALPHABETICAL)", cu);
-
- annotation.setValue(null);
- annotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertNull(annotation.getValue());
- assertSourceDoesNotContain("@XmlAccessorOrder(", cu);
-
-// TODO uncomment when bug 328400 is addressed
-// annotation = (XmlAccessorOrderAnnotation) packageResource.addAnnotation(JAXB.XML_ACCESSOR_ORDER);
-// annotation.setValue(XmlAccessOrder.UNDEFINED);
-// assertEquals(XmlAccessOrder.UNDEFINED, annotation.getValue());
-// assertSourceContains("@XmlAccessorOrder(UNDEFINED)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
deleted file mode 100644
index 1518c916ef..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorOrderTypeAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorOrderTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAccessorOrder() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_ORDER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorOrder");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAccessorOrderWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorOrder(value = XmlAccessOrder.ALPHABETICAL)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertTrue(xmlAccessorOrderAnnotation != null);
- assertNull(xmlAccessorOrderAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrderWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(XmlAccessOrder.ALPHABETICAL, xmlAccessorOrderAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(null, xmlAccessorOrderAnnotation.getValue());
-
- xmlAccessorOrderAnnotation.setValue(XmlAccessOrder.UNDEFINED);
- assertEquals(XmlAccessOrder.UNDEFINED, xmlAccessorOrderAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorOrder(UNDEFINED)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorOrderWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
- assertEquals(XmlAccessOrder.ALPHABETICAL, xmlAccessorOrderAnnotation.getValue());
-
- xmlAccessorOrderAnnotation.setValue(null);
- assertNull(xmlAccessorOrderAnnotation.getValue());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java
deleted file mode 100644
index fc3e737548..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.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.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorTypePackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorTypePackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithAccessorType() throws CoreException {
- return createTestPackageInfo(
- "@XmlAccessorType(value = XmlAccessType.PROPERTY)",
- JAXB.XML_ACCESS_TYPE, JAXB.XML_ACCESSOR_TYPE);
- }
-
- public void testValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithAccessorType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlAccessorTypeAnnotation annotation =
- (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertTrue(annotation != null);
- assertEquals(XmlAccessType.PROPERTY, annotation.getValue());
-
- annotation.setValue(XmlAccessType.FIELD);
- assertEquals(XmlAccessType.FIELD, annotation.getValue());
- assertSourceContains("@XmlAccessorType(value = FIELD)", cu);
-
- annotation.setValue(XmlAccessType.NONE);
- assertEquals(XmlAccessType.NONE, annotation.getValue());
- assertSourceContains("@XmlAccessorType(value = NONE)", cu);
-
- annotation.setValue(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(XmlAccessType.PUBLIC_MEMBER, annotation.getValue());
- assertSourceContains("@XmlAccessorType(value = PUBLIC_MEMBER)", cu);
-
- annotation.setValue(null);
- assertSourceDoesNotContain("@XmlAccessorType(", cu);
-
-// TODO uncomment when bug 328400 is addressed
-// annotation = (XmlAccessorTypeAnnotation) packageResource.addAnnotation(JAXB.XML_ACCESSOR_TYPE);
-// annotation.setValue(XmlAccessType.PROPERTY);
-// assertEquals(XmlAccessType.PROPERTY, annotation.getValue());
-// assertSourceContains("@XmlAccessorType(PROPERTY)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
deleted file mode 100644
index 4c7c4f32b7..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAccessorTypeTypeAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlAccessorTypeTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAccessorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorType");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAccessorTypeWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAccessorType(value = XmlAccessType.FIELD)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertTrue(xmlAccessorTypeAnnotation != null);
- assertNull(xmlAccessorTypeAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorTypeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(XmlAccessType.FIELD, xmlAccessorTypeAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(null, xmlAccessorTypeAnnotation.getValue());
-
- xmlAccessorTypeAnnotation.setValue(XmlAccessType.PUBLIC_MEMBER);
- assertEquals(XmlAccessType.PUBLIC_MEMBER, xmlAccessorTypeAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorType(PUBLIC_MEMBER)", cu);
-
- xmlAccessorTypeAnnotation.setValue(XmlAccessType.PROPERTY);
- assertEquals(XmlAccessType.PROPERTY, xmlAccessorTypeAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorType(PROPERTY)", cu);
-
- xmlAccessorTypeAnnotation.setValue(XmlAccessType.NONE);
- assertEquals(XmlAccessType.NONE, xmlAccessorTypeAnnotation.getValue());
-
- assertSourceContains("@XmlAccessorType(NONE)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAccessorTypeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
- assertEquals(XmlAccessType.FIELD, xmlAccessorTypeAnnotation.getValue());
-
- xmlAccessorTypeAnnotation.setValue(null);
- assertNull(xmlAccessorTypeAnnotation.getValue());
-
- assertSourceDoesNotContain("@XmlAccessorType(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java
deleted file mode 100644
index 1758e19fb9..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAnyAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlAnyAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAnyAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyAttribute");
- }
- });
- }
-
- public void testGetXmlAnyAttribute() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyAttributeAnnotation xmlAnyAttributeAnnotation = (XmlAnyAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE);
- assertTrue(xmlAnyAttributeAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_ANY_ATTRIBUTE);
- assertSourceDoesNotContain("@XmlAnyAttribute", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
deleted file mode 100644
index 3ae8713f60..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAnyElementAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ANY_ELEMENT_VALUE = "String";
-
- public XmlAnyElementAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAnyElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAnyElementWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAnyElementWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ANY_ELEMENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement(value = " + XML_ANY_ELEMENT_VALUE + ".class)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertTrue(xmlAnyElementAnnotation != null);
- assertNull(xmlAnyElementAnnotation.getLax());
- assertNull(xmlAnyElementAnnotation.getValue());
- }
-
- public void testGetLax() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElementWithBooleanElement("lax");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
-
- assertEquals(Boolean.TRUE, xmlAnyElementAnnotation.getLax());
- }
-
- public void testSetLax() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
-
- assertNotNull(xmlAnyElementAnnotation);
- assertNull(xmlAnyElementAnnotation.getLax());
-
- xmlAnyElementAnnotation.setLax(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlAnyElementAnnotation.getLax());
-
- assertSourceContains("@XmlAnyElement(lax = false)", cu);
-
- xmlAnyElementAnnotation.setLax(null);
- assertSourceContains("@XmlAnyElement", cu);
- assertSourceDoesNotContain("lax", cu);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElementWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertTrue(xmlAnyElementAnnotation != null);
- assertEquals(XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getValue());
- assertEquals("java.lang." + XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getFullyQualifiedValueClassName());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
- assertNull(xmlAnyElementAnnotation.getValue());
- xmlAnyElementAnnotation.setValue(XML_ANY_ELEMENT_VALUE);
- assertEquals(XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getValue());
-
- assertSourceContains("@XmlAnyElement(" + XML_ANY_ELEMENT_VALUE + ".class)", cu);
-
- xmlAnyElementAnnotation.setValue(null);
- assertNull(xmlAnyElementAnnotation.getValue());
-
- assertSourceContains("@XmlAnyElement", cu);
- assertSourceDoesNotContain("@XmlAnyElement(value = " + XML_ANY_ELEMENT_VALUE + ".class)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java
deleted file mode 100644
index 9f10d0714c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAttachmentRefAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlAttachmentRefAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAttachmentRef() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTACHMENT_REF);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttachmentRef");
- }
- });
- }
-
- public void testGetXmlAttachmentRef() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttachmentRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertTrue(xmlAttachmentRefAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_ATTACHMENT_REF);
- assertSourceDoesNotContain("@XmlAttachmentRef", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java
deleted file mode 100644
index d2527290f6..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ATTRIBUTE_NAME = "elementName";
- private static final String XML_ATTRIBUTE_NAMESPACE = "XmlAttributeNamespace";
-
- public XmlAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithName() throws Exception {
- return this.createTestXmlAttributeWithStringElement("name", XML_ATTRIBUTE_NAME);
- }
-
- private ICompilationUnit createTestXmlAttributeWithNamespace() throws Exception {
- return this.createTestXmlAttributeWithStringElement("namespace", XML_ATTRIBUTE_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlAttributeWithStringElement(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ATTRIBUTE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertTrue(xmlAttributeAnnotation != null);
- assertEquals(XML_ATTRIBUTE_NAME, xmlAttributeAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertTrue(xmlAttributeAnnotation != null);
- assertNull(xmlAttributeAnnotation.getName());
- assertNull(xmlAttributeAnnotation.getNamespace());
- assertNull(xmlAttributeAnnotation.getRequired());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getName());
- xmlAttributeAnnotation.setName(XML_ATTRIBUTE_NAME);
- assertEquals(XML_ATTRIBUTE_NAME, xmlAttributeAnnotation.getName());
-
- assertSourceContains("@XmlAttribute(name = \"" + XML_ATTRIBUTE_NAME + "\")", cu);
-
- xmlAttributeAnnotation.setName(null);
- assertNull(xmlAttributeAnnotation.getName());
-
- assertSourceContains("@XmlAttribute", cu);
- assertSourceDoesNotContain("@XmlAttribute(name = \"" + XML_ATTRIBUTE_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertTrue(xmlAttributeAnnotation != null);
- assertEquals(XML_ATTRIBUTE_NAMESPACE, xmlAttributeAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
- assertNull(xmlAttributeAnnotation.getNamespace());
- xmlAttributeAnnotation.setNamespace(XML_ATTRIBUTE_NAMESPACE);
- assertEquals(XML_ATTRIBUTE_NAMESPACE, xmlAttributeAnnotation.getNamespace());
-
- assertSourceContains("@XmlAttribute(namespace = \"" + XML_ATTRIBUTE_NAMESPACE + "\")", cu);
-
- xmlAttributeAnnotation.setNamespace(null);
- assertNull(xmlAttributeAnnotation.getNamespace());
-
- assertSourceContains("@XmlAttribute", cu);
- assertSourceDoesNotContain("@XmlAttribute(namespace = \"" + XML_ATTRIBUTE_NAMESPACE + "\")", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
-
- assertEquals(Boolean.TRUE, xmlAttributeAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
-
- assertNotNull(xmlAttributeAnnotation);
- assertNull(xmlAttributeAnnotation.getRequired());
-
- xmlAttributeAnnotation.setRequired(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlAttributeAnnotation.getRequired());
-
- assertSourceContains("@XmlAttribute(required = false)", cu);
-
- xmlAttributeAnnotation.setRequired(null);
- assertSourceContains("@XmlAttribute", cu);
- assertSourceDoesNotContain("required", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
deleted file mode 100644
index 12589383e8..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_NAME = "elementName";
- private static final String XML_ELEMENT_NAMESPACE = "XmlElementNamespace";
- private static final String XML_ELEMENT_DEFAULT_VALUE = "myDefaultValue";
- private static final String XML_ELEMENT_TYPE = "String";
-
-
- public XmlElementAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElement() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithName() throws Exception {
- return this.createTestXmlElementWithStringElement("name", XML_ELEMENT_NAME);
- }
-
- private ICompilationUnit createTestXmlElementWithNamespace() throws Exception {
- return this.createTestXmlElementWithStringElement("namespace", XML_ELEMENT_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementWithDefaultValue() throws Exception {
- return this.createTestXmlElementWithStringElement("defaultValue", XML_ELEMENT_DEFAULT_VALUE);
- }
-
- private ICompilationUnit createTestXmlElementWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithBooleanElement(final String booleanElement) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class)");
- }
- });
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElementAnnotation.getNamespace());
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertNull(xmlElementAnnotation.getNillable());
- assertNull(xmlElementAnnotation.getRequired());
- assertNull(xmlElementAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getName());
-
- xmlElementAnnotation.setName(XML_ELEMENT_NAME);
-
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
-
- xmlElementAnnotation.setName(null);
-
- assertNull(xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getNamespace());
-
- xmlElementAnnotation.setNamespace(XML_ELEMENT_NAMESPACE);
-
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
-
- xmlElementAnnotation.setNamespace(null);
-
- assertNull(xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
- }
-
- public void testGetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithDefaultValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- }
-
- public void testSetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
-
- xmlElementAnnotation.setDefaultValue(XML_ELEMENT_DEFAULT_VALUE);
-
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
-
- xmlElementAnnotation.setDefaultValue(null);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
- }
-
- public void testGetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("nillable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
- }
-
- public void testSetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getNillable());
-
- xmlElementAnnotation.setNillable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getNillable());
- assertSourceContains("@XmlElement(nillable = false)", cu);
-
- xmlElementAnnotation.setNillable(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("nillable", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getRequired());
-
- xmlElementAnnotation.setRequired(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getRequired());
- assertSourceContains("@XmlElement(required = false)", cu);
-
- xmlElementAnnotation.setRequired(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("required", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_TYPE, xmlElementAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
-
- assertNull(xmlElementAnnotation.getType());
-
- xmlElementAnnotation.setType(XML_ELEMENT_TYPE);
-
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
-
- xmlElementAnnotation.setType(null);
-
- assertNull(xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
deleted file mode 100644
index a782a0b072..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_DECL_NAME = "elementName";
- private static final String XML_ELEMENT_DECL_NAMESPACE = "XmlElementDeclNamespace";
- private static final String XML_ELEMENT_DECL_DEFAULT_VALUE = "myDefaultValue";
- private static final String XML_ELEMENT_DECL_SCOPE = "XmlElementDecl.GLOBAL";
-
- public XmlElementDeclAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlElementDecl() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_DECL);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementDeclWithName() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("name", XML_ELEMENT_DECL_NAME);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithNamespace() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("namespace", XML_ELEMENT_DECL_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithDefaultValue() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("defaultValue", XML_ELEMENT_DECL_DEFAULT_VALUE);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithSubstitutionHeadName() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("substitutionHeadName", XML_ELEMENT_DECL_NAME);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithSubstitutionHeadNamespace() throws Exception {
- return this.createTestXmlElementDeclWithStringElementDecl("substitutionHeadNamespace", XML_ELEMENT_DECL_NAME);
- }
-
- private ICompilationUnit createTestXmlElementDeclWithStringElementDecl(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_DECL);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementDeclWithScope() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_DECL);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementDecl(scope = " + XML_ELEMENT_DECL_SCOPE + ".class)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertNull(xmlElementDeclAnnotation.getName());
- assertNull(xmlElementDeclAnnotation.getNamespace());
- assertNull(xmlElementDeclAnnotation.getDefaultValue());
- assertNull(xmlElementDeclAnnotation.getScope());
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getName());
- xmlElementDeclAnnotation.setName(XML_ELEMENT_DECL_NAME);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getName());
-
- assertSourceContains("@XmlElementDecl(name = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
-
- xmlElementDeclAnnotation.setName(null);
- assertNull(xmlElementDeclAnnotation.getName());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(name = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAMESPACE, xmlElementDeclAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getNamespace());
- xmlElementDeclAnnotation.setNamespace(XML_ELEMENT_DECL_NAMESPACE);
- assertEquals(XML_ELEMENT_DECL_NAMESPACE, xmlElementDeclAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementDecl(namespace = \"" + XML_ELEMENT_DECL_NAMESPACE + "\")", cu);
-
- xmlElementDeclAnnotation.setNamespace(null);
- assertNull(xmlElementDeclAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(namespace = \"" + XML_ELEMENT_DECL_NAMESPACE + "\")", cu);
- }
-
- public void testGetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithDefaultValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_DEFAULT_VALUE, xmlElementDeclAnnotation.getDefaultValue());
- }
-
- public void testSetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getDefaultValue());
- xmlElementDeclAnnotation.setDefaultValue(XML_ELEMENT_DECL_DEFAULT_VALUE);
- assertEquals(XML_ELEMENT_DECL_DEFAULT_VALUE, xmlElementDeclAnnotation.getDefaultValue());
-
- assertSourceContains("@XmlElementDecl(defaultValue = \"" + XML_ELEMENT_DECL_DEFAULT_VALUE + "\")", cu);
-
- xmlElementDeclAnnotation.setDefaultValue(null);
- assertNull(xmlElementDeclAnnotation.getDefaultValue());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(defaultValue = \"" + XML_ELEMENT_DECL_DEFAULT_VALUE + "\")", cu);
- }
-
- public void testGetScope() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithScope();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getScope());
- assertEquals("javax.xml.bind.annotation." + XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getFullyQualifiedScopeClassName());
- }
-
- public void testSetScope() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getScope());
- xmlElementDeclAnnotation.setScope(XML_ELEMENT_DECL_SCOPE);
- assertEquals(XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getScope());
-
- assertSourceContains("@XmlElementDecl(scope = " + XML_ELEMENT_DECL_SCOPE + ".class", cu);
-
- xmlElementDeclAnnotation.setScope(null);
- assertNull(xmlElementDeclAnnotation.getScope());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(scope = " + XML_ELEMENT_DECL_SCOPE + ".class", cu);
- }
-
- public void testGetSubstitutionHeadName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithSubstitutionHeadName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadName());
- }
-
- public void testSetSubstitutionHeadName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
- xmlElementDeclAnnotation.setSubstitutionHeadName(XML_ELEMENT_DECL_NAME);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadName());
-
- assertSourceContains("@XmlElementDecl(substitutionHeadName = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
-
- xmlElementDeclAnnotation.setSubstitutionHeadName(null);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(substitutionHeadName = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
- }
-
- public void testGetSubstitutionHeadNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDeclWithSubstitutionHeadNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertTrue(xmlElementDeclAnnotation != null);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
- }
-
- public void testSetSubstitutionHeadNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = getMethod(resourceType, 0);
-
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
- xmlElementDeclAnnotation.setSubstitutionHeadNamespace(XML_ELEMENT_DECL_NAME);
- assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
-
- assertSourceContains("@XmlElementDecl(substitutionHeadNamespace = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
-
- xmlElementDeclAnnotation.setSubstitutionHeadNamespace(null);
- assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
-
- assertSourceContains("@XmlElementDecl", cu);
- assertSourceDoesNotContain("@XmlElementDecl(substitutionHeadNamespace = \"" + XML_ELEMENT_DECL_NAME + "\")", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
deleted file mode 100644
index 18eb4da02f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementRefAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_REF_NAME = "elementName";
- private static final String XML_ELEMENT_REF_NAMESPACE = "XmlElementRefNamespace";
- private static final String XML_ELEMENT_REF_TYPE = "String";
-
-
- public XmlElementRefAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElementRef() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithName() throws Exception {
- return this.createTestXmlElementRefWithStringElement("name", XML_ELEMENT_REF_NAME);
- }
-
- private ICompilationUnit createTestXmlElementRefWithNamespace() throws Exception {
- return this.createTestXmlElementRefWithStringElement("namespace", XML_ELEMENT_REF_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementRefWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithBooleanElement(final String booleanElement) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertNull(xmlElementRefAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefAnnotation.getName());
-
- xmlElementRefAnnotation.setName(XML_ELEMENT_REF_NAME);
-
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- assertSourceContains("@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\")", cu);
-
- xmlElementRefAnnotation.setName(null);
-
- assertNull(xmlElementRefAnnotation.getName());
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
-
- xmlElementRefAnnotation.setNamespace(XML_ELEMENT_REF_NAMESPACE);
-
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRef(namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\")", cu);
-
- xmlElementRefAnnotation.setNamespace(null);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("@XmlElementRef(namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\")", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertEquals(Boolean.TRUE, xmlElementRefAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNotNull(xmlElementRefAnnotation);
- assertNull(xmlElementRefAnnotation.getRequired());
-
- xmlElementRefAnnotation.setRequired(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementRefAnnotation.getRequired());
- assertSourceContains("@XmlElementRef(required = false)", cu);
-
- xmlElementRefAnnotation.setRequired(null);
-
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("required", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
-
- assertNull(xmlElementRefAnnotation.getType());
-
- xmlElementRefAnnotation.setType(XML_ELEMENT_REF_TYPE);
-
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class", cu);
-
- xmlElementRefAnnotation.setType(null);
-
- assertNull(xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRef", cu);
- assertSourceDoesNotContain("@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java
deleted file mode 100644
index 835c30641e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefsAnnotationTests.java
+++ /dev/null
@@ -1,290 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
-
-
-public class XmlElementRefsAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_REF_NAME = "elementName";
- private static final String XML_ELEMENT_REF_NAMESPACE = "XmlElementRefNamespace";
- private static final String XML_ELEMENT_REF_TYPE = "String";
-
-
- public XmlElementRefsAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElementRef() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithName() throws Exception {
- return this.createTestXmlElementRefWithStringElement("name", XML_ELEMENT_REF_NAME);
- }
-
- private ICompilationUnit createTestXmlElementRefWithNamespace() throws Exception {
- return this.createTestXmlElementRefWithStringElement("namespace", XML_ELEMENT_REF_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementRefWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef(" + element + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementRefWithAll() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementRefs(@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\", type = " + XML_ELEMENT_REF_TYPE + ".class))");
- }
- });
- }
-
-
- private XmlElementRefAnnotation getXmlElementRefAnnotation(JavaResourceAttribute resourceAttribute) {
- XmlElementRefsAnnotation refsAnnotation
- = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- return refsAnnotation.xmlElementRefAt(0);
- }
-
- private XmlElementRefAnnotation addXmlElementRefAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementRefsAnnotation refsAnnotation
- = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- return refsAnnotation.addXmlElementRef(index);
- }
-
- private void removeXmlElementRefAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementRefsAnnotation refsAnnotation
- = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
- refsAnnotation.removeXmlElementRef(index);
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertNull(xmlElementRefAnnotation.getName());
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertNull(xmlElementRefAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertNull(xmlElementRefAnnotation.getName());
-
- xmlElementRefAnnotation.setName(XML_ELEMENT_REF_NAME);
- assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
-
- assertSourceContains("@XmlElementRefs(@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\"))", cu);
-
- xmlElementRefAnnotation.setName(null);
- assertNull(xmlElementRefAnnotation.getName());
-
- assertSourceContains("@XmlElementRefs(@XmlElementRef)", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
-
- xmlElementRefAnnotation.setNamespace(XML_ELEMENT_REF_NAMESPACE);
-
- assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRefs(@XmlElementRef(namespace = \"" + XML_ELEMENT_REF_NAMESPACE + "\"))", cu);
-
- xmlElementRefAnnotation.setNamespace(null);
-
- assertNull(xmlElementRefAnnotation.getNamespace());
- assertSourceContains("@XmlElementRefs(@XmlElementRef)", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertTrue(xmlElementRefAnnotation != null);
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = getXmlElementRefAnnotation(resourceAttribute);
-
- assertNull(xmlElementRefAnnotation.getType());
-
- xmlElementRefAnnotation.setType(XML_ELEMENT_REF_TYPE);
-
- assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRefs(@XmlElementRef(type = " + XML_ELEMENT_REF_TYPE + ".class))", cu);
-
- xmlElementRefAnnotation.setType(null);
-
- assertNull(xmlElementRefAnnotation.getType());
- assertSourceContains("@XmlElementRefs(@XmlElementRef)", cu);
- }
-
- public void testAddXmlElementRef() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithAll();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementRefAnnotation(1, resourceAttribute);
- XmlElementRefsAnnotation refsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class),@XmlElementRef})", cu);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNotNull(refsAnnotation);
- assertEquals(2, refsAnnotation.getXmlElementRefsSize());
- }
-
- public void testAddXmlElementRefToBeginningOfList() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithAll();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementRefAnnotation(1, resourceAttribute);
- XmlElementRefsAnnotation refsAnnotation = (XmlElementRefsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REFS);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class),@XmlElementRef})", cu);
-
- addXmlElementRefAnnotation(0, resourceAttribute);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef,@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class), @XmlElementRef})", cu);
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF));
- assertNotNull(refsAnnotation);
- assertEquals(3, refsAnnotation.getXmlElementRefsSize());
- }
-
- public void testRemoveXmlElementRef() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementRefWithAll();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementRefAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class),@XmlElementRef})", cu);
-
- removeXmlElementRefAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME
- + "\", namespace = \"" + XML_ELEMENT_REF_NAMESPACE
- + "\", type = " + XML_ELEMENT_REF_TYPE
- + ".class)", cu);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
deleted file mode 100644
index 638c375733..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_WRAPPER_NAME = "elementName";
- private static final String XML_ELEMENT_WRAPPER_NAMESPACE = "XmlElementWrapperNamespace";
-
- public XmlElementWrapperAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlElementWrapper() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_WRAPPER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementWrapper");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithName() throws Exception {
- return this.createTestXmlElementWrapperWithStringElement("name", XML_ELEMENT_WRAPPER_NAME);
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithNamespace() throws Exception {
- return this.createTestXmlElementWrapperWithStringElement("namespace", XML_ELEMENT_WRAPPER_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithStringElement(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_WRAPPER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementWrapper(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWrapperWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENT_WRAPPER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElementWrapper(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertTrue(xmlElementWrapperAnnotation != null);
- assertEquals(XML_ELEMENT_WRAPPER_NAME, xmlElementWrapperAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertTrue(xmlElementWrapperAnnotation != null);
- assertNull(xmlElementWrapperAnnotation.getName());
- assertNull(xmlElementWrapperAnnotation.getNamespace());
- assertNull(xmlElementWrapperAnnotation.getNillable());
- assertNull(xmlElementWrapperAnnotation.getRequired());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementWrapperAnnotation.getName());
- xmlElementWrapperAnnotation.setName(XML_ELEMENT_WRAPPER_NAME);
- assertEquals(XML_ELEMENT_WRAPPER_NAME, xmlElementWrapperAnnotation.getName());
-
- assertSourceContains("@XmlElementWrapper(name = \"" + XML_ELEMENT_WRAPPER_NAME + "\")", cu);
-
- xmlElementWrapperAnnotation.setName(null);
- assertNull(xmlElementWrapperAnnotation.getName());
-
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("@XmlElementWrapper(name = \"" + XML_ELEMENT_WRAPPER_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertTrue(xmlElementWrapperAnnotation != null);
- assertEquals(XML_ELEMENT_WRAPPER_NAMESPACE, xmlElementWrapperAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
- assertNull(xmlElementWrapperAnnotation.getNamespace());
- xmlElementWrapperAnnotation.setNamespace(XML_ELEMENT_WRAPPER_NAMESPACE);
- assertEquals(XML_ELEMENT_WRAPPER_NAMESPACE, xmlElementWrapperAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementWrapper(namespace = \"" + XML_ELEMENT_WRAPPER_NAMESPACE + "\")", cu);
-
- xmlElementWrapperAnnotation.setNamespace(null);
- assertNull(xmlElementWrapperAnnotation.getNamespace());
-
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("@XmlElementWrapper(namespace = \"" + XML_ELEMENT_WRAPPER_NAMESPACE + "\")", cu);
- }
-
- public void testGetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithBooleanElement("nillable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertEquals(Boolean.TRUE, xmlElementWrapperAnnotation.getNillable());
- }
-
- public void testSetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(xmlElementWrapperAnnotation);
- assertNull(xmlElementWrapperAnnotation.getNillable());
-
- xmlElementWrapperAnnotation.setNillable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlElementWrapperAnnotation.getNillable());
-
- assertSourceContains("@XmlElementWrapper(nillable = false)", cu);
-
- xmlElementWrapperAnnotation.setNillable(null);
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("nillable", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapperWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertEquals(Boolean.TRUE, xmlElementWrapperAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
-
- assertNotNull(xmlElementWrapperAnnotation);
- assertNull(xmlElementWrapperAnnotation.getRequired());
-
- xmlElementWrapperAnnotation.setRequired(Boolean.FALSE);
- assertEquals(Boolean.FALSE, xmlElementWrapperAnnotation.getRequired());
-
- assertSourceContains("@XmlElementWrapper(required = false)", cu);
-
- xmlElementWrapperAnnotation.setRequired(null);
- assertSourceContains("@XmlElementWrapper", cu);
- assertSourceDoesNotContain("required", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java
deleted file mode 100644
index db85a0cf63..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementsAnnotationTests.java
+++ /dev/null
@@ -1,380 +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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
-
-
-public class XmlElementsAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ELEMENT_NAME = "elementName";
- private static final String XML_ELEMENT_NAMESPACE = "XmlElementNamespace";
- private static final String XML_ELEMENT_DEFAULT_VALUE = "myDefaultValue";
- private static final String XML_ELEMENT_TYPE = "String";
-
-
- public XmlElementsAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlElement() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement)");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithName() throws Exception {
- return this.createTestXmlElementWithStringElement("name", XML_ELEMENT_NAME);
- }
-
- private ICompilationUnit createTestXmlElementWithNamespace() throws Exception {
- return this.createTestXmlElementWithStringElement("namespace", XML_ELEMENT_NAMESPACE);
- }
-
- private ICompilationUnit createTestXmlElementWithDefaultValue() throws Exception {
- return this.createTestXmlElementWithStringElement("defaultValue", XML_ELEMENT_DEFAULT_VALUE);
- }
-
- private ICompilationUnit createTestXmlElementWithStringElement(final String element, final String value) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement(" + element + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithBooleanElement(final String booleanElement) throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement(" + booleanElement + " = true))");
- }
- });
- }
-
- private ICompilationUnit createTestXmlElementWithType() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ELEMENTS, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements(@XmlElement(type = " + XML_ELEMENT_TYPE + ".class))");
- }
- });
- }
-
-
- private XmlElementAnnotation getXmlElementAnnotation(JavaResourceAttribute resourceAttribute) {
- XmlElementsAnnotation annotation
- = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
- return annotation.xmlElementAt(0);
- }
-
- private XmlElementAnnotation addXmlElementAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementsAnnotation annotation
- = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
- return annotation.addXmlElement(index);
- }
-
- private void removeXmlElementAnnotation(int index, JavaResourceAttribute resourceAttribute) {
- XmlElementsAnnotation annotation
- = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
- annotation.removeXmlElement(index);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertNull(xmlElementAnnotation.getName());
- assertNull(xmlElementAnnotation.getNamespace());
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertNull(xmlElementAnnotation.getNillable());
- assertNull(xmlElementAnnotation.getRequired());
- assertNull(xmlElementAnnotation.getType());
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getName());
-
- xmlElementAnnotation.setName(XML_ELEMENT_NAME);
-
- assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
-
- xmlElementAnnotation.setName(null);
-
- assertNull(xmlElementAnnotation.getName());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getNamespace());
-
- xmlElementAnnotation.setNamespace(XML_ELEMENT_NAMESPACE);
-
- assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
-
- xmlElementAnnotation.setNamespace(null);
-
- assertNull(xmlElementAnnotation.getNamespace());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(namespace = \"" + XML_ELEMENT_NAMESPACE + "\")", cu);
- }
-
- public void testGetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithDefaultValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- }
-
- public void testSetDefaultValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
-
- xmlElementAnnotation.setDefaultValue(XML_ELEMENT_DEFAULT_VALUE);
-
- assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
-
- xmlElementAnnotation.setDefaultValue(null);
-
- assertNull(xmlElementAnnotation.getDefaultValue());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(defaultValue = \"" + XML_ELEMENT_DEFAULT_VALUE + "\")", cu);
- }
-
- public void testGetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("nillable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
- }
-
- public void testSetNillable() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getNillable());
-
- xmlElementAnnotation.setNillable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getNillable());
- assertSourceContains("@XmlElement(nillable = false)", cu);
-
- xmlElementAnnotation.setNillable(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("nillable", cu);
- }
-
- public void testGetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("required");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
- }
-
- public void testSetRequired() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNotNull(xmlElementAnnotation);
- assertNull(xmlElementAnnotation.getRequired());
-
- xmlElementAnnotation.setRequired(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, xmlElementAnnotation.getRequired());
- assertSourceContains("@XmlElement(required = false)", cu);
-
- xmlElementAnnotation.setRequired(null);
-
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("required", cu);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElementWithType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertTrue(xmlElementAnnotation != null);
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertEquals("java.lang." + XML_ELEMENT_TYPE, xmlElementAnnotation.getFullyQualifiedTypeName());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestXmlElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = getXmlElementAnnotation(resourceAttribute);
-
- assertNull(xmlElementAnnotation.getType());
-
- xmlElementAnnotation.setType(XML_ELEMENT_TYPE);
-
- assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
-
- xmlElementAnnotation.setType(null);
-
- assertNull(xmlElementAnnotation.getType());
- assertSourceContains("@XmlElement", cu);
- assertSourceDoesNotContain("@XmlElement(type = " + XML_ELEMENT_TYPE + ".class", cu);
- }
-
- public void testAddXmlElement() throws Exception {
- ICompilationUnit cu = createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementAnnotation(1, resourceAttribute);
- XmlElementsAnnotation annotation = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
-
- assertSourceContains(
- "@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement})",
- cu);
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNotNull(annotation);
- assertEquals(2, annotation.getXmlElementsSize());
- }
-
- public void testAddXmlElementToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementAnnotation(1, resourceAttribute);
- XmlElementsAnnotation annotation = (XmlElementsAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENTS);
-
- assertSourceContains(
- "@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement})",
- cu);
-
- addXmlElementAnnotation(0, resourceAttribute);
-
- assertSourceContains(
- "@XmlElements({@XmlElement,@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"), @XmlElement})",
- cu);
-
- assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT));
- assertNotNull(annotation);
- assertEquals(3, annotation.getXmlElementsSize());
- }
-
- public void testRemoveXmlElement() throws Exception {
- ICompilationUnit cu = createTestXmlElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- addXmlElementAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement})",
- cu);
-
- removeXmlElementAnnotation(1, resourceAttribute);
-
- assertSourceContains(
- "@XmlElement(name = \"" + XML_ELEMENT_NAME + "\")",
- cu);
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
deleted file mode 100644
index 02d0d62311..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlEnumAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ENUM_JAVA_TYPE = "String";
-
- public XmlEnumAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlEnum() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnum");
- }
- });
- }
-
- private ICompilationUnit createTestXmlEnumWithValue() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM);
- }
- @Override
- public void appendEnumAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnum(value = " + XML_ENUM_JAVA_TYPE + ".class)");
- }
- });
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnum();
- JavaResourceEnum resourceEnum = this.buildJavaResourceEnum(cu);
-
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertTrue(xmlEnumAnnotation != null);
- assertNull(xmlEnumAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumWithValue();
- JavaResourceEnum resourceEnum = this.buildJavaResourceEnum(cu);
-
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertTrue(xmlEnumAnnotation != null);
- assertEquals(XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getValue());
- assertEquals("java.lang." + XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getFullyQualifiedValueClassName());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnum();
- JavaResourceEnum resourceEnum = this.buildJavaResourceEnum(cu);
-
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM);
- assertNull(xmlEnumAnnotation.getValue());
- xmlEnumAnnotation.setValue(XML_ENUM_JAVA_TYPE);
- assertEquals(XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getValue());
-
- assertSourceContains("@XmlEnum(" + XML_ENUM_JAVA_TYPE + ".class)", cu);
-
- xmlEnumAnnotation.setValue(null);
- assertNull(xmlEnumAnnotation.getValue());
-
- assertSourceContains("@XmlEnum", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java
deleted file mode 100644
index 4629e37f00..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnum;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlEnumValueAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ENUM_VALUE_VALUE = "myEnumValue";
-
- public XmlEnumValueAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlEnumValue() throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM_VALUE);
- }
- @Override
- public void appendSundayEnumConstantAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnumValue");
- }
- });
- }
-
- private ICompilationUnit createTestXmlEnumValueWithValue() throws Exception {
- return this.createTestXmlEnumValueWithStringElement("value", XML_ENUM_VALUE_VALUE);
- }
-
- private ICompilationUnit createTestXmlEnumValueWithStringElement(final String element, final String value) throws Exception {
- return this.createTestEnum(new DefaultEnumAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ENUM_VALUE);
- }
- @Override
- public void appendSundayEnumConstantAnnotationTo(StringBuilder sb) {
- sb.append("@XmlEnumValue(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- public void testGetXmlEnumValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertTrue(xmlEnumValueAnnotation != null);
-
- enumConstant.removeAnnotation(JAXB.XML_ENUM_VALUE);
- assertSourceDoesNotContain("@XmlEnumValue", cu);
- }
-
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValueWithValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertTrue(xmlEnumValueAnnotation != null);
- assertEquals(XML_ENUM_VALUE_VALUE, xmlEnumValueAnnotation.getValue());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertTrue(xmlEnumValueAnnotation != null);
- assertNull(xmlEnumValueAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourceEnum resourceEnum = buildJavaResourceEnum(cu);
- JavaResourceEnumConstant enumConstant = getEnumConstant(resourceEnum, 0);
-
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) enumConstant.getAnnotation(JAXB.XML_ENUM_VALUE);
- assertNull(xmlEnumValueAnnotation.getValue());
- xmlEnumValueAnnotation.setValue(XML_ENUM_VALUE_VALUE);
- assertEquals(XML_ENUM_VALUE_VALUE, xmlEnumValueAnnotation.getValue());
-
- assertSourceContains("@XmlEnumValue(\"" + XML_ENUM_VALUE_VALUE + "\")", cu);
-
- xmlEnumValueAnnotation.setValue(null);
- assertNull(xmlEnumValueAnnotation.getValue());
-
- assertSourceDoesNotContain("@XmlEnumValue(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java
deleted file mode 100644
index 3c13c6e554..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlIDAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlIDAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlID() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlID");
- }
- });
- }
-
- public void testGetXmlID() throws Exception {
- ICompilationUnit cu = this.createTestXmlID();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
- assertTrue(xmlIDAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_ID);
- assertSourceDoesNotContain("@XmlID", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java
deleted file mode 100644
index 48aacb46ce..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlIDREFAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlIDREFAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlIDREF() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_IDREF);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlIDREF");
- }
- });
- }
-
- public void testGetXmlIDREF() throws Exception {
- ICompilationUnit cu = this.createTestXmlIDREF();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
- assertTrue(xmlIDREFAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_IDREF);
- assertSourceDoesNotContain("@XmlIDREF", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.java
deleted file mode 100644
index 47ad282afd..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAttributeAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlInlineBinaryDataAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlInlineBinaryDataAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlInlineBinaryData() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_INLINE_BINARY_DATA);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInlineBinaryData");
- }
- });
- }
-
- public void testGetXmlInlineBinaryData() throws Exception {
- ICompilationUnit cu = this.createTestXmlInlineBinaryData();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = this.getMethod(resourceType, 0);
-
- XmlInlineBinaryDataAnnotation xmlInlineBinaryDataAnnotation = (XmlInlineBinaryDataAnnotation) resourceMethod.getAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertTrue(xmlInlineBinaryDataAnnotation != null);
-
- resourceMethod.removeAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertSourceDoesNotContain("@XmlInlineBinaryData", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java
deleted file mode 100644
index 1ed94cbb14..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataTypeAnnotationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlInlineBinaryDataTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlInlineBinaryDataTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlInlineBinaryData() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_INLINE_BINARY_DATA);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInlineBinaryData");
- }
- });
- }
-
- public void testGetXmlInlineBinaryData() throws Exception {
- ICompilationUnit cu = this.createTestXmlInlineBinaryData();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlInlineBinaryDataAnnotation xmlInlineBinaryDataAnnotation = (XmlInlineBinaryDataAnnotation) resourceType.getAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertTrue(xmlInlineBinaryDataAnnotation != null);
-
- resourceType.removeAnnotation(JAXB.XML_INLINE_BINARY_DATA);
- assertSourceDoesNotContain("@XmlInlineBinaryData", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
deleted file mode 100644
index adeab40f26..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlJavaTypeAdapterPackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_CLASS = "TestClass";
- private static final String TEST_CLASS_2 = "TestClass2";
- private static final String FQ_TEST_CLASS = PACKAGE_NAME + "." + TEST_CLASS;
- private static final String FQ_TEST_CLASS_2 = PACKAGE_NAME + "." + TEST_CLASS_2;
-
-
- public XmlJavaTypeAdapterPackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private void createTestClass() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(TEST_CLASS).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS + ".java", sourceWriter);
- }
-
- private void createTestClass2() throws CoreException {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(TEST_CLASS_2).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, TEST_CLASS_2 + ".java", sourceWriter);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapter() throws CoreException {
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter",
- JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapterAndValue() throws CoreException {
- createTestClass();
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)",
- JAXB.XML_JAVA_TYPE_ADAPTER, FQ_TEST_CLASS);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapterAndType() throws CoreException {
- createTestClass();
- return createTestPackageInfo(
- "@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)",
- JAXB.XML_JAVA_TYPE_ADAPTER, FQ_TEST_CLASS);
- }
-
- private ICompilationUnit createPackageInfoWithJavaTypeAdapters() throws CoreException {
- return createTestPackageInfo(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})",
- JAXB.XML_JAVA_TYPE_ADAPTERS, JAXB.XML_JAVA_TYPE_ADAPTER);
- }
-
- public void testValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndValue();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass2();
-
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
-
- annotation.setValue(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getValue());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setValue(null);
- assertEquals(null, annotation.getValue());
- assertEquals(null, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter", cu);
-
- annotation.setValue(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
- }
-
- public void testType()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass2();
-
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(null, annotation.getType());
- assertEquals(null, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter", cu);
-
- annotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)", cu);
- }
-
- public void testTypeWithValue()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndValue();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass2();
-
- XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(value = " + TEST_CLASS + ".class, type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setValue(null);
- assertEquals(null, annotation.getValue());
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setValue(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(type = " + TEST_CLASS_2 + ".class, value = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(TEST_CLASS, annotation.getValue());
- assertEquals(null, annotation.getType());
- assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
- }
-
- public void testContainedWithValue()
- throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapters();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass();
-
- XmlJavaTypeAdapterAnnotation adapterAnnotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- adapterAnnotation.setValue(TEST_CLASS);
- assertEquals(TEST_CLASS, adapterAnnotation.getValue());
- assertEquals(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedValue());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(" + TEST_CLASS + ".class),@XmlJavaTypeAdapter})", cu);
-
- adapterAnnotation.setValue(null);
- assertNull(adapterAnnotation.getValue());
- assertNull(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedValue());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})", cu);
- }
-
- public void testContainedWithType()
- throws Exception {
- // test contained annotation type setting/updating
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapters();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass();
-
- XmlJavaTypeAdapterAnnotation adapterAnnotation =
- (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER);
-
- adapterAnnotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, adapterAnnotation.getType());
- assertEquals(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class)})", cu);
-
- resourcePackage.moveAnnotation(0, 1, JAXB.XML_JAVA_TYPE_ADAPTER);
- adapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(TEST_CLASS, adapterAnnotation.getType());
- assertEquals(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(type = " + TEST_CLASS + ".class),@XmlJavaTypeAdapter})", cu);
-
- adapterAnnotation.setType(null);
- assertNull(adapterAnnotation.getType());
- assertNull(FQ_TEST_CLASS, adapterAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})", cu);
- }
-
- public void testContained()
- throws Exception {
- // test adding/removing/moving
-
- ICompilationUnit cu = createPackageInfoWithJavaTypeAdapter();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
- createTestClass();
- createTestClass2();
-
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
-
- resourcePackage.addAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(2, resourcePackage.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- assertSourceContains("@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter, @XmlJavaTypeAdapter })", cu);
-
- XmlJavaTypeAdapterAnnotation adapterAnnotation1 = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- adapterAnnotation1.setValue(TEST_CLASS);
- XmlJavaTypeAdapterAnnotation adapterAnnotation2 = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER);
- adapterAnnotation2.setValue(TEST_CLASS_2);
- assertSourceContains(
- "@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(" + TEST_CLASS
- + ".class), @XmlJavaTypeAdapter(" + TEST_CLASS_2
- + ".class) })", cu);
-
- resourcePackage.moveAnnotation(0, 1, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertSourceContains(
- "@XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(" + TEST_CLASS_2
- + ".class), @XmlJavaTypeAdapter(" + TEST_CLASS
- + ".class) })", cu);
-
- resourcePackage.removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_JAVA_TYPE_ADAPTER));
- assertSourceContains(
- "@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
- assertSourceDoesNotContain("@XmlJavaTypeAdapters", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java
deleted file mode 100644
index 760feb054c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlJavaTypeAdapterTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_JAVA_TYPE_ADAPTER_CLASS = "MyAdapterClass";
-
- public XmlJavaTypeAdapterTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlJavaTypeAdapter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJavaTypeAdapter");
- }
- });
- }
-
- private ICompilationUnit createTestXmlJavaTypeAdapterWithValue() throws Exception {
- this.createTestAdapterClass();
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_JAVA_TYPE_ADAPTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJavaTypeAdapter(value = " + XML_JAVA_TYPE_ADAPTER_CLASS + ".class)");
- }
- });
- }
-
- private void createTestAdapterClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(XML_JAVA_TYPE_ADAPTER_CLASS).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "MyAdapterClass.java", sourceWriter);
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(xmlJavaTypeAdapterAnnotation != null);
- assertNull(xmlJavaTypeAdapterAnnotation.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertTrue(xmlJavaTypeAdapterAnnotation != null);
- assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
- assertEquals("test." + XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getFullyQualifiedValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertNull(xmlJavaTypeAdapterAnnotation.getValue());
- xmlJavaTypeAdapterAnnotation.setValue(XML_JAVA_TYPE_ADAPTER_CLASS);
- assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
-
- assertSourceContains("@XmlJavaTypeAdapter(" + XML_JAVA_TYPE_ADAPTER_CLASS + ".class)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlJavaTypeAdapterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER);
- assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
-
- xmlJavaTypeAdapterAnnotation.setValue(null);
- assertNull(xmlJavaTypeAdapterAnnotation.getValue());
-
- assertSourceContains("@XmlJavaTypeAdapter", cu);
- assertSourceDoesNotContain("@XmlJavaTypeAdapter(" + XML_JAVA_TYPE_ADAPTER_CLASS + ".class)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java
deleted file mode 100644
index c21a90420d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlListAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlListAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlList() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_LIST);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlList");
- }
- });
- }
-
- public void testGetXmlList() throws Exception {
- ICompilationUnit cu = this.createTestXmlList();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
- assertTrue(xmlListAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_LIST);
- assertSourceDoesNotContain("@XmlList", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java
deleted file mode 100644
index 510878c149..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlMimeTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_MIME_TYPE_VALUE = "myMimeType";
-
- public XmlMimeTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlMimeType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_MIME_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlMimeType");
- }
- });
- }
-
- private ICompilationUnit createTestXmlMimeTypeWithValue() throws Exception {
- return this.createTestXmlMimeTypeWithStringElement("value", XML_MIME_TYPE_VALUE);
- }
-
- private ICompilationUnit createTestXmlMimeTypeWithStringElement(final String element, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_MIME_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlMimeType(" + element + " = \"" + value + "\")");
- }
- });
- }
-
- public void testGetXmlMimeType() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertTrue(xmlMimeTypeAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_MIME_TYPE);
- assertSourceDoesNotContain("@XmlMimeType", cu);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeTypeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertTrue(xmlMimeTypeAnnotation != null);
- assertEquals(XML_MIME_TYPE_VALUE, xmlMimeTypeAnnotation.getValue());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertTrue(xmlMimeTypeAnnotation != null);
- assertNull(xmlMimeTypeAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
- assertNull(xmlMimeTypeAnnotation.getValue());
- xmlMimeTypeAnnotation.setValue(XML_MIME_TYPE_VALUE);
- assertEquals(XML_MIME_TYPE_VALUE, xmlMimeTypeAnnotation.getValue());
-
- assertSourceContains("@XmlMimeType(\"" + XML_MIME_TYPE_VALUE + "\")", cu);
-
- xmlMimeTypeAnnotation.setValue(null);
- assertNull(xmlMimeTypeAnnotation.getValue());
-
- assertSourceDoesNotContain("@XmlMimeType(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java
deleted file mode 100644
index fe9e868763..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlMixedAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlMixedAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlMixed() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_MIXED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlMixed");
- }
- });
- }
-
- public void testGetXmlMixed() throws Exception {
- ICompilationUnit cu = this.createTestXmlMixed();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlMixedAnnotation xmlMixedAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
- assertTrue(xmlMixedAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_MIXED);
- assertSourceDoesNotContain("@XmlMixed", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
deleted file mode 100644
index 2e7b36bb2e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlRegistryAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlRegistryAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlRegistry() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_REGISTRY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRegistry");
- }
- });
- }
-
- public void testGetXmlRegistry() throws Exception {
- ICompilationUnit cu = this.createTestXmlRegistry();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRegistryAnnotation xmlRegistryAnnotation = (XmlRegistryAnnotation) resourceType.getAnnotation(JAXB.XML_REGISTRY);
- assertTrue(xmlRegistryAnnotation != null);
-
- resourceType.removeAnnotation(JAXB.XML_REGISTRY);
- assertSourceDoesNotContain("@XmlRegistry", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java
deleted file mode 100644
index adb6360444..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlRootElementAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_ROOT_ELEMENT_NAME = "XmlRootElementName";
- private static final String XML_ROOT_ELEMENT_NAMESPACE = "XmlRootElementNamespace";
-
- public XmlRootElementAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlRootElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRootElement");
- }
- });
- }
-
- private ICompilationUnit createTestXmlRootElementWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRootElement(name = \"" + XML_ROOT_ELEMENT_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlRootElementWithNamespace() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_ROOT_ELEMENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlRootElement(namespace = \"" + XML_ROOT_ELEMENT_NAMESPACE + "\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElementWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertTrue(xmlRootElementAnnotation != null);
- assertEquals(XML_ROOT_ELEMENT_NAME, xmlRootElementAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertTrue(xmlRootElementAnnotation != null);
- assertNull(xmlRootElementAnnotation.getName());
- assertNull(xmlRootElementAnnotation.getNamespace());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation.getName());
- xmlRootElementAnnotation.setName(XML_ROOT_ELEMENT_NAME);
- assertEquals(XML_ROOT_ELEMENT_NAME, xmlRootElementAnnotation.getName());
-
- assertSourceContains("@XmlRootElement(name = \"" + XML_ROOT_ELEMENT_NAME + "\")", cu);
-
- xmlRootElementAnnotation.setName(null);
- assertNull(xmlRootElementAnnotation.getName());
-
- assertSourceContains("@XmlRootElement", cu);
- assertSourceDoesNotContain("@XmlRootElement(name = \"" + XML_ROOT_ELEMENT_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElementWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertTrue(xmlRootElementAnnotation != null);
- assertEquals(XML_ROOT_ELEMENT_NAMESPACE, xmlRootElementAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
- assertNull(xmlRootElementAnnotation.getNamespace());
- xmlRootElementAnnotation.setNamespace(XML_ROOT_ELEMENT_NAMESPACE);
- assertEquals(XML_ROOT_ELEMENT_NAMESPACE, xmlRootElementAnnotation.getNamespace());
-
- assertSourceContains("@XmlRootElement(namespace = \"" + XML_ROOT_ELEMENT_NAMESPACE + "\")", cu);
-
- xmlRootElementAnnotation.setNamespace(null);
- assertNull(xmlRootElementAnnotation.getNamespace());
-
- assertSourceContains("@XmlRootElement", cu);
- assertSourceDoesNotContain("@XmlRootElement(namespace = \"" + XML_ROOT_ELEMENT_NAMESPACE + "\")", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java
deleted file mode 100644
index 9a4bbd2ab3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSchemaAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_LOCATION = "http://www.eclipse.org/test/schema.xsd";
-
- private static final String TEST_NAMESPACE = "http://www.eclipse.org/test/schema";
-
- private static final String TEST_PREFIX = "ts";
-
- private static final String TEST_NAMESPACE_2 = "http://www.eclipse.org/test/schema2";
-
- private static final String TEST_PREFIX_2 = "ts2";
-
-
- public XmlSchemaAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithSchemaAndAttributeFormDefault() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(attributeFormDefault = XmlNsForm.QUALIFIED)",
- JAXB.XML_SCHEMA, JAXB.XML_NS_FORM);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndElementFormDefault() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED)",
- JAXB.XML_SCHEMA, JAXB.XML_NS_FORM);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndLocation() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(location = \"" + TEST_LOCATION + "\")",
- JAXB.XML_SCHEMA);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndNamespace() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(namespace = \"" + TEST_NAMESPACE + "\")",
- JAXB.XML_SCHEMA);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndXmlns() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(xmlns = @XmlNs)",
- JAXB.XML_SCHEMA, JAXB.XML_NS);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndXmlnsWithNamespace() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(xmlns = @XmlNs(namespaceURI = \"" + TEST_NAMESPACE + "\"))",
- JAXB.XML_SCHEMA, JAXB.XML_NS);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaAndXmlnsWithPrefix() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchema(xmlns = @XmlNs(prefix = \"" + TEST_PREFIX + "\"))",
- JAXB.XML_SCHEMA, JAXB.XML_NS);
- }
-
- public void testAttributeFormDefault()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndAttributeFormDefault();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertTrue(schemaAnnotation != null);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = XmlNsForm.QUALIFIED)", cu);
-
- schemaAnnotation.setAttributeFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(XmlNsForm.UNQUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = UNQUALIFIED)", cu);
-
- schemaAnnotation.setAttributeFormDefault(XmlNsForm.UNSET);
- assertEquals(XmlNsForm.UNSET, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = UNSET)", cu);
-
- schemaAnnotation.setAttributeFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getAttributeFormDefault());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setAttributeFormDefault(XmlNsForm.QUALIFIED);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertSourceContains("@XmlSchema(attributeFormDefault = QUALIFIED)", cu);
- }
-
- public void testElementFormDefault()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndElementFormDefault();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertTrue(schemaAnnotation != null);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED)", cu);
-
- schemaAnnotation.setElementFormDefault(XmlNsForm.UNQUALIFIED);
- assertEquals(XmlNsForm.UNQUALIFIED, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = UNQUALIFIED)", cu);
-
- schemaAnnotation.setElementFormDefault(XmlNsForm.UNSET);
- assertEquals(XmlNsForm.UNSET, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = UNSET)", cu);
-
- schemaAnnotation.setElementFormDefault(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getElementFormDefault());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setElementFormDefault(XmlNsForm.QUALIFIED);
- assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertSourceContains("@XmlSchema(elementFormDefault = QUALIFIED)", cu);
- }
-
- public void testLocation()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndLocation();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNotNull(schemaAnnotation.getLocation());
-
- schemaAnnotation.setLocation(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getLocation());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setLocation(TEST_LOCATION);
- assertEquals(TEST_LOCATION, schemaAnnotation.getLocation());
- assertSourceContains("@XmlSchema(location = \"" + TEST_LOCATION + "\")", cu);
- }
-
- public void testNamespace()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndNamespace();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNotNull(schemaAnnotation.getNamespace());
-
- schemaAnnotation.setNamespace(null);
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertNull(schemaAnnotation.getNamespace());
- assertSourceDoesNotContain("@XmlSchema(", cu);
-
- schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA);
- schemaAnnotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, schemaAnnotation.getNamespace());
- assertSourceContains("@XmlSchema(namespace = \"" + TEST_NAMESPACE + "\")", cu);
- }
-
- public void testXmlnsNamespace()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndXmlnsWithNamespace();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- XmlNsAnnotation xmlnsAnnotation = schemaAnnotation.xmlnsAt(0);
- assertNotNull(xmlnsAnnotation.getNamespaceURI());
-
- xmlnsAnnotation.setNamespaceURI(null);
- assertNull(xmlnsAnnotation.getNamespaceURI());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs)", cu);
-
- xmlnsAnnotation.setNamespaceURI(TEST_NAMESPACE_2);
- assertEquals(TEST_NAMESPACE_2, xmlnsAnnotation.getNamespaceURI());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2 + "\"))", cu);
- }
-
- public void testXmlnsPrefix()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndXmlnsWithPrefix();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- XmlNsAnnotation xmlnsAnnotation = schemaAnnotation.xmlnsAt(0);
- assertNotNull(xmlnsAnnotation.getPrefix());
-
- xmlnsAnnotation.setPrefix(null);
- assertNull(xmlnsAnnotation.getPrefix());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs)", cu);
-
- xmlnsAnnotation.setPrefix(TEST_PREFIX_2);
- assertEquals(TEST_PREFIX_2, xmlnsAnnotation.getPrefix());
- assertSourceContains("@XmlSchema(xmlns = @XmlNs(prefix = \"" + TEST_PREFIX_2 + "\"))", cu);
- }
-
- public void testXmlns()
- throws Exception {
-
- ICompilationUnit cu = createPackageInfoWithSchemaAndXmlns();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
-
- XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) packageResource.getAnnotation(JAXB.XML_SCHEMA);
- assertFalse(CollectionTools.isEmpty(schemaAnnotation.getXmlns()));
- assertEquals(1, schemaAnnotation.getXmlnsSize());
-
- schemaAnnotation.addXmlns(1);
- assertEquals(2, schemaAnnotation.getXmlnsSize());
- assertSourceContains("@XmlSchema(xmlns = {@XmlNs,@XmlNs})", cu);
-
- XmlNsAnnotation xmlnsAnnotation1 = schemaAnnotation.xmlnsAt(0);
- xmlnsAnnotation1.setNamespaceURI(TEST_NAMESPACE);
- xmlnsAnnotation1.setPrefix(TEST_PREFIX);
- XmlNsAnnotation xmlnsAnnotation2 = schemaAnnotation.xmlnsAt(1);
- xmlnsAnnotation2.setNamespaceURI(TEST_NAMESPACE_2);
- xmlnsAnnotation2.setPrefix(TEST_PREFIX_2);
- assertSourceContains(
- "@XmlSchema(xmlns = {@XmlNs(namespaceURI = \"" + TEST_NAMESPACE
- + "\", prefix = \"" + TEST_PREFIX
- + "\"),@XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2
- + "\", prefix = \"" + TEST_PREFIX_2
- + "\")})", cu);
-
- schemaAnnotation.moveXmlns(0, 1);
- assertSourceContains(
- "@XmlSchema(xmlns = {@XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2
- + "\", prefix = \"" + TEST_PREFIX_2
- + "\"),@XmlNs(namespaceURI = \"" + TEST_NAMESPACE
- + "\", prefix = \"" + TEST_PREFIX
- + "\")})", cu);
-
- schemaAnnotation.removeXmlns(1);
- assertEquals(1, schemaAnnotation.getXmlnsSize());
- assertSourceContains(
- "@XmlSchema(xmlns = @XmlNs(namespaceURI = \"" + TEST_NAMESPACE_2
- + "\", prefix = \"" + TEST_PREFIX_2
- + "\"))", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java
deleted file mode 100644
index adebaa97b8..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAttributeAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSchemaTypeAttributeAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_NAME = "foo";
- private static final String TEST_NAME_2 = "bar";
-
- private static final String TEST_NAMESPACE = "http://www.eclipse.org/test/schema";
- private static final String TEST_NAMESPACE_2 = "http://www.eclipse.org/test/schema2";
-
- private static final String TEST_CLASS = GregorianCalendar.class.getSimpleName();
- private static final String TEST_CLASS_2 = Date.class.getSimpleName();
- private static final String FQ_TEST_CLASS = GregorianCalendar.class.getName();
- private static final String FQ_TEST_CLASS_2 = Date.class.getName();
-
-
- public XmlSchemaTypeAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlAttributeWithSchemaTypeAndName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SCHEMA_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSchemaType(name = \"" + TEST_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithSchemaTypeAndNamespace() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SCHEMA_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlAttributeWithSchemaTypeAndType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SCHEMA_TYPE, FQ_TEST_CLASS, FQ_TEST_CLASS_2);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSchemaType(type = " + TEST_CLASS + ".class)");
- }
- });
- }
-
- public void testName() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithSchemaTypeAndName();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = this.getField(resourceType, 0);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
-
- annotation.setName(TEST_NAME_2);
- assertEquals(TEST_NAME_2, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME_2 + "\")", cu);
-
- annotation.setName(null);
- assertEquals(null, annotation.getName());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setName(TEST_NAME);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
- }
-
- public void testNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithSchemaTypeAndNamespace();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = this.getField(resourceType, 0);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
-
- annotation.setNamespace(TEST_NAMESPACE_2);
- assertEquals(TEST_NAMESPACE_2, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE_2 + "\")", cu);
-
- annotation.setNamespace(null);
- assertEquals(null, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
- }
-
- public void testType() throws Exception {
- ICompilationUnit cu = this.createTestXmlAttributeWithSchemaTypeAndType();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = this.getField(resourceType, 0);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(null, annotation.getType());
- assertEquals(null, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java
deleted file mode 100644
index 5e358517c3..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypePackageAnnotationTests.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Date;
-import java.util.GregorianCalendar;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSchemaTypePackageAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- private static final String TEST_NAME = "foo";
- private static final String TEST_NAME_2 = "bar";
-
- private static final String TEST_NAMESPACE = "http://www.eclipse.org/test/schema";
- private static final String TEST_NAMESPACE_2 = "http://www.eclipse.org/test/schema2";
-
- private static final String TEST_CLASS = GregorianCalendar.class.getSimpleName();
- private static final String TEST_CLASS_2 = Date.class.getSimpleName();
- private static final String FQ_TEST_CLASS = GregorianCalendar.class.getName();
- private static final String FQ_TEST_CLASS_2 = Date.class.getName();
-
-
- public XmlSchemaTypePackageAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createPackageInfoWithSchemaType() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypeAndName() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType(name = \"" + TEST_NAME + "\")",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypeAndNamespace() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")",
- JAXB.XML_SCHEMA_TYPE);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypeAndType() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaType(type = " + TEST_CLASS + ".class)",
- JAXB.XML_SCHEMA_TYPE, FQ_TEST_CLASS, FQ_TEST_CLASS_2);
- }
-
- private ICompilationUnit createPackageInfoWithSchemaTypes() throws CoreException {
- return createTestPackageInfo(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})",
- JAXB.XML_SCHEMA_TYPES, JAXB.XML_SCHEMA_TYPE, FQ_TEST_CLASS, FQ_TEST_CLASS_2);
- }
-
- public void testName() throws Exception {
- ICompilationUnit cu = createPackageInfoWithSchemaTypeAndName();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
-
- annotation.setName(TEST_NAME_2);
- assertEquals(TEST_NAME_2, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME_2 + "\")", cu);
-
- annotation.setName(null);
- assertEquals(null, annotation.getName());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setName(TEST_NAME);
- assertEquals(TEST_NAME, annotation.getName());
- assertSourceContains("@XmlSchemaType(name = \"" + TEST_NAME + "\")", cu);
- }
-
- public void testNamespace() throws Exception {
- ICompilationUnit cu = createPackageInfoWithSchemaTypeAndNamespace();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
-
- annotation.setNamespace(TEST_NAMESPACE_2);
- assertEquals(TEST_NAMESPACE_2, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE_2 + "\")", cu);
-
- annotation.setNamespace(null);
- assertEquals(null, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, annotation.getNamespace());
- assertSourceContains("@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\")", cu);
- }
-
- public void testType() throws Exception {
- ICompilationUnit cu = createPackageInfoWithSchemaTypeAndType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation annotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- assertTrue(annotation != null);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
-
- annotation.setType(TEST_CLASS_2);
- assertEquals(TEST_CLASS_2, annotation.getType());
- assertEquals(FQ_TEST_CLASS_2, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS_2 + ".class)", cu);
-
- annotation.setType(null);
- assertEquals(null, annotation.getType());
- assertEquals(null, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType", cu);
-
- annotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, annotation.getType());
- assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
- assertSourceContains("@XmlSchemaType(type = " + TEST_CLASS + ".class)", cu);
- }
-
- public void testContainedWithName() throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createPackageInfoWithSchemaTypes();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation containedAnnotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- containedAnnotation.setName(TEST_NAME);
- assertEquals(TEST_NAME, containedAnnotation.getName());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType(name = \"" + TEST_NAME + "\"),@XmlSchemaType})", cu);
-
- containedAnnotation.setName(null);
- assertNull(containedAnnotation.getName());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})", cu);
- }
-
- public void testContainedWithNamespace() throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createPackageInfoWithSchemaTypes();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation containedAnnotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
-
- containedAnnotation.setNamespace(TEST_NAMESPACE);
- assertEquals(TEST_NAMESPACE, containedAnnotation.getNamespace());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType(namespace = \"" + TEST_NAMESPACE + "\"),@XmlSchemaType})", cu);
-
- containedAnnotation.setNamespace(null);
- assertNull(containedAnnotation.getNamespace());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})", cu);
- }
-
- public void testContainedWithType()throws Exception {
- // test contained annotation type setting/updating
-
- ICompilationUnit cu = createPackageInfoWithSchemaTypes();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- XmlSchemaTypeAnnotation containedAnnotation =
- (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_SCHEMA_TYPE);
-
- containedAnnotation.setType(TEST_CLASS);
- assertEquals(TEST_CLASS, containedAnnotation.getType());
- assertEquals(FQ_TEST_CLASS, containedAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType(type = " + TEST_CLASS + ".class)})", cu);
-
- containedAnnotation.setType(null);
- assertNull(containedAnnotation.getType());
- assertNull(FQ_TEST_CLASS, containedAnnotation.getFullyQualifiedType());
- assertSourceContains(
- "@XmlSchemaTypes({@XmlSchemaType,@XmlSchemaType})", cu);
- }
-
- public void testContained() throws Exception {
- // test adding/removing/moving
-
- ICompilationUnit cu = createPackageInfoWithSchemaType();
- JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
-
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
-
- resourcePackage.addAnnotation(1, JAXB.XML_SCHEMA_TYPE);
-
- assertEquals(2, resourcePackage.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- assertSourceContains("@XmlSchemaTypes({ @XmlSchemaType, @XmlSchemaType })", cu);
-
- XmlSchemaTypeAnnotation containedAnnotation1 = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE);
- containedAnnotation1.setName(TEST_NAME);
- XmlSchemaTypeAnnotation containedAnnotation2 = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(1, JAXB.XML_SCHEMA_TYPE);
- containedAnnotation2.setName(TEST_NAME_2);
- assertSourceContains(
- "@XmlSchemaTypes({ @XmlSchemaType(name = \"" + TEST_NAME
- + "\"), @XmlSchemaType(name = \"" + TEST_NAME_2
- + "\") })", cu);
-
- resourcePackage.moveAnnotation(0, 1, JAXB.XML_SCHEMA_TYPE);
- assertSourceContains(
- "@XmlSchemaTypes({ @XmlSchemaType(name = \"" + TEST_NAME_2
- + "\"), @XmlSchemaType(name = \"" + TEST_NAME
- + "\") })", cu);
-
- resourcePackage.removeAnnotation(1, JAXB.XML_SCHEMA_TYPE);
- assertEquals(1, resourcePackage.getAnnotationsSize(JAXB.XML_SCHEMA_TYPE));
- assertSourceContains(
- "@XmlSchemaType(name = \"" + TEST_NAME_2 + "\")", cu);
- assertSourceDoesNotContain("@XmlSchemaTypes", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
deleted file mode 100644
index a00b7b6718..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlSeeAlsoAnnotationTests
- extends JaxbJavaResourceModelTestCase {
-
- public XmlSeeAlsoAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlSeeAlso() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SEE_ALSO);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSeeAlso");
- }
- });
- }
-
- private ICompilationUnit createTestXmlSeeAlsoWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_SEE_ALSO);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlSeeAlso(value = {Foo.class, Bar.class})");
- }
- });
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
- assertEquals(0, xmlSeeAlsoAnnotation.getClassesSize());
- }
-
- public void testGetClasses() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
- ListIterator<String> classes = xmlSeeAlsoAnnotation.getClasses().iterator();
- assertEquals("Foo", classes.next());
- assertEquals("Bar", classes.next());
- }
-
- public void testGetClassesSize() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
- assertEquals(2, xmlSeeAlsoAnnotation.getClassesSize());
- }
-
- public void testAddClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.addClass("Fooo");
- xmlSeeAlsoAnnotation.addClass("Barrr");
-
- assertSourceContains("@XmlSeeAlso({ Fooo.class, Barrr.class })", cu);
- }
-
- public void testAddClassIndex() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.addClass(0, "Fooo");
- xmlSeeAlsoAnnotation.addClass(0, "Barr");
- xmlSeeAlsoAnnotation.addClass(1, "Blah");
-
- assertSourceContains("@XmlSeeAlso({ Barr.class, Blah.class, Fooo.class })", cu);
- }
-
- public void testRemoveClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.removeClass(0);
- assertSourceContains("@XmlSeeAlso(value = Bar.class)", cu);
-
- xmlSeeAlsoAnnotation.removeClass(0);
- assertSourceContains("@XmlSeeAlso", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
- public void testMoveClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
- assertTrue(xmlSeeAlsoAnnotation != null);
-
- xmlSeeAlsoAnnotation.addClass("Fooo");
- xmlSeeAlsoAnnotation.addClass("Barr");
- xmlSeeAlsoAnnotation.addClass("Blah");
- assertSourceContains("@XmlSeeAlso({ Fooo.class, Barr.class, Blah.class })", cu);
-
- xmlSeeAlsoAnnotation.moveClass(0, 1);
- assertSourceContains("@XmlSeeAlso({ Barr.class, Fooo.class, Blah.class })", cu);
-
- xmlSeeAlsoAnnotation.moveClass(2, 1);
- assertSourceContains("@XmlSeeAlso({ Barr.class, Blah.class, Fooo.class })", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.java
deleted file mode 100644
index 656a5947ed..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAttributeAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlTransientAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlTransientAttributeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TRANSIENT);
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransient");
- }
- });
- }
-
- public void testGetXmlTransient() throws Exception {
- ICompilationUnit cu = this.createTestXmlTransient();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = this.getMethod(resourceType, 0);
-
- XmlTransientAnnotation xmlTransientAnnotation = (XmlTransientAnnotation) resourceMethod.getAnnotation(JAXB.XML_TRANSIENT);
- assertTrue(xmlTransientAnnotation != null);
-
- resourceMethod.removeAnnotation(JAXB.XML_TRANSIENT);
- assertSourceDoesNotContain("@XmlTransient", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java
deleted file mode 100644
index 6a768654ed..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientTypeAnnotationTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlTransientTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlTransientTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransient");
- }
- });
- }
-
- public void testGetXmlTransient() throws Exception {
- ICompilationUnit cu = this.createTestXmlTransient();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTransientAnnotation xmlTransientAnnotation = (XmlTransientAnnotation) resourceType.getAnnotation(JAXB.XML_TRANSIENT);
- assertTrue(xmlTransientAnnotation != null);
-
- resourceType.removeAnnotation(JAXB.XML_TRANSIENT);
- assertSourceDoesNotContain("@XmlTransient", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
deleted file mode 100644
index 6995ed4d5c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- private static final String XML_TYPE_NAME = "XmlTypeName";
- private static final String XML_TYPE_NAMESPACE = "XmlTypeNamespace";
- private static final String XML_TYPE_FACTORY_METHOD = "myFactoryMethod";
- private static final String XML_TYPE_FACTORY_CLASS = "MyFactoryClass";
-
- public XmlTypeAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(name = \"" + XML_TYPE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithNamespace() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(namespace = \"" + XML_TYPE_NAMESPACE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithFactoryMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(factoryMethod = \"" + XML_TYPE_FACTORY_METHOD + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTypeWithFactoryClass() throws Exception {
- this.createTestFactoryClass();
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(factoryClass = " + XML_TYPE_FACTORY_CLASS + ".class)");
- }
- });
- }
-
- private void createTestFactoryClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(XML_TYPE_FACTORY_CLASS).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "MyFactoryClass.java", sourceWriter);
- }
-
- private ICompilationUnit createTestXmlTypeWithPropOrder() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType(propOrder = {\"foo\", \"bar\"})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_NAME, xmlTypeAnnotation.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertNull(xmlTypeAnnotation.getName());
- assertNull(xmlTypeAnnotation.getNamespace());
- assertNull(xmlTypeAnnotation.getFactoryClass());
- assertNull(xmlTypeAnnotation.getFullyQualifiedFactoryClassName());
- assertNull(xmlTypeAnnotation.getFactoryMethod());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getName());
- xmlTypeAnnotation.setName(XML_TYPE_NAME);
- assertEquals(XML_TYPE_NAME, xmlTypeAnnotation.getName());
-
- assertSourceContains("@XmlType(name = \"" + XML_TYPE_NAME + "\")", cu);
-
- xmlTypeAnnotation.setName(null);
- assertNull(xmlTypeAnnotation.getName());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(name = \"" + XML_TYPE_NAME + "\")", cu);
- }
-
- public void testGetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithNamespace();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_NAMESPACE, xmlTypeAnnotation.getNamespace());
- }
-
- public void testSetNamespace() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getNamespace());
- xmlTypeAnnotation.setNamespace(XML_TYPE_NAMESPACE);
- assertEquals(XML_TYPE_NAMESPACE, xmlTypeAnnotation.getNamespace());
-
- assertSourceContains("@XmlType(namespace = \"" + XML_TYPE_NAMESPACE + "\")", cu);
-
- xmlTypeAnnotation.setNamespace(null);
- assertNull(xmlTypeAnnotation.getNamespace());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(namespace = \"" + XML_TYPE_NAMESPACE + "\")", cu);
- }
-
- public void testGetFactoryMethod() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithFactoryMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_FACTORY_METHOD, xmlTypeAnnotation.getFactoryMethod());
- }
-
- public void testSetFactoryMethod() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryMethod());
- xmlTypeAnnotation.setFactoryMethod(XML_TYPE_FACTORY_METHOD);
- assertEquals(XML_TYPE_FACTORY_METHOD, xmlTypeAnnotation.getFactoryMethod());
-
- assertSourceContains("@XmlType(factoryMethod = \"" + XML_TYPE_FACTORY_METHOD + "\")", cu);
-
- xmlTypeAnnotation.setFactoryMethod(null);
- assertNull(xmlTypeAnnotation.getFactoryMethod());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(factoryMethod = \"" + XML_TYPE_FACTORY_METHOD + "\")", cu);
- }
-
- public void testGetFactoryClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithFactoryClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFactoryClass());
- assertEquals("test." + XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFullyQualifiedFactoryClassName());
- }
-
- public void testSetFactoryClass() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertNull(xmlTypeAnnotation.getFactoryClass());
- xmlTypeAnnotation.setFactoryClass(XML_TYPE_FACTORY_CLASS);
- assertEquals(XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFactoryClass());
-
- assertSourceContains("@XmlType(factoryClass = " + XML_TYPE_FACTORY_CLASS + ".class", cu);
-
- xmlTypeAnnotation.setFactoryClass(null);
- assertNull(xmlTypeAnnotation.getFactoryClass());
-
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("@XmlType(factoryClass = " + XML_TYPE_FACTORY_CLASS + ".class", cu);
- }
-
- public void testGetPropOrder() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- ListIterator<String> propOrder = xmlTypeAnnotation.getPropOrder().iterator();
- assertEquals("foo", propOrder.next());
- assertEquals("bar", propOrder.next());
- }
-
- public void testGetPropOrderSize() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
- assertEquals(2, xmlTypeAnnotation.getPropOrderSize());
- }
-
- public void testAddProp() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.addProp("fooo");
- xmlTypeAnnotation.addProp("barr");
-
- assertSourceContains("@XmlType(propOrder = { \"fooo\", \"barr\" })", cu);
- }
-
- public void testAddPropIndex() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.addProp(0, "fooo");
- xmlTypeAnnotation.addProp(0, "barr");
- xmlTypeAnnotation.addProp(1, "blah");
-
- assertSourceContains("@XmlType(propOrder = { \"barr\", \"blah\", \"fooo\" })", cu);
- }
-
- public void testRemoveProp() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.removeProp("foo");
- assertSourceContains("@XmlType(propOrder = \"bar\")", cu);
-
- xmlTypeAnnotation.removeProp("bar");
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("propOrder", cu);
- }
-
- public void testRemovePropIndex() throws Exception {
- ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.removeProp(0);
- assertSourceContains("@XmlType(propOrder = \"bar\")", cu);
-
- xmlTypeAnnotation.removeProp(0);
- assertSourceContains("@XmlType", cu);
- assertSourceDoesNotContain("propOrder", cu);
- }
-
- public void testMoveProp() throws Exception {
- ICompilationUnit cu = this.createTestXmlType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
- assertTrue(xmlTypeAnnotation != null);
-
- xmlTypeAnnotation.addProp("fooo");
- xmlTypeAnnotation.addProp("barr");
- xmlTypeAnnotation.addProp("blah");
- assertSourceContains("@XmlType(propOrder = { \"fooo\", \"barr\", \"blah\" })", cu);
-
- xmlTypeAnnotation.moveProp(0, 1);
- assertSourceContains("@XmlType(propOrder = { \"barr\", \"fooo\", \"blah\" })", cu);
-
- xmlTypeAnnotation.moveProp(2, 1);
- assertSourceContains("@XmlType(propOrder = { \"barr\", \"blah\", \"fooo\" })", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java
deleted file mode 100644
index eb635a316f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.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.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
-
-@SuppressWarnings("nls")
-public class XmlValueAnnotationTests extends JaxbJavaResourceModelTestCase {
-
- public XmlValueAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestXmlValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_VALUE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlValue");
- }
- });
- }
-
- public void testGetXmlValue() throws Exception {
- ICompilationUnit cu = this.createTestXmlValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- XmlValueAnnotation xmlValueAnnotation = (XmlValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_VALUE);
- assertTrue(xmlValueAnnotation != null);
-
- resourceAttribute.removeAnnotation(JAXB.XML_VALUE);
- assertSourceDoesNotContain("@XmlValue", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
deleted file mode 100644
index b86c694340..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/test.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.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 -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jaxb.core.tests"/> <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.resource.JaxbCoreResourceModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target>
- <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbCoreContextModelTests"/> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar}"/> </ant> </target> <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath
deleted file mode 100644
index f8b7c93a43..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.classpath
+++ /dev/null
@@ -1,14 +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">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jaxb/eclipselink/core/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project
deleted file mode 100644
index 71513f6b6e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.eclipselink.core.tests</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/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index ee129ed60e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Thu May 05 17:25:11 EDT 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index cf2be3c589..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,27 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jaxb.eclipselink.core.tests;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Localization: plugin
-Dali-Comment: jdk 1.6 has the javax.xml.bind annotations
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Activator: org.eclipse.jpt.jaxb.eclipselink.core.tests.JptJaxbEclipseLinkCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jdt.core;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.core.tests;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.jpt.jaxb.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jaxb.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.200,2.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.eclipselink.core.tests,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;x-internal:=true
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/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/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties
deleted file mode 100644
index 9cd29bcb38..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/build.properties
+++ /dev/null
@@ -1,16 +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
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties
deleted file mode 100644
index 8861cc4302..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +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 - EclipseLink JAXB Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java
deleted file mode 100644
index b4b6735882..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/JptJaxbEclipseLinkCoreTestsPlugin.java
+++ /dev/null
@@ -1,59 +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.eclipselink.core.tests;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jaxb.core.JaxbProjectManager;
-import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
-import org.eclipse.jpt.jaxb.core.internal.prefs.JaxbPreferencesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * configure the core to handle events synchronously when we are
- * running tests
- */
-@SuppressWarnings("nls")
-public class JptJaxbEclipseLinkCoreTestsPlugin
- extends Plugin {
-
- private static JptJaxbEclipseLinkCoreTestsPlugin INSTANCE;
-
-
- public static JptJaxbEclipseLinkCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJaxbEclipseLinkCoreTestsPlugin() {
- 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);
- JaxbProjectManager jaxbProjectManager = JptJaxbCorePlugin.getProjectManager();
- ReflectionTools.executeMethod(jaxbProjectManager, "handleEventsSynchronously");
- ReflectionTools.executeStaticMethod(JaxbPreferencesManager.class, "doNotFlushPreferences");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.java
deleted file mode 100644
index 233d80ca4e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/ELJaxbCoreTests.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.eclipselink.core.tests.internal;
-
-import java.io.File;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbCoreContextModelTests;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.ELJaxbCoreResourceModelTests;
-
-
-public class ELJaxbCoreTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(ELJaxbCoreTests.class.getPackage().getName());
- suite.addTest(ELJaxbCoreResourceModelTests.suite());
- suite.addTest(ELJaxbCoreContextModelTests.suite());
- return suite;
- }
-
- public static boolean requiredJarsExists() {
- return jaxbJarPropertyExists()
- && jaxbJarFileExists()
- && eclipselinkJarPropertyExists()
- && eclipselinkJarFileExists();
- }
-
- public static boolean jaxbJarPropertyExists() {
- return getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY) != null;
- }
-
- public static boolean jaxbJarFileExists() {
- return (new File(getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY))).exists();
- }
-
- public static boolean eclipselinkJarPropertyExists() {
- return getSystemProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY) != null;
- }
-
- public static boolean eclipselinkJarFileExists() {
- return (new File(getSystemProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY))).exists();
- }
-
- public static String buildMissingJarErrorMessage() {
- if( ! jaxbJarPropertyExists()) {
- return errorMissingProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY);
- }
- else if( ! jaxbJarFileExists()) {
- return errorJarFileDoesNotExist(getSystemProperty(TestJaxbProject.JAXB_JAR_NAME_SYSTEM_PROPERTY));
- }
- else if( ! eclipselinkJarPropertyExists()) {
- return errorMissingProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
- return errorJarFileDoesNotExist(getSystemProperty(TestJaxbProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY));
- }
-
- /*********** private **********/
- private static String errorMissingProperty(String propertyName) {
- return "missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String propertyValue) {
- return "JAR file doesn't exist: \"" + propertyValue + "\"";
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
-
- private ELJaxbCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbContextModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbContextModelTestCase.java
deleted file mode 100644
index 4bb947c77f..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbContextModelTestCase.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-
-
-public abstract class ELJaxbContextModelTestCase
- extends JaxbContextModelTestCase {
-
- public ELJaxbContextModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.getDefaultPlatform(getProjectFacetVersion());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java
deleted file mode 100644
index 1eacaf9eb8..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.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.jaxb.eclipselink.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.ELJaxbCoreTests;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java.ELJaxbCoreJavaContextModelTests;
-
-
-public class ELJaxbCoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(ELJaxbCoreContextModelTests.class.getName());
-
- if (ELJaxbCoreTests.requiredJarsExists()) {
-// suite.addTestSuite(GenericContextRootTests.class);
- suite.addTest(ELJaxbCoreJavaContextModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(ELJaxbCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private ELJaxbCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaClassMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaClassMappingTests.java
deleted file mode 100644
index 071df8fcc5..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaClassMappingTests.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaClassMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaClassMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- public void testModifyXmlDiscriminatorNode() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlDiscriminatorNodeAnnotation annotation =
- (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- assertNull(classMapping.getXmlDiscriminatorNode());
- assertNull(annotation);
-
- classMapping.addXmlDiscriminatorNode();
- annotation = (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- assertNotNull(classMapping.getXmlDiscriminatorNode());
- assertNotNull(annotation);
-
- classMapping.removeXmlDiscriminatorNode();
- annotation = (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- assertNull(classMapping.getXmlDiscriminatorNode());
- assertNull(annotation);
- }
-
- public void testUpdateXmlDiscriminatorNode() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlDiscriminatorNodeAnnotation annotation =
- (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- assertNull(classMapping.getXmlDiscriminatorNode());
- assertNull(annotation);
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), ELJaxb.XML_DISCRIMINATOR_NODE);
- }
- });
- annotation = (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- assertNotNull(classMapping.getXmlDiscriminatorNode());
- assertNotNull(annotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(
- ModifiedDeclaration declaration) {
- ELJavaClassMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_DISCRIMINATOR_NODE);
- }
- });
- annotation = (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- assertNull(classMapping.getXmlDiscriminatorNode());
- assertNull(annotation);
- }
-
- public void testModifyXmlDiscriminatorValue() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlDiscriminatorValueAnnotation annotation =
- (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- assertNull(classMapping.getXmlDiscriminatorValue());
- assertNull(annotation);
-
- classMapping.addXmlDiscriminatorValue();
- annotation = (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- assertNotNull(classMapping.getXmlDiscriminatorValue());
- assertNotNull(annotation);
-
- classMapping.removeXmlDiscriminatorValue();
- annotation = (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- assertNull(classMapping.getXmlDiscriminatorValue());
- assertNull(annotation);
- }
-
- public void testUpdateXmlDiscriminatorValue() throws Exception {
- createClassWithXmlType();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
-
- XmlDiscriminatorValueAnnotation annotation =
- (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- assertNull(classMapping.getXmlDiscriminatorValue());
- assertNull(annotation);
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaClassMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
- });
- annotation = (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- assertNotNull(classMapping.getXmlDiscriminatorValue());
- assertNotNull(annotation);
-
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(
- ModifiedDeclaration declaration) {
- ELJavaClassMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
- });
- annotation = (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- assertNull(classMapping.getXmlDiscriminatorValue());
- assertNull(annotation);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyAttributeMappingTests.java
deleted file mode 100644
index 3e98fb4ba6..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyAttributeMappingTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAnyAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlAnyAttributeMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlAnyAttributeMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlAnyAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ANY_ATTRIBUTE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyAttribute");
- }
- });
- }
-
-
- public void testModifyXmlPath() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAnyAttributeMapping mapping = (ELJavaXmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- mapping.addXmlPath();
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- mapping.removeXmlPath();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-
- public void testUpdateXmlPath() throws Exception {
- createTypeWithXmlAnyAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAnyAttributeMapping mapping = (ELJavaXmlAnyAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAnyAttributeMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAnyAttributeMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyElementMappingTests.java
deleted file mode 100644
index c1105b1d0b..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAnyElementMappingTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAnyElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlAnyElementMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlAnyElementMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlAnyElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ANY_ELEMENT);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAnyElement");
- }
- });
- }
-
-
- public void testModifyXmlPath() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAnyElementMapping mapping = (ELJavaXmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- mapping.addXmlPath();
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- mapping.removeXmlPath();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-
- public void testUpdateXmlPath() throws Exception {
- createTypeWithXmlAnyElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAnyElementMapping mapping = (ELJavaXmlAnyElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAttributeMappingTests.java
deleted file mode 100644
index 5bd7097c79..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlAttributeMappingTests.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlAttributeMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlAttributeMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlAttributeMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- private ICompilationUnit createTypeWithXmlAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ATTRIBUTE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlAttribute");
- }
- });
- }
-
- private ICompilationUnit createTypeWithXmlPath() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_PATH);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlPath");
- }
- });
- }
-
-
- public void testModifyXmlPath() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAttributeMapping mapping = (ELJavaXmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- mapping.addXmlPath();
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- mapping.removeXmlPath();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-
- public void testUpdateXmlPath() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAttributeMapping mapping = (ELJavaXmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-
- public void testDefault() throws Exception {
- createTypeWithXmlPath();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- JavaResourceAttribute resourceAttribute = persistentAttribute.getJavaResourceAttribute();
- XmlPathAnnotation xmlPathAnnotation = (XmlPathAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_PATH);
-
- assertNotNull(xmlPathAnnotation);
- assertFalse(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_PATH, "./element[@name=\"foo\"]/element[1]/text()");
- }
- });
-
- assertNotNull(xmlPathAnnotation.getValue());
- assertFalse(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_PATH, "element/@attribute");
- }
- });
-
- assertNotNull(xmlPathAnnotation.getValue());
- assertTrue(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertNull(xmlPathAnnotation.getValue());
- assertFalse(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY);
- }
-
- public void testModifyXmlKey() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAttributeMapping mapping = (ELJavaXmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
-
- mapping.addXmlKey();
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNotNull(mapping.getXmlKey());
-
- mapping.removeXmlKey();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
- }
-
- public void testUpdateXmlKey() throws Exception {
- createTypeWithXmlAttribute();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlAttributeMapping mapping = (ELJavaXmlAttributeMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_KEY);
- }
- });
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNotNull(mapping.getXmlKey());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_KEY);
- }
- });
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorNodeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorNodeTests.java
deleted file mode 100644
index a8c111f83a..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorNodeTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlDiscriminatorNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlDiscriminatorNodeTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlDiscriminatorNodeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
-
- private ICompilationUnit createTypeWithXmlDiscriminatorNode() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_DISCRIMINATOR_NODE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlDiscriminatorNode").append(CR);
- }
- });
- }
-
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlDiscriminatorNode();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- ELXmlDiscriminatorNode discNode = classMapping.getXmlDiscriminatorNode();
- XmlDiscriminatorNodeAnnotation annotation =
- (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
-
- assertNull(annotation.getValue());
- assertNull(discNode.getValue());
-
- discNode.setValue("foo");
-
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", discNode.getValue());
-
- discNode.setValue("");
-
- assertEquals("", annotation.getValue());
- assertEquals("", discNode.getValue());
-
- discNode.setValue(null);
-
- assertNull(annotation.getValue());
- assertNull(discNode.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlDiscriminatorNode();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- ELXmlDiscriminatorNode discNode = classMapping.getXmlDiscriminatorNode();
- XmlDiscriminatorNodeAnnotation annotation =
- (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
-
- assertNull(annotation.getValue());
- assertNull(discNode.getValue());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlDiscriminatorNodeTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_DISCRIMINATOR_NODE, "foo");
- }
- });
-
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", discNode.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlDiscriminatorNodeTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_DISCRIMINATOR_NODE, "");
- }
- });
-
- assertEquals("", annotation.getValue());
- assertEquals("", discNode.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlDiscriminatorNodeTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_DISCRIMINATOR_NODE);
- }
- });
-
- assertNull(annotation.getValue());
- assertNull(discNode.getValue());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorValueTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorValueTests.java
deleted file mode 100644
index efc79fa8e0..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlDiscriminatorValueTests.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELClassMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlDiscriminatorValue;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlDiscriminatorValueTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlDiscriminatorValueTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
-
- private ICompilationUnit createTypeWithXmlDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType").append(CR);
- sb.append("@XmlDiscriminatorValue").append(CR);
- }
- });
- }
-
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlDiscriminatorValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- ELXmlDiscriminatorValue discValue = classMapping.getXmlDiscriminatorValue();
- XmlDiscriminatorValueAnnotation annotation =
- (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
-
- assertNull(annotation.getValue());
- assertNull(discValue.getValue());
-
- discValue.setValue("foo");
-
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", discValue.getValue());
-
- discValue.setValue("");
-
- assertEquals("", annotation.getValue());
- assertEquals("", discValue.getValue());
-
- discValue.setValue(null);
-
- assertNull(annotation.getValue());
- assertNull(discValue.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlDiscriminatorValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JavaResourceType resourceType = jaxbClass.getJavaResourceType();
- ELClassMapping classMapping = (ELClassMapping) jaxbClass.getMapping();
- ELXmlDiscriminatorValue discValue = classMapping.getXmlDiscriminatorValue();
- XmlDiscriminatorValueAnnotation annotation =
- (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
-
- assertNull(annotation.getValue());
- assertNull(discValue.getValue());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceType);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlDiscriminatorValueTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_DISCRIMINATOR_VALUE, "foo");
- }
- });
-
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", discValue.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlDiscriminatorValueTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_DISCRIMINATOR_VALUE, "");
- }
- });
-
- assertEquals("", annotation.getValue());
- assertEquals("", discValue.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlDiscriminatorValueTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
- });
-
- assertNull(annotation.getValue());
- assertNull(discValue.getValue());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementMappingTests.java
deleted file mode 100644
index c44f46f873..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementMappingTests.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.MappingKeys;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlElementMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlElementMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- private ICompilationUnit createTypeWithXmlElement() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENT);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElement");
- }
- });
- }
-
- private ICompilationUnit createTypeWithXmlPath() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_PATH);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlPath");
- }
- });
- }
-
-
- public void testModifyXmlPath() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- mapping.addXmlPath();
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- mapping.removeXmlPath();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-
- public void testUpdateXmlPath() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(1, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNotNull(mapping.getXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertEquals(0, CollectionTools.size(resourceAttribute.getAnnotations(ELJaxb.XML_PATH)));
- assertNull(mapping.getXmlPath());
- }
-
- public void testDefault() throws Exception {
- createTypeWithXmlPath();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- JavaResourceAttribute resourceAttribute = persistentAttribute.getJavaResourceAttribute();
- XmlPathAnnotation xmlPathAnnotation = (XmlPathAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_PATH);
-
- assertNotNull(xmlPathAnnotation);
- assertTrue(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_PATH, "element/@attribute");
- }
- });
-
- assertNotNull(xmlPathAnnotation.getValue());
- assertFalse(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_PATH, "./element[@name=\"foo\"]/element[1]/text()");
- }
- });
-
- assertNotNull(xmlPathAnnotation.getValue());
- assertTrue(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertNull(xmlPathAnnotation.getValue());
- assertTrue(persistentAttribute.getMapping().getKey() == MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY);
- }
-
- public void testModifyXmlKey() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
-
- mapping.addXmlKey();
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNotNull(mapping.getXmlKey());
-
- mapping.removeXmlKey();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
- }
-
- public void testUpdateXmlKey() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_KEY);
- }
- });
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNotNull(mapping.getXmlKey());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_KEY);
- }
- });
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_KEY));
- assertNull(mapping.getXmlKey());
- }
-
- public void testModifyXmlCDATA() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
-
- mapping.addXmlCDATA();
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNotNull(mapping.getXmlCDATA());
-
- mapping.removeXmlCDATA();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
- }
-
- public void testUpdateXmlCDATA() throws Exception {
- createTypeWithXmlElement();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_CDATA);
- }
- });
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNotNull(mapping.getXmlCDATA());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_CDATA);
- }
- });
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementsMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementsMappingTests.java
deleted file mode 100644
index 8f81a35897..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlElementsMappingTests.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlElementsMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlElementsMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlElementsMappingTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlElements() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_ELEMENTS);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlElements");
- }
- });
- }
-
- protected NormalAnnotation newXmlPathAnnotation(AST ast, String value) {
- NormalAnnotation annotation = newNormalAnnotation(ast, ELJaxb.XML_PATH);
- addMemberValuePair(annotation, ELJaxb.XML_PATH__VALUE, value);
- return annotation;
- }
-
- protected void addXmlPath(ModifiedDeclaration declaration, int index, String value) {
- NormalAnnotation annotation = newXmlPathAnnotation(declaration.getAst(), value);
- addArrayElement(declaration, ELJaxb.XML_PATHS, index, "value", annotation);
- }
-
- protected void moveXmlPath(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(ELJaxb.XML_PATHS), "value", targetIndex, sourceIndex);
- }
-
- protected void removeXmlPath(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(ELJaxb.XML_PATHS), "value", index);
- }
-
-
- public void testUpdateXmlElements() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- ELXmlElementsMapping mapping = (ELXmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<ELXmlPath> xmlPaths = mapping.getXmlPaths();
- assertTrue(CollectionTools.isEmpty(xmlPaths));
- assertEquals(0, mapping.getXmlPathsSize());
-
- //add 2 XmlPath annotations
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementsMappingTests.this.addXmlPath(declaration, 0, "foo");
- ELJavaXmlElementsMappingTests.this.addXmlPath(declaration, 1, "bar");
- }
- });
-
- xmlPaths = mapping.getXmlPaths();
-
- assertFalse(CollectionTools.isEmpty(xmlPaths));
- assertEquals(2, mapping.getXmlPathsSize());
- assertEquals("foo", CollectionTools.get(xmlPaths, 0).getValue());
- assertEquals("bar", CollectionTools.get(xmlPaths, 1).getValue());
-
- // switch XmlPath annotations
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementsMappingTests.this.moveXmlPath(declaration, 0, 1);
- }
- });
-
- xmlPaths = mapping.getXmlPaths();
-
- assertFalse(CollectionTools.isEmpty(xmlPaths));
- assertEquals(2, mapping.getXmlPathsSize());
- assertEquals("bar", CollectionTools.get(xmlPaths, 0).getValue());
- assertEquals("foo", CollectionTools.get(xmlPaths, 1).getValue());
-
- // remove XmlPath annotations
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlElementsMappingTests.this.removeXmlPath(declaration, 1);
- ELJavaXmlElementsMappingTests.this.removeXmlPath(declaration, 0);
- }
- });
-
- xmlPaths = mapping.getXmlPaths();
-
- assertTrue(CollectionTools.isEmpty(xmlPaths));
- assertEquals(0, mapping.getXmlPathsSize());
- }
-
- public void testModifyXmlPaths() throws Exception {
- createTypeWithXmlElements();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- ELXmlElementsMapping mapping = (ELXmlElementsMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, resourceAttribute.getAnnotationsSize(ELJaxb.XML_PATH));
- assertEquals(0, mapping.getXmlPathsSize());
-
- mapping.addXmlPath(0).setValue("foo");
- mapping.addXmlPath(1).setValue("baz");
- mapping.addXmlPath(1).setValue("bar");
-
- Iterable<XmlPathAnnotation> xmlPathAnnotations =
- new SubIterableWrapper(resourceAttribute.getAnnotations(ELJaxb.XML_PATH));
-
- assertEquals(3, CollectionTools.size(xmlPathAnnotations));
- assertEquals(3, mapping.getXmlPathsSize());
- assertEquals("foo", CollectionTools.get(xmlPathAnnotations, 0).getValue());
- assertEquals("bar", CollectionTools.get(xmlPathAnnotations, 1).getValue());
- assertEquals("baz", CollectionTools.get(xmlPathAnnotations, 2).getValue());
-
- mapping.moveXmlPath(1, 2);
-
- xmlPathAnnotations =
- new SubIterableWrapper(resourceAttribute.getAnnotations(ELJaxb.XML_PATH));
-
- assertEquals(3, CollectionTools.size(xmlPathAnnotations));
- assertEquals(3, mapping.getXmlPathsSize());
- assertEquals("foo", CollectionTools.get(xmlPathAnnotations, 0).getValue());
- assertEquals("baz", CollectionTools.get(xmlPathAnnotations, 1).getValue());
- assertEquals("bar", CollectionTools.get(xmlPathAnnotations, 2).getValue());
-
- mapping.removeXmlPath(2);
- mapping.removeXmlPath(0);
- mapping.removeXmlPath(0);
-
- xmlPathAnnotations =
- new SubIterableWrapper(resourceAttribute.getAnnotations(ELJaxb.XML_PATH));
-
- assertEquals(0, CollectionTools.size(xmlPathAnnotations));
- assertEquals(0, mapping.getXmlPathsSize());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlInverseReferenceMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlInverseReferenceMappingTests.java
deleted file mode 100644
index ba7710b517..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlInverseReferenceMappingTests.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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlInverseReferenceMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlInverseReferenceMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlInverseReferenceMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTypeWithXmlInverseReference() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_INVERSE_REFERENCE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInverseReference");
- }
- });
- }
-
-
- public void testModifyMappedBy() throws Exception {
- createTypeWithXmlInverseReference();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlInverseReferenceMapping mapping = (ELJavaXmlInverseReferenceMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlInverseReferenceAnnotation annotation = (XmlInverseReferenceAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_INVERSE_REFERENCE);
-
- assertNull(annotation.getMappedBy());
- assertNull(mapping.getMappedBy());
-
- mapping.setMappedBy("foo");
-
- assertEquals("foo", annotation.getMappedBy());
- assertEquals("foo", mapping.getMappedBy());
-
- mapping.setMappedBy(null);
-
- assertNull(annotation.getMappedBy());
- assertNull(mapping.getMappedBy());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTypeWithXmlInverseReference();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlInverseReferenceMapping mapping = (ELJavaXmlInverseReferenceMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- XmlInverseReferenceAnnotation annotation = (XmlInverseReferenceAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_INVERSE_REFERENCE);
-
- assertNull(annotation.getMappedBy());
- assertNull(mapping.getMappedBy());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlInverseReferenceMappingTests.this.addMemberValuePair(
- (MarkerAnnotation) declaration.getAnnotationNamed(ELJaxb.XML_INVERSE_REFERENCE),
- ELJaxb.XML_INVERSE_REFERENCE__MAPPED_BY, "foo");
- }
- });
-
- assertEquals("foo", annotation.getMappedBy());
- assertEquals("foo", mapping.getMappedBy());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- NormalAnnotation annotation = (NormalAnnotation) declaration.getAnnotationNamed(ELJaxb.XML_INVERSE_REFERENCE);
- ELJavaXmlInverseReferenceMappingTests.this.values(annotation).remove(0);
- }
- });
-
- assertNull(annotation.getMappedBy());
- assertNull(mapping.getMappedBy());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodeTests.java
deleted file mode 100644
index 0cbe7d3f3e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodeTests.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNodesMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlJoinNodesMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlJoinNodeTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlJoinNodeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- private ICompilationUnit createTypeWithXmlJoinNode() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_JOIN_NODE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJoinNode");
- }
- });
- }
-
-
- public void testModifyXmlPath() throws Exception {
- createTypeWithXmlJoinNode();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELXmlJoinNodesMapping mapping = (ELXmlJoinNodesMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- ELXmlJoinNode xmlJoinNode = CollectionTools.get(mapping.getXmlJoinNodes(), 0);
- XmlJoinNodeAnnotation annotation = (XmlJoinNodeAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_JOIN_NODE);
-
- assertNull(annotation.getXmlPath());
- assertNull(xmlJoinNode.getXmlPath());
-
- xmlJoinNode.setXmlPath("foo");
-
- assertEquals("foo", annotation.getXmlPath());
- assertEquals("foo", xmlJoinNode.getXmlPath());
-
- xmlJoinNode.setXmlPath("");
-
- assertEquals("", annotation.getXmlPath());
- assertEquals("", xmlJoinNode.getXmlPath());
-
- xmlJoinNode.setXmlPath(null);
-
- assertNull(annotation.getXmlPath());
- assertNull(xmlJoinNode.getXmlPath());
- }
-
- public void testUpdateXmlPath() throws Exception {
- createTypeWithXmlJoinNode();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlJoinNodesMapping mapping = (ELJavaXmlJoinNodesMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- ELXmlJoinNode xmlJoinNode = CollectionTools.get(mapping.getXmlJoinNodes(), 0);
- XmlJoinNodeAnnotation annotation = (XmlJoinNodeAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_JOIN_NODE);
-
- assertNull(annotation.getXmlPath());
- assertNull(xmlJoinNode.getXmlPath());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodeTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_JOIN_NODE, ELJaxb.XML_JOIN_NODE__XML_PATH, "foo");
- }
- });
-
- assertEquals("foo", annotation.getXmlPath());
- assertEquals("foo", xmlJoinNode.getXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodeTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_JOIN_NODE, ELJaxb.XML_JOIN_NODE__XML_PATH, "");
- }
- });
-
- assertEquals("", annotation.getXmlPath());
- assertEquals("", xmlJoinNode.getXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodeTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_JOIN_NODE, ELJaxb.XML_JOIN_NODE__XML_PATH);
- }
- });
-
- assertNull(annotation.getXmlPath());
- assertNull(xmlJoinNode.getXmlPath());
- }
-
- public void testModifyReferencedXmlPath() throws Exception {
- createTypeWithXmlJoinNode();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELXmlJoinNodesMapping mapping = (ELXmlJoinNodesMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- ELXmlJoinNode xmlJoinNode = CollectionTools.get(mapping.getXmlJoinNodes(), 0);
- XmlJoinNodeAnnotation annotation = (XmlJoinNodeAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_JOIN_NODE);
-
- assertNull(annotation.getReferencedXmlPath());
- assertNull(xmlJoinNode.getReferencedXmlPath());
-
- xmlJoinNode.setReferencedXmlPath("foo");
-
- assertEquals("foo", annotation.getReferencedXmlPath());
- assertEquals("foo", xmlJoinNode.getReferencedXmlPath());
-
- xmlJoinNode.setReferencedXmlPath("");
-
- assertEquals("", annotation.getReferencedXmlPath());
- assertEquals("", xmlJoinNode.getReferencedXmlPath());
-
- xmlJoinNode.setReferencedXmlPath(null);
-
- assertNull(annotation.getReferencedXmlPath());
- assertNull(xmlJoinNode.getReferencedXmlPath());
- }
-
- public void testUpdateReferencedXmlPath() throws Exception {
- createTypeWithXmlJoinNode();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlJoinNodesMapping mapping = (ELJavaXmlJoinNodesMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- ELXmlJoinNode xmlJoinNode = CollectionTools.get(mapping.getXmlJoinNodes(), 0);
- XmlJoinNodeAnnotation annotation = (XmlJoinNodeAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_JOIN_NODE);
-
- assertNull(annotation.getReferencedXmlPath());
- assertNull(xmlJoinNode.getReferencedXmlPath());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodeTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_JOIN_NODE, ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH, "foo");
- }
- });
-
- assertEquals("foo", annotation.getReferencedXmlPath());
- assertEquals("foo", xmlJoinNode.getReferencedXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodeTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_JOIN_NODE, ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH, "");
- }
- });
-
- assertEquals("", annotation.getReferencedXmlPath());
- assertEquals("", xmlJoinNode.getReferencedXmlPath());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodeTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_JOIN_NODE, ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH);
- }
- });
-
- assertNull(annotation.getReferencedXmlPath());
- assertNull(xmlJoinNode.getReferencedXmlPath());
- }
-} \ No newline at end of file
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodesMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodesMappingTests.java
deleted file mode 100644
index ce0559ae6a..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlJoinNodesMappingTests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNode;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlJoinNodesMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlJoinNodesMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlJoinNodesMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- private ICompilationUnit createTypeWithXmlJoinNodes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_JOIN_NODES);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJoinNodes");
- }
- });
- }
-
- protected NormalAnnotation newXmlJoinNodeAnnotation(AST ast, String xmlPath, String referencedXmlPath) {
- NormalAnnotation annotation = newNormalAnnotation(ast, ELJaxb.XML_JOIN_NODE);
- addMemberValuePair(annotation, ELJaxb.XML_JOIN_NODE__XML_PATH, xmlPath);
- addMemberValuePair(annotation, ELJaxb.XML_JOIN_NODE__REFERENCED_XML_PATH, referencedXmlPath);
- return annotation;
- }
-
- protected void addXmlJoinNode(ModifiedDeclaration declaration, int index, String xmlPath, String referencedXmlPath) {
- NormalAnnotation annotation = newXmlJoinNodeAnnotation(declaration.getAst(), xmlPath, referencedXmlPath);
- addArrayElement(declaration, ELJaxb.XML_JOIN_NODES, index, "value", annotation);
- }
-
- protected void moveXmlJoinNode(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) {
- moveArrayElement((NormalAnnotation) declaration.getAnnotationNamed(ELJaxb.XML_JOIN_NODES), "value", targetIndex, sourceIndex);
- }
-
- protected void removeXmlJoinNode(ModifiedDeclaration declaration, int index) {
- removeArrayElement((NormalAnnotation) declaration.getAnnotationNamed(ELJaxb.XML_JOIN_NODES), "value", index);
- }
-
-
- public void testUpdateXmlJoinNodes() throws Exception {
- createTypeWithXmlJoinNodes();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- ELXmlJoinNodesMapping mapping = (ELXmlJoinNodesMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- Iterable<ELXmlJoinNode> xmlJoinNodes = mapping.getXmlJoinNodes();
- assertTrue(CollectionTools.isEmpty(xmlJoinNodes));
- assertEquals(0, mapping.getXmlJoinNodesSize());
-
- //add 2 XmlJoinNode annotations
- AnnotatedElement annotatedElement = annotatedElement(resourceAttribute);
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodesMappingTests.this.addXmlJoinNode(declaration, 0, "foo", "@foo");
- ELJavaXmlJoinNodesMappingTests.this.addXmlJoinNode(declaration, 1, "bar", "@bar");
- }
- });
-
- xmlJoinNodes = mapping.getXmlJoinNodes();
-
- assertFalse(CollectionTools.isEmpty(xmlJoinNodes));
- assertEquals(2, mapping.getXmlJoinNodesSize());
- assertEquals("foo", CollectionTools.get(xmlJoinNodes, 0).getXmlPath());
- assertEquals("@foo", CollectionTools.get(xmlJoinNodes, 0).getReferencedXmlPath());
- assertEquals("bar", CollectionTools.get(xmlJoinNodes, 1).getXmlPath());
- assertEquals("@bar", CollectionTools.get(xmlJoinNodes, 1).getReferencedXmlPath());
-
- // switch XmlJoinNode annotations
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodesMappingTests.this.moveXmlJoinNode(declaration, 0, 1);
- }
- });
-
- xmlJoinNodes = mapping.getXmlJoinNodes();
-
- assertFalse(CollectionTools.isEmpty(xmlJoinNodes));
- assertEquals(2, mapping.getXmlJoinNodesSize());
- assertEquals("bar", CollectionTools.get(xmlJoinNodes, 0).getXmlPath());
- assertEquals("@bar", CollectionTools.get(xmlJoinNodes, 0).getReferencedXmlPath());
- assertEquals("foo", CollectionTools.get(xmlJoinNodes, 1).getXmlPath());
- assertEquals("@foo", CollectionTools.get(xmlJoinNodes, 1).getReferencedXmlPath());
-
- // remove XmlJoinNode annotations
- annotatedElement.edit(
- new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlJoinNodesMappingTests.this.removeXmlJoinNode(declaration, 1);
- ELJavaXmlJoinNodesMappingTests.this.removeXmlJoinNode(declaration, 0);
- }
- });
-
- xmlJoinNodes = mapping.getXmlJoinNodes();
-
- assertTrue(CollectionTools.isEmpty(xmlJoinNodes));
- assertEquals(0, mapping.getXmlJoinNodesSize());
- }
-
- public void testModifyXmlJoinNodes() throws Exception {
- createTypeWithXmlJoinNodes();
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- ELXmlJoinNodesMapping mapping = (ELXmlJoinNodesMapping) CollectionTools.get(classMapping.getAttributes(), 0).getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertEquals(0, resourceAttribute.getAnnotationsSize(ELJaxb.XML_JOIN_NODE));
- assertEquals(0, mapping.getXmlJoinNodesSize());
-
- ELXmlJoinNode joinNode = mapping.addXmlJoinNode(0);
- joinNode.setXmlPath("foo");
- joinNode.setReferencedXmlPath("@foo");
- joinNode = mapping.addXmlJoinNode(1);
- joinNode.setXmlPath("baz");
- joinNode.setReferencedXmlPath("@baz");
- joinNode = mapping.addXmlJoinNode(1);
- joinNode.setXmlPath("bar");
- joinNode.setReferencedXmlPath("@bar");
-
- Iterable<XmlJoinNodeAnnotation> xmlJoinNodeAnnotations =
- new SubIterableWrapper(resourceAttribute.getAnnotations(ELJaxb.XML_JOIN_NODE));
-
- assertEquals(3, CollectionTools.size(xmlJoinNodeAnnotations));
- assertEquals(3, mapping.getXmlJoinNodesSize());
- assertEquals("foo", CollectionTools.get(xmlJoinNodeAnnotations, 0).getXmlPath());
- assertEquals("@foo", CollectionTools.get(xmlJoinNodeAnnotations, 0).getReferencedXmlPath());
- assertEquals("bar", CollectionTools.get(xmlJoinNodeAnnotations, 1).getXmlPath());
- assertEquals("@bar", CollectionTools.get(xmlJoinNodeAnnotations, 1).getReferencedXmlPath());
- assertEquals("baz", CollectionTools.get(xmlJoinNodeAnnotations, 2).getXmlPath());
- assertEquals("@baz", CollectionTools.get(xmlJoinNodeAnnotations, 2).getReferencedXmlPath());
-
- mapping.moveXmlJoinNode(1, 2);
-
- xmlJoinNodeAnnotations =
- new SubIterableWrapper(resourceAttribute.getAnnotations(ELJaxb.XML_JOIN_NODE));
-
- assertEquals(3, CollectionTools.size(xmlJoinNodeAnnotations));
- assertEquals(3, mapping.getXmlJoinNodesSize());
- assertEquals("foo", CollectionTools.get(xmlJoinNodeAnnotations, 0).getXmlPath());
- assertEquals("@foo", CollectionTools.get(xmlJoinNodeAnnotations, 0).getReferencedXmlPath());
- assertEquals("baz", CollectionTools.get(xmlJoinNodeAnnotations, 1).getXmlPath());
- assertEquals("@baz", CollectionTools.get(xmlJoinNodeAnnotations, 1).getReferencedXmlPath());
- assertEquals("bar", CollectionTools.get(xmlJoinNodeAnnotations, 2).getXmlPath());
- assertEquals("@bar", CollectionTools.get(xmlJoinNodeAnnotations, 2).getReferencedXmlPath());
-
- mapping.removeXmlJoinNode(2);
- mapping.removeXmlJoinNode(0);
- mapping.removeXmlJoinNode(0);
-
- xmlJoinNodeAnnotations =
- new SubIterableWrapper(resourceAttribute.getAnnotations(ELJaxb.XML_JOIN_NODE));
-
- assertEquals(0, CollectionTools.size(xmlJoinNodeAnnotations));
- assertEquals(0, mapping.getXmlJoinNodesSize());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlPathTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlPathTests.java
deleted file mode 100644
index 2f58cb937e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlPathTests.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.context.java.ELXmlPath;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlElementMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlPathTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlPathTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTypeWithXmlPath() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, ELJaxb.XML_PATH);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlPath");
- }
- });
- }
-
-
- public void testModifyValue() throws Exception {
- createTypeWithXmlPath();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELXmlElementMapping mapping = (ELXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- ELXmlPath xpath = mapping.getXmlPath();
- XmlPathAnnotation annotation = (XmlPathAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_PATH);
-
- assertNull(annotation.getValue());
- assertNull(xpath.getValue());
-
- xpath.setValue("foo");
-
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", xpath.getValue());
-
- xpath.setValue("");
-
- assertEquals("", annotation.getValue());
- assertEquals("", xpath.getValue());
-
- xpath.setValue(null);
-
- assertNull(annotation.getValue());
- assertNull(xpath.getValue());
- }
-
- public void testUpdateValue() throws Exception {
- createTypeWithXmlPath();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlElementMapping mapping = (ELJavaXmlElementMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
- ELXmlPath xpath = mapping.getXmlPath();
- XmlPathAnnotation annotation = (XmlPathAnnotation) resourceAttribute.getAnnotation(0, ELJaxb.XML_PATH);
-
- assertNull(annotation.getValue());
- assertNull(xpath.getValue());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlPathTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_PATH, "foo");
- }
- });
-
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", xpath.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlPathTests.this.setMemberValuePair(
- declaration, ELJaxb.XML_PATH, "");
- }
- });
-
- assertEquals("", annotation.getValue());
- assertEquals("", xpath.getValue());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlPathTests.this.removeMemberValuePair(
- declaration, ELJaxb.XML_PATH);
- }
- });
-
- assertNull(annotation.getValue());
- assertNull(xpath.getValue());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlValueMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlValueMappingTests.java
deleted file mode 100644
index b1e44a2b14..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJavaXmlValueMappingTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.Member;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.core.context.JaxbClass;
-import org.eclipse.jpt.jaxb.core.context.JaxbClassMapping;
-import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute;
-import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription;
-import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
-import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbPlatform;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.context.java.ELJavaXmlValueMapping;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
-
-
-public class ELJavaXmlValueMappingTests
- extends ELJaxbContextModelTestCase {
-
- public ELJavaXmlValueMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected JaxbPlatformDescription getPlatform() {
- return ELJaxbPlatform.VERSION_2_2;
- }
-
- private ICompilationUnit createTypeWithXmlValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JAXB.XML_TYPE, JAXB.XML_VALUE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlType");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlValue");
- }
- });
- }
-
- public void testModifyXmlCDATA() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlValueMapping mapping = (ELJavaXmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
-
- mapping.addXmlCDATA();
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNotNull(mapping.getXmlCDATA());
-
- mapping.removeXmlCDATA();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
- }
-
- public void testUpdateXmlCDATA() throws Exception {
- createTypeWithXmlValue();
-
- JaxbClass jaxbClass = (JaxbClass) CollectionTools.get(getContextRoot().getTypes(), 0);
- JaxbClassMapping classMapping = jaxbClass.getMapping();
- JaxbPersistentAttribute persistentAttribute = CollectionTools.get(classMapping.getAttributes(), 0);
- ELJavaXmlValueMapping mapping = (ELJavaXmlValueMapping) persistentAttribute.getMapping();
- JavaResourceAttribute resourceAttribute = mapping.getPersistentAttribute().getJavaResourceAttribute();
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
-
- AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute);
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlValueMappingTests.this.addMarkerAnnotation(
- declaration.getDeclaration(), ELJaxb.XML_CDATA);
- }
- });
-
- assertNotNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNotNull(mapping.getXmlCDATA());
-
- annotatedElement.edit(new Member.Editor() {
- public void edit(ModifiedDeclaration declaration) {
- ELJavaXmlValueMappingTests.this.removeAnnotation(declaration, ELJaxb.XML_CDATA);
- }
- });
-
- assertNull(resourceAttribute.getAnnotation(ELJaxb.XML_CDATA));
- assertNull(mapping.getXmlCDATA());
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJaxbCoreJavaContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJaxbCoreJavaContextModelTests.java
deleted file mode 100644
index 29bc7f62f8..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/java/ELJaxbCoreJavaContextModelTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-
-public class ELJaxbCoreJavaContextModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(ELJaxbCoreJavaContextModelTests.class.getName());
- suite.addTestSuite(ELJavaClassMappingTests.class);
- suite.addTestSuite(ELJavaXmlAnyAttributeMappingTests.class);
- suite.addTestSuite(ELJavaXmlAnyElementMappingTests.class);
- suite.addTestSuite(ELJavaXmlAttributeMappingTests.class);
- suite.addTestSuite(ELJavaXmlDiscriminatorNodeTests.class);
- suite.addTestSuite(ELJavaXmlDiscriminatorValueTests.class);
- suite.addTestSuite(ELJavaXmlElementMappingTests.class);
- suite.addTestSuite(ELJavaXmlElementsMappingTests.class);
- suite.addTestSuite(ELJavaXmlInverseReferenceMappingTests.class);
- suite.addTestSuite(ELJavaXmlJoinNodesMappingTests.class);
- suite.addTestSuite(ELJavaXmlJoinNodeTests.class);
- suite.addTestSuite(ELJavaXmlPathTests.class);
- suite.addTestSuite(ELJavaXmlValueMappingTests.class);
- return suite;
- }
-
-
- private ELJaxbCoreJavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
deleted file mode 100644
index 12a00c2ed6..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/ELJaxbCoreResourceModelTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.ELJaxbCoreTests;
-import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java.ELJaxbJavaResourceModelTests;
-
-
-public class ELJaxbCoreResourceModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(ELJaxbCoreResourceModelTests.class.getName());
-
- if (ELJaxbCoreTests.requiredJarsExists()) {
- suite.addTest(ELJaxbJavaResourceModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(ELJaxbCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
-
- private ELJaxbCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
deleted file mode 100644
index 479010c881..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.tests.internal.resource.java.JavaResourceModelTestCase;
-import org.eclipse.jpt.jaxb.core.tests.internal.projects.TestJaxbProject;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_1.ELJaxb_2_1_PlatformDefinition;
-
-
-public class ELJaxbJavaResourceModelTestCase
- extends JavaResourceModelTestCase {
-
- public ELJaxbJavaResourceModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject.addJar(TestJaxbProject.eclipselinkJarName());
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- // nothing as of yet
- }
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_1_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_1_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java
deleted file mode 100644
index 27c4a89886..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/ELJaxbJavaResourceModelTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-
-public class ELJaxbJavaResourceModelTests
- extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(ELJaxbJavaResourceModelTests.class.getName());
- suite.addTestSuite(XmlCDATAAnnotationTests.class);
- suite.addTestSuite(XmlDiscriminatorNodeAnnotationTests.class);
- suite.addTestSuite(XmlDiscriminatorValueAnnotationTests.class);
- suite.addTestSuite(XmlInverseReferenceAnnotationTests.class);
- suite.addTestSuite(XmlJoinNodeAnnotationTests.class);
- suite.addTestSuite(XmlKeyAnnotationTests.class);
- suite.addTestSuite(XmlPathAnnotationTests.class);
- suite.addTestSuite(XmlTransformationAnnotationTests.class);
-
- return suite;
- }
-
-
- private ELJaxbJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlCDATAAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlCDATAAnnotationTests.java
deleted file mode 100644
index 04882213f2..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlCDATAAnnotationTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlCDATAAnnotation;
-
-
-public class XmlCDATAAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlCDATAAnnotationTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-
-
- private ICompilationUnit createTestXmlCDATA()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_CDATA);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlCDATA");
- }
- });
- }
-
- private XmlCDATAAnnotation getXmlCDATAAnnotation(JavaResourceAttribute resourceAttribute) {
- return (XmlCDATAAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_CDATA);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = createTestXmlCDATA();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlCDATAAnnotation annotation = getXmlCDATAAnnotation(resourceAttribute);
-
- assertTrue(annotation != null);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorNodeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorNodeAnnotationTests.java
deleted file mode 100644
index cfd2f6e26e..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorNodeAnnotationTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorNodeAnnotation;
-
-
-public class XmlDiscriminatorNodeAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlDiscriminatorNodeAnnotationTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-
-
- private ICompilationUnit createTestXmlDiscriminatorNodeWithValue()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_DISCRIMINATOR_NODE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlDiscriminatorNode(\"foo\")");
- }
- });
- }
-
-
- private XmlDiscriminatorNodeAnnotation getXmlDiscriminatorNodeAnnotation(JavaResourceType resourceType) {
- return (XmlDiscriminatorNodeAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_NODE);
- }
-
-
- public void testValue() throws Exception {
- ICompilationUnit cu = createTestXmlDiscriminatorNodeWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlDiscriminatorNodeAnnotation annotation = getXmlDiscriminatorNodeAnnotation(resourceType);
-
- assertEquals("foo", annotation.getValue());
- assertSourceContains("@XmlDiscriminatorNode(\"foo\")", cu);
-
- annotation.setValue("bar");
-
- assertEquals("bar", annotation.getValue());
- assertSourceContains("@XmlDiscriminatorNode(\"bar\")", cu);
-
- annotation.setValue("");
-
- assertEquals("", annotation.getValue());
- assertSourceContains("@XmlDiscriminatorNode(\"\")", cu);
-
- annotation.setValue(null);
-
- assertNull(annotation.getValue());
- assertSourceContains("@XmlDiscriminatorNode", cu);
- assertSourceDoesNotContain("@XmlDiscriminatorNode(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorValueAnnotationTests.java
deleted file mode 100644
index f7743fd91d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlDiscriminatorValueAnnotationTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlDiscriminatorValueAnnotation;
-
-
-public class XmlDiscriminatorValueAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlDiscriminatorValueAnnotationTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-
-
- private ICompilationUnit createTestXmlDiscriminatorValueWithValue()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@XmlDiscriminatorValue(\"foo\")");
- }
- });
- }
-
-
- private XmlDiscriminatorValueAnnotation getXmlDiscriminatorValueAnnotation(JavaResourceType resourceType) {
- return (XmlDiscriminatorValueAnnotation) resourceType.getAnnotation(ELJaxb.XML_DISCRIMINATOR_VALUE);
- }
-
-
- public void testValue() throws Exception {
- ICompilationUnit cu = createTestXmlDiscriminatorValueWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlDiscriminatorValueAnnotation annotation = getXmlDiscriminatorValueAnnotation(resourceType);
-
- assertEquals("foo", annotation.getValue());
- assertSourceContains("@XmlDiscriminatorValue(\"foo\")", cu);
-
- annotation.setValue("bar");
-
- assertEquals("bar", annotation.getValue());
- assertSourceContains("@XmlDiscriminatorValue(\"bar\")", cu);
-
- annotation.setValue("");
-
- assertEquals("", annotation.getValue());
- assertSourceContains("@XmlDiscriminatorValue(\"\")", cu);
-
- annotation.setValue(null);
-
- assertNull(annotation.getValue());
- assertSourceContains("@XmlDiscriminatorValue", cu);
- assertSourceDoesNotContain("@XmlDiscriminatorValue(", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.java
deleted file mode 100644
index 1a404f911c..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlInverseReferenceAnnotationTests.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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlInverseReferenceAnnotation;
-
-
-public class XmlInverseReferenceAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlInverseReferenceAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlInverseReference()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInverseReference");
- }
- });
- }
-
- private ICompilationUnit createTestXmlInverseReferenceWithMappedBy()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlInverseReference(mappedBy = \"foo\")");
- }
- });
- }
-
- private XmlInverseReferenceAnnotation getXmlInverseReferenceAnnotation(JavaResourceAttribute resourceAttribute) {
- return (XmlInverseReferenceAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_INVERSE_REFERENCE);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = createTestXmlInverseReference();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlInverseReferenceAnnotation annotation = getXmlInverseReferenceAnnotation(resourceAttribute);
-
- assertTrue(annotation != null);
- assertNull(annotation.getMappedBy());
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = createTestXmlInverseReferenceWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlInverseReferenceAnnotation annotation = getXmlInverseReferenceAnnotation(resourceAttribute);
-
- assertEquals("foo", annotation.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = createTestXmlInverseReference();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlInverseReferenceAnnotation annotation = getXmlInverseReferenceAnnotation(resourceAttribute);
-
- assertNull(annotation.getMappedBy());
-
- annotation.setMappedBy("bar");
-
- assertEquals("bar", annotation.getMappedBy());
- assertSourceContains("@XmlInverseReference(mappedBy = \"bar\")", cu);
-
- annotation.setMappedBy("");
-
- assertEquals("", annotation.getMappedBy());
- assertSourceContains("@XmlInverseReference(mappedBy = \"\")", cu);
-
- annotation.setMappedBy(null);
-
- assertNull(annotation.getMappedBy());
- assertSourceContains("@XmlInverseReference", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlJoinNodeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlJoinNodeAnnotationTests.java
deleted file mode 100644
index b4b815ef8d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlJoinNodeAnnotationTests.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlJoinNodeAnnotation;
-
-
-public class XmlJoinNodeAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlJoinNodeAnnotationTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-
-
- private ICompilationUnit createTestXmlJoinNode()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_JOIN_NODE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJoinNode");
- }
- });
- }
-
- private ICompilationUnit createTestXmlJoinNodeWithXmlPath()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_JOIN_NODE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJoinNode(xmlPath=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlJoinNodeWithReferencedXmlPath()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_JOIN_NODE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJoinNode(referencedXmlPath=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlJoinNodes()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_JOIN_NODES, ELJaxb.XML_JOIN_NODE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlJoinNodes({@XmlJoinNode,@XmlJoinNode})");
- }
- });
- }
-
- private XmlJoinNodeAnnotation getXmlJoinNodeAnnotation(JavaResourceAttribute resourceAttribute) {
- return getXmlJoinNodeAnnotation(resourceAttribute, 0);
- }
-
- private XmlJoinNodeAnnotation getXmlJoinNodeAnnotation(JavaResourceAttribute resourceAttribute, int index) {
- return (XmlJoinNodeAnnotation) resourceAttribute.getAnnotation(index, ELJaxb.XML_JOIN_NODE);
- }
-
-
- public void testXmlPath() throws Exception {
- ICompilationUnit cu = createTestXmlJoinNodeWithXmlPath();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlJoinNodeAnnotation annotation = getXmlJoinNodeAnnotation(resourceAttribute);
-
- assertEquals("foo", annotation.getXmlPath());
- assertSourceContains("@XmlJoinNode(xmlPath=\"foo\")", cu);
-
- annotation.setXmlPath("bar");
-
- assertEquals("bar", annotation.getXmlPath());
- assertSourceContains("@XmlJoinNode(xmlPath=\"bar\")", cu);
-
- annotation.setXmlPath("");
-
- assertEquals("", annotation.getXmlPath());
- assertSourceContains("@XmlJoinNode(xmlPath=\"\")", cu);
-
- annotation.setXmlPath(null);
-
- assertNull(annotation.getXmlPath());
- assertSourceContains("@XmlJoinNode", cu);
- assertSourceDoesNotContain("@XmlJoinNode(", cu);
- }
-
- public void testReferencedXmlPath() throws Exception {
- ICompilationUnit cu = createTestXmlJoinNodeWithReferencedXmlPath();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlJoinNodeAnnotation annotation = getXmlJoinNodeAnnotation(resourceAttribute);
-
- assertEquals("foo", annotation.getReferencedXmlPath());
- assertSourceContains("@XmlJoinNode(referencedXmlPath=\"foo\")", cu);
-
- annotation.setReferencedXmlPath("bar");
-
- assertEquals("bar", annotation.getReferencedXmlPath());
- assertSourceContains("@XmlJoinNode(referencedXmlPath=\"bar\")", cu);
-
- annotation.setReferencedXmlPath("");
-
- assertEquals("", annotation.getReferencedXmlPath());
- assertSourceContains("@XmlJoinNode(referencedXmlPath=\"\")", cu);
-
- annotation.setReferencedXmlPath(null);
-
- assertNull(annotation.getReferencedXmlPath());
- assertSourceContains("@XmlJoinNode", cu);
- assertSourceDoesNotContain("@XmlJoinNode(", cu);
- }
-
- public void testContainedXmlPath() throws Exception {
- // test contained annotation xmlPath setting/updating
-
- ICompilationUnit cu = createTestXmlJoinNodes();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlJoinNodeAnnotation annotation = getXmlJoinNodeAnnotation(resourceAttribute);
-
- assertNull(annotation.getXmlPath());
- assertSourceContains(
- "@XmlJoinNodes({@XmlJoinNode,@XmlJoinNode})", cu);
-
- annotation.setXmlPath("foo");
- assertEquals("foo", annotation.getXmlPath());
- assertSourceContains(
- "@XmlJoinNodes({@XmlJoinNode(xmlPath = \"foo\"),@XmlJoinNode})", cu);
-
- annotation.setXmlPath(null);
- assertNull(annotation.getXmlPath());
- assertSourceContains(
- "@XmlJoinNodes({@XmlJoinNode,@XmlJoinNode})", cu);
- }
-
- public void testContainedReferencedXmlPath() throws Exception {
- // test contained annotation referencedXmlPath setting/updating
-
- ICompilationUnit cu = createTestXmlJoinNodes();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlJoinNodeAnnotation annotation = getXmlJoinNodeAnnotation(resourceAttribute);
-
- assertNull(annotation.getReferencedXmlPath());
- assertSourceContains(
- "@XmlJoinNodes({@XmlJoinNode,@XmlJoinNode})", cu);
-
- annotation.setReferencedXmlPath("foo");
- assertEquals("foo", annotation.getReferencedXmlPath());
- assertSourceContains(
- "@XmlJoinNodes({@XmlJoinNode(referencedXmlPath = \"foo\"),@XmlJoinNode})", cu);
-
- annotation.setReferencedXmlPath(null);
- assertNull(annotation.getReferencedXmlPath());
- assertSourceContains(
- "@XmlJoinNodes({@XmlJoinNode,@XmlJoinNode})", cu);
- }
-
- public void testContained()
- throws Exception {
- // test adding/removing/moving
-
- ICompilationUnit cu = createTestXmlJoinNode();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- assertEquals(1, resourceAttribute.getAnnotationsSize(ELJaxb.XML_JOIN_NODE));
-
- resourceAttribute.addAnnotation(1, ELJaxb.XML_JOIN_NODE);
-
- assertEquals(2, resourceAttribute.getAnnotationsSize(ELJaxb.XML_JOIN_NODE));
- assertSourceContains("@XmlJoinNodes({ @XmlJoinNode, @XmlJoinNode })", cu);
-
- XmlJoinNodeAnnotation annotation1 = getXmlJoinNodeAnnotation(resourceAttribute, 0);
- annotation1.setXmlPath("foo");
- XmlJoinNodeAnnotation annotation2 = getXmlJoinNodeAnnotation(resourceAttribute, 1);
- annotation2.setXmlPath("bar");
- assertSourceContains(
- "@XmlJoinNodes({ @XmlJoinNode(xmlPath = \"foo\"), @XmlJoinNode(xmlPath = \"bar\") })", cu);
-
- resourceAttribute.moveAnnotation(0, 1, ELJaxb.XML_JOIN_NODE);
- assertSourceContains(
- "@XmlJoinNodes({ @XmlJoinNode(xmlPath = \"bar\"), @XmlJoinNode(xmlPath = \"foo\") })", cu);
-
- resourceAttribute.removeAnnotation(0, ELJaxb.XML_JOIN_NODE);
- assertEquals(1, resourceAttribute.getAnnotationsSize(ELJaxb.XML_JOIN_NODE));
- assertSourceContains(
- "@XmlJoinNode(xmlPath = \"foo\")", cu);
- assertSourceDoesNotContain("@XmlJoinNodes", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlKeyAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlKeyAnnotationTests.java
deleted file mode 100644
index bbd0a16f4d..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlKeyAnnotationTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlKeyAnnotation;
-
-
-public class XmlKeyAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlKeyAnnotationTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-
-
- private ICompilationUnit createTestXmlKey()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_KEY);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlKey");
- }
- });
- }
-
- private XmlKeyAnnotation getXmlKeyAnnotation(JavaResourceAttribute resourceAttribute) {
- return (XmlKeyAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_KEY);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = createTestXmlKey();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlKeyAnnotation annotation = getXmlKeyAnnotation(resourceAttribute);
-
- assertTrue(annotation != null);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlPathAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlPathAnnotationTests.java
deleted file mode 100644
index f427394ab1..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlPathAnnotationTests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlPathAnnotation;
-
-
-public class XmlPathAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlPathAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestXmlPath()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_PATH);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlPath");
- }
- });
- }
-
- private ICompilationUnit createTestXmlPathWithValue()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_PATH);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlPath(\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestXmlPaths()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_PATHS, ELJaxb.XML_PATH);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlPaths({@XmlPath,@XmlPath})");
- }
- });
- }
-
- private XmlPathAnnotation getXmlPathAnnotation(JavaResourceAttribute resourceAttribute) {
- return getXmlPathAnnotation(resourceAttribute, 0);
- }
-
- private XmlPathAnnotation getXmlPathAnnotation(JavaResourceAttribute resourceAttribute, int index) {
- return (XmlPathAnnotation) resourceAttribute.getAnnotation(index, ELJaxb.XML_PATH);
- }
-
-
- public void testValue() throws Exception {
- ICompilationUnit cu = createTestXmlPathWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlPathAnnotation annotation = getXmlPathAnnotation(resourceAttribute);
-
- assertEquals("foo", annotation.getValue());
- assertSourceContains("@XmlPath(\"foo\")", cu);
-
- annotation.setValue("bar");
-
- assertEquals("bar", annotation.getValue());
- assertSourceContains("@XmlPath(\"bar\")", cu);
-
- annotation.setValue("");
-
- assertEquals("", annotation.getValue());
- assertSourceContains("@XmlPath(\"\")", cu);
-
- annotation.setValue(null);
-
- assertNull(annotation.getValue());
- assertSourceContains("@XmlPath", cu);
- assertSourceDoesNotContain("@XmlPath(", cu);
- }
-
- public void testContainedValue() throws Exception {
- // test contained annotation value setting/updating
-
- ICompilationUnit cu = createTestXmlPaths();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlPathAnnotation annotation = getXmlPathAnnotation(resourceAttribute);
-
- assertNull(annotation.getValue());
- assertSourceContains(
- "@XmlPaths({@XmlPath,@XmlPath})", cu);
-
- annotation.setValue("foo");
- assertEquals("foo", annotation.getValue());
- assertSourceContains(
- "@XmlPaths({@XmlPath(\"foo\"),@XmlPath})", cu);
-
- annotation.setValue(null);
- assertNull(annotation.getValue());
- assertSourceContains(
- "@XmlPaths({@XmlPath,@XmlPath})", cu);
- }
-
- public void testContained()
- throws Exception {
- // test adding/removing/moving
-
- ICompilationUnit cu = createTestXmlPath();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
-
- assertEquals(1, resourceAttribute.getAnnotationsSize(ELJaxb.XML_PATH));
-
- resourceAttribute.addAnnotation(1, ELJaxb.XML_PATH);
-
- assertEquals(2, resourceAttribute.getAnnotationsSize(ELJaxb.XML_PATH));
- assertSourceContains("@XmlPaths({ @XmlPath, @XmlPath })", cu);
-
- XmlPathAnnotation annotation1 = getXmlPathAnnotation(resourceAttribute, 0);
- annotation1.setValue("foo");
- XmlPathAnnotation annotation2 = getXmlPathAnnotation(resourceAttribute, 1);
- annotation2.setValue("bar");
- assertSourceContains(
- "@XmlPaths({ @XmlPath(\"foo\"), @XmlPath(\"bar\") })", cu);
-
- resourceAttribute.moveAnnotation(0, 1, ELJaxb.XML_PATH);
- assertSourceContains(
- "@XmlPaths({ @XmlPath(\"bar\"), @XmlPath(\"foo\") })", cu);
-
- resourceAttribute.removeAnnotation(0, ELJaxb.XML_PATH);
- assertEquals(1, resourceAttribute.getAnnotationsSize(ELJaxb.XML_PATH));
- assertSourceContains(
- "@XmlPath(\"foo\")", cu);
- assertSourceDoesNotContain("@XmlPaths", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java
deleted file mode 100644
index 2fd4039364..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/resource/java/XmlTransformationAnnotationTests.java
+++ /dev/null
@@ -1,121 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jaxb.eclipselink.core.internal.v2_2.ELJaxb_2_2_PlatformDefinition;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.ELJaxb;
-import org.eclipse.jpt.jaxb.eclipselink.core.resource.java.XmlTransformationAnnotation;
-
-
-public class XmlTransformationAnnotationTests
- extends ELJaxbJavaResourceModelTestCase {
-
- public XmlTransformationAnnotationTests(String name) {
- super(name);
- }
-
-
- @Override
- protected AnnotationDefinition[] annotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getAnnotationDefinitions();
- }
-
- @Override
- protected NestableAnnotationDefinition[] nestableAnnotationDefinitions() {
- return ELJaxb_2_2_PlatformDefinition.instance().getNestableAnnotationDefinitions();
- }
-
-
- private ICompilationUnit createTestXmlTransformation()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_TRANSFORMATION);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransformation");
- }
- });
- }
-
- private ICompilationUnit createTestXmlTransformationWithOptional()
- throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(ELJaxb.XML_TRANSFORMATION);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@XmlTransformation(optional = true)");
- }
- });
- }
-
- private XmlTransformationAnnotation getXmlTransformationAnnotation(JavaResourceAttribute resourceAttribute) {
- return (XmlTransformationAnnotation) resourceAttribute.getAnnotation(ELJaxb.XML_TRANSFORMATION);
- }
-
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = createTestXmlTransformation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlTransformationAnnotation annotation = getXmlTransformationAnnotation(resourceAttribute);
-
- assertTrue(annotation != null);
- assertNull(annotation.getOptional());
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = createTestXmlTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlTransformationAnnotation annotation = getXmlTransformationAnnotation(resourceAttribute);
-
- assertEquals(Boolean.TRUE, annotation.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = createTestXmlTransformation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceAttribute = getField(resourceType, 0);
- XmlTransformationAnnotation annotation = getXmlTransformationAnnotation(resourceAttribute);
-
- assertNull(annotation.getOptional());
-
- annotation.setOptional(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, annotation.getOptional());
- assertSourceContains("@XmlTransformation(optional = false)", cu);
-
- annotation.setOptional(null);
-
- assertNull(annotation.getOptional());
- assertSourceContains("@XmlTransformation", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml
deleted file mode 100644
index 09430226e2..0000000000
--- a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/test.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.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
- -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jaxb.eclipselink.core.tests"/>
- <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1">
- <property file="${testRoot}/testServer.properties"/>
- <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
- <delete dir="${jpt-folder}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jpt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.resource.ELJaxbCoreResourceModelTests"/>
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
- </ant>
- </target>
- <target name="suite2">
- <property file="${testRoot}/testServer.properties"/>
- <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
- <delete dir="${jpt-folder}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jpt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbCoreContextModelTests"/>
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jpt.jaxb.jar=${testDir}/${jpt-javax-xml-bind-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
- </target>
-</project> \ No newline at end of file

Back to the top