Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2010-11-09 17:04:28 -0500
committerpfullbright2010-11-09 17:04:28 -0500
commitbcd13e7116d4d258be2e56c11720a80cf90c9629 (patch)
tree6a1297736b6948a469b044ca25392376d1b77898
parent18e605b92f70b9d1952aa14eb7b919b178c08e58 (diff)
downloadwebtools.dali-bcd13e7116d4d258be2e56c11720a80cf90c9629.tar.gz
webtools.dali-bcd13e7116d4d258be2e56c11720a80cf90c9629.tar.xz
webtools.dali-bcd13e7116d4d258be2e56c11720a80cf90c9629.zip
refactored to associate context package with a name, not a resource package
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java32
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbProject.java47
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPackage.java19
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRootContextNode.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbFactory.java34
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractJaxbProject.java41
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericPackage.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericRootContextNode.java82
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java7
9 files changed, 200 insertions, 150 deletions
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
index de065a1ad1..3bbafecc5f 100644
--- 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
@@ -58,8 +58,8 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
* @version 3.0
* @since 3.0
*/
-public interface JaxbFactory
-{
+public interface JaxbFactory {
+
// ********** Core Model **********
/**
@@ -74,10 +74,10 @@ public interface JaxbFactory
* and resource model.
*/
JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JpaResourceModel resourceModel);
-
-
- // ********** Context Nodes **********
-
+
+
+ // ********** Non-resource-specific context nodes **********
+
/**
* Build a (/an updated) root context node to be associated with the given
* JAXB project.
@@ -85,19 +85,19 @@ public interface JaxbFactory
* @see JaxbProject#update(org.eclipse.core.runtime.IProgressMonitor)
*/
JaxbRootContextNode buildRootContextNode(JaxbProject jaxbProject);
-
- JaxbPackage buildPackage(JaxbRootContextNode parent, JavaResourcePackage resourcePackage);
-
-
- // ********** Java Context Nodes **********
-
+
+ JaxbPackage buildPackage(JaxbRootContextNode parent, String packageName);
+
+
+ // ********** Java context nodes **********
+
JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage);
-
+
XmlSchema buildJavaXmlSchema(JaxbPackageInfo parent);
-
+
XmlSchemaType buildJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation);
-
+
XmlJavaTypeAdapter buildJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation);
-
+
XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation);
}
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
index 8278721d2d..588cc77009 100644
--- 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
@@ -136,43 +136,50 @@ public interface JaxbProject
//
// ********** Java resources **********
-
- /**
- * Return the names of the JAXB project's annotated Java classes
- */
- Iterable<String> getAnnotatedJavaSourceClassNames();
-
+
/**
- * Return the Java resource persistent type for the specified type.
- * Return null if invalid or absent.
+ * Return the Java resource packages for the project.
+ * Return null if invalid or absent. These correspond to package-info.java files
*/
- JavaResourceType getJavaResourceType(String typeName);
-
+ 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 for the project.
- * Return null if invalid or absent. These correspond to package-info.java files
- */
- Iterable<JavaResourcePackage> getJavaResourcePackages();
-
+
/**
* 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 the names of the JAXB project's annotated Java classes
+ */
+ Iterable<String> getAnnotatedJavaSourceClassNames();
+
+ /**
+ * Return the Java resource persistent type for the specified type.
+ * Return null if invalid or absent.
+ */
+ JavaResourceType getJavaResourceType(String typeName);
+
+
// ********** model synchronization **********
/**
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
index be286e8af9..6ca0469e4d 100644
--- 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
@@ -9,8 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.context;
-import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-
/**
*
* <p>
@@ -24,10 +22,17 @@ import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
* @since 3.0
*/
public interface JaxbPackage
- extends JaxbContextNode
-{
-
- JavaResourcePackage getResourcePackage();
-
+ 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$
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRootContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRootContextNode.java
index cfc1065053..7b1bc09ab8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRootContextNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbRootContextNode.java
@@ -10,7 +10,7 @@
package org.eclipse.jpt.jaxb.core.context;
/**
- * Root of the Dali context model.
+ * 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
@@ -22,20 +22,18 @@ package org.eclipse.jpt.jaxb.core.context;
* @since 3.0
*/
public interface JaxbRootContextNode
- extends JaxbContextNode
-{
-
+ extends JaxbContextNode {
+
+ /**
+ * The root context node's packages.
+ * @see #addCollectionChangeListener(String, org.eclipse.jpt.utility.model.listener.CollectionChangeListener)
+ */
Iterable<JaxbPackage> getPackages();
-
+ public final static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
+
int getPackagesSize();
-
- /**
- * String constant associated with changes to the packages property
- * @see #addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- public final static String PACKAGES_COLLECTION = "packages"; //$NON-NLS-1$
-
-
+
+
// // ********** validation **********
//
// /**
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
index 09962215c9..80b79aa4c1 100644
--- 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
@@ -41,8 +41,8 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
* various Dali interfaces.
*/
public abstract class AbstractJaxbFactory
- implements JaxbFactory
-{
+ implements JaxbFactory {
+
protected AbstractJaxbFactory() {
super();
}
@@ -53,39 +53,41 @@ public abstract class AbstractJaxbFactory
public JaxbProject buildJaxbProject(Config config) {
return new GenericJaxbProject(config);
}
-
+
public JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JpaResourceModel resourceModel) {
return new GenericJaxbFile(jaxbProject, file, contentType, resourceModel);
}
-
- // ********** Context Nodes **********
-
+
+
+ // ********** Non-resource-specific context nodes **********
+
public JaxbRootContextNode buildRootContextNode(JaxbProject parent) {
return new GenericRootContextNode(parent);
}
-
- public JaxbPackage buildPackage(JaxbRootContextNode parent, JavaResourcePackage resourcePackage) {
- return new GenericPackage(parent, resourcePackage);
+
+ public JaxbPackage buildPackage(JaxbRootContextNode parent, String packageName) {
+ return new GenericPackage(parent, packageName);
}
-
- // ********** Java Context Nodes **********
-
+
+
+ // ********** 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 XmlSchemaType buildJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation resourceXmlSchemaType) {
return new GenericJavaXmlSchemaType(parent, resourceXmlSchemaType);
}
-
+
public XmlJavaTypeAdapter buildJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation resourceXmlJavaTypeAdapter) {
return new GenericJavaXmlJavaTypeAdapter(parent, resourceXmlJavaTypeAdapter);
}
-
+
public XmlNs buildJavaXmlNs(XmlSchema parent, XmlNsAnnotation xmlNsAnnotation) {
return new GenericJavaXmlNs(parent, xmlNsAnnotation);
}
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
index 085844fad3..257d96a0eb 100644
--- 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
@@ -684,32 +684,32 @@ public abstract class AbstractJaxbProject
// ********** Java resource persistent package look-up **********
-
- public JavaResourcePackage getJavaResourcePackage(String packName) {
- for (JavaResourcePackage jrpp : this.getJavaResourcePackages()) {
- if (jrpp.getName().equals(packName)) {
- return jrpp;
- }
- }
- return null;
- }
-
+
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 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
@@ -718,7 +718,12 @@ public abstract class AbstractJaxbProject
}
};
}
-
+
+ public JavaResourcePackage getAnnotatedJavaResourcePackage(String packageName) {
+ JavaResourcePackage jrp = getJavaResourcePackage(packageName);
+ return (jrp.isAnnotated()) ? jrp : null;
+ }
+
/**
* return JPA files with package-info source "content"
*/
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
index 521397452a..fb5dbd6c5b 100644
--- 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
@@ -14,40 +14,66 @@ import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo;
import org.eclipse.jpt.jaxb.core.context.JaxbRootContextNode;
import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
-//TODO for now we will assume a 1-1 relationship between a package and a package-info.
-//Later there could be annotated types in a package that has no package-info.java
-//Or we could have a mapping file instead and this would have the PackageInfo in it.
public class GenericPackage
- extends AbstractJaxbContextNode
- implements JaxbPackage
-{
-
- protected final JaxbPackageInfo packageInfo;
-
- public GenericPackage(JaxbRootContextNode parent, JavaResourcePackage resourcePackage) {
+ extends AbstractJaxbContextNode
+ implements JaxbPackage {
+
+ protected final String name;
+
+ protected JaxbPackageInfo packageInfo;
+
+
+ public GenericPackage(JaxbRootContextNode parent, String name) {
super(parent);
- this.packageInfo = buildPackageInfo(resourcePackage);
+ this.name = name;
+ JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
+ if (jrp != null) {
+ this.packageInfo = buildPackageInfo(jrp);
+ }
}
+
public void synchronizeWithResourceModel() {
- this.packageInfo.synchronizeWithResourceModel();
+ JavaResourcePackage jrp = getJaxbProject().getAnnotatedJavaResourcePackage(this.name);
+ if (jrp == null) {
+ if (this.packageInfo != null) {
+ setPackageInfo_(null);
+ }
+ }
+ else {
+ if (this.packageInfo == null) {
+ setPackageInfo_(buildPackageInfo(jrp));
+ }
+ this.packageInfo.synchronizeWithResourceModel();
+ }
}
public void update() {
- this.packageInfo.update();
+ if (this.packageInfo != null) {
+ this.packageInfo.update();
+ }
}
-
- public JavaResourcePackage getResourcePackage() {
- return this.packageInfo.getResourcePackage();
+
+
+ // **************** name **************************************************
+
+ public String getName() {
+ return this.name;
}
-
-
- // ********** package info **********
+
+
+ // **************** package info ******************************************
public JaxbPackageInfo getPackageInfo() {
return this.packageInfo;
}
+ protected void setPackageInfo_(JaxbPackageInfo packageInfo) {
+ JaxbPackageInfo old = this.packageInfo;
+ this.packageInfo = packageInfo;
+ this.firePropertyChanged(PACKAGE_INFO_PROPERTY, old, this.packageInfo);
+ }
+
protected JaxbPackageInfo buildPackageInfo(JavaResourcePackage resourcePackage) {
return getFactory().buildJavaPackageInfo(this, resourcePackage);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericRootContextNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericRootContextNode.java
index b4418fe387..25ab8aec22 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericRootContextNode.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/GenericRootContextNode.java
@@ -9,7 +9,9 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.context;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.jpt.jaxb.core.JaxbProject;
@@ -21,16 +23,16 @@ import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
* the context model root
*/
public class GenericRootContextNode
- extends AbstractJaxbContextNode
- implements JaxbRootContextNode
-{
+ extends AbstractJaxbContextNode
+ implements JaxbRootContextNode {
+
/* This object has no parent, so it must point to the JAXB project explicitly. */
protected final JaxbProject jaxbProject;
-
+
/* Main context objects. */
protected final PackageContainer packageContainer;
-
-
+
+
public GenericRootContextNode(JaxbProject jaxbProject) {
super(null); // the JPA project is not really a "parent"...
if (jaxbProject == null) {
@@ -39,8 +41,8 @@ public class GenericRootContextNode
this.jaxbProject = jaxbProject;
this.packageContainer = new PackageContainer();
}
-
-
+
+
@Override
protected boolean requiresParent() {
return false;
@@ -49,39 +51,39 @@ public class GenericRootContextNode
public void synchronizeWithResourceModel() {
this.syncPackages();
}
-
+
public void update() {
this.updatePackages();
}
-
-
+
+
// ********** 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 this.packageContainer.getContextElements();
}
-
+
public int getPackagesSize() {
return this.packageContainer.getContextElementsSize();
}
-
+
protected JaxbPackage addPackage(JaxbPackage contextPackage, List<JaxbPackage> packages) {
this.addItemToCollection(contextPackage, packages, PACKAGES_COLLECTION);
return contextPackage;
@@ -90,47 +92,55 @@ public class GenericRootContextNode
protected void removePackage(JaxbPackage contextPackage, List<JaxbPackage> packages) {
this.removeItemFromCollection(contextPackage, packages, PACKAGES_COLLECTION);
}
-
+
protected void syncPackages() {
this.packageContainer.synchronizeWithResourceModel();
}
-
+
protected void updatePackages() {
//In this case we need to actually "sync" the list of packages since this is dependent on JaxbFiles
//and an update will be called when jaxb files are added/removed, not a synchronizeWithResourceModel
this.packageContainer.update();
}
-
- protected JaxbPackage buildPackage(JavaResourcePackage resourcePackage) {
- return this.getFactory().buildPackage(this, resourcePackage);
+
+ protected JaxbPackage buildPackage(String packageName) {
+ return this.getFactory().buildPackage(this, packageName);
}
-
- protected Iterable<JavaResourcePackage> getResourcePackages() {
- return this.getJaxbProject().getAnnotatedJavaResourcePackages();
+
+ protected Iterable<String> getPackageNames() {
+ Set<String> packageNames = new HashSet<String>();
+ for (JavaResourcePackage each : getJaxbProject().getAnnotatedJavaResourcePackages()) {
+ packageNames.add(each.getName());
+ }
+
+ return packageNames;
}
-
+
+
/**
* package container adapter
*/
protected class PackageContainer
- extends CollectionContainer<JaxbPackage, JavaResourcePackage>
- {
+ extends CollectionContainer<JaxbPackage, String> {
+
@Override
protected String getContextElementsPropertyName() {
return PACKAGES_COLLECTION;
}
+
@Override
- public JaxbPackage buildContextElement(JavaResourcePackage resourceElement) {
- return GenericRootContextNode.this.buildPackage(resourceElement);
+ public JaxbPackage buildContextElement(String packageName) {
+ return GenericRootContextNode.this.buildPackage(packageName);
}
+
@Override
- public Iterable<JavaResourcePackage> getResourceElements() {
- return GenericRootContextNode.this.getResourcePackages();
+ public Iterable<String> getResourceElements() {
+ return GenericRootContextNode.this.getPackageNames();
}
+
@Override
- public JavaResourcePackage getResourceElement(JaxbPackage contextElement) {
- return contextElement.getResourcePackage();
+ public String getResourceElement(JaxbPackage jaxbPackage) {
+ return jaxbPackage.getName();
}
}
-
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
index cc3e9c1461..ac15223fe1 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
@@ -22,14 +22,11 @@ package org.eclipse.jpt.jaxb.core.resource.java;
* will almost certainly be broken (repeatedly) as the API evolves.
*/
public interface JavaResourcePackage
- extends
- JavaResourceAnnotatedElement
-{
+ extends JavaResourceAnnotatedElement {
/**
* The Java resource persistent package's name.
*/
String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
+ String NAME_PROPERTY = "name"; //$NON-NLS-1$
}

Back to the top