Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Fullbright2012-10-02 22:35:47 +0000
committerPaul Fullbright2012-10-02 22:40:44 +0000
commit58c88a1571fc4161afc24233701a1c8bb5109e95 (patch)
tree102e980d637e0f9bea9fe6c0b638cdaf8240f803
parent8271c6cba2bf85ca9132ae619c03e2e825db7621 (diff)
downloadwebtools.dali-58c88a1571fc4161afc24233701a1c8bb5109e95.tar.gz
webtools.dali-58c88a1571fc4161afc24233701a1c8bb5109e95.tar.xz
webtools.dali-58c88a1571fc4161afc24233701a1c8bb5109e95.zip
xml bindings context modelv201210030343
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JaxbFactory.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrder.java73
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessOrderHolder.java14
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessType.java89
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAccessTypeHolder.java16
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPackageInfo.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessType.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.ecore2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.genmodel1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrder.java100
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrderHolder.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessType.java113
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessTypeHolder.java27
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmFile.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmXmlBindings.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java13
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlBindingsImpl.java107
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlAccessType.java15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlBindings.java97
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/OxmPackage.java86
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/ELJaxbCoreContextModelTests.java2
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/ELJaxbCoreOxmContextModelTests.java30
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmContextModelTestCase.java52
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmXmlBindingsTests.java317
25 files changed, 1024 insertions, 222 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 c97623657c..9ac162d6ab 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
@@ -67,12 +67,12 @@ import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
*
* @see org.eclipse.jpt.jaxb.core.internal.jaxb21.GenericJaxb_2_1_Factory
*
- * @version 3.1
+ * @version 3.3
* @since 3.0
*/
public interface JaxbFactory {
- // ********** Core Model **********
+ // ***** Core model *****
/**
* Construct a JaxbProject for the specified config, to be
@@ -88,7 +88,7 @@ public interface JaxbFactory {
JaxbFile buildJaxbFile(JaxbProject jaxbProject, IFile file, IContentType contentType, JptResourceModel resourceModel);
- // ********** Non-resource-specific context nodes **********
+ // ***** Non-resource-specific context nodes *****
/**
* Build a (/an updated) root context node to be associated with the given
@@ -101,7 +101,7 @@ public interface JaxbFactory {
JaxbPackage buildPackage(JaxbContextRoot parent, String packageName);
- // ********** Java context nodes **********
+ // ***** Java context nodes *****
JaxbPackageInfo buildJavaPackageInfo(JaxbPackage parent, JavaResourcePackage resourcePackage);
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
index 7c3a887420..f0f9e1d9ac 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * 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.
@@ -18,49 +18,52 @@ package org.eclipse.jpt.jaxb.core.context;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @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) {
+public class XmlAccessOrder {
+
+ public static XmlAccessOrder ALPHABETICAL =
+ new XmlAccessOrder(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.ALPHABETICAL);
+
+ public static XmlAccessOrder UNDEFINED =
+ new XmlAccessOrder(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED);
+
+ public static XmlAccessOrder[] VALUES =
+ new XmlAccessOrder[] {
+ ALPHABETICAL,
+ UNDEFINED };
+
+
+ public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder toJavaResourceModel(
+ XmlAccessOrder accessOrder) {
+ return (accessOrder == null) ? null : accessOrder.getJavaAccessOrder();
+ }
+
+ public static XmlAccessOrder fromJavaResourceModel(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
+
if (javaAccessOrder == null) {
- throw new NullPointerException();
+ return null;
}
- 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()) {
+
+ 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();
+
+
+ private org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder;
+
+
+ protected XmlAccessOrder(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
+ this.javaAccessOrder = javaAccessOrder;
+ }
+
+ public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder getJavaAccessOrder() {
+ return this.javaAccessOrder;
}
}
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
index 6fa5eae416..3d64ceeeb4 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * 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.
@@ -17,17 +17,17 @@ package org.eclipse.jpt.jaxb.core.context;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
-public interface XmlAccessOrderHolder
+public interface XmlAccessOrderHolder<A extends XmlAccessOrder>
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();
+ A getAccessOrder();
/**
* String constant associated with changes to the default access order
@@ -37,7 +37,7 @@ public interface XmlAccessOrderHolder
/**
* Return the default access order, never null
*/
- XmlAccessOrder getDefaultAccessOrder();
+ A getDefaultAccessOrder();
/**
* String constant associated with changes to the specified access order
@@ -47,10 +47,10 @@ public interface XmlAccessOrderHolder
/**
* Return the specified access order;
*/
- XmlAccessOrder getSpecifiedAccessOrder();
+ A getSpecifiedAccessOrder();
/**
* Set the specified access order.
*/
- void setSpecifiedAccessOrder(XmlAccessOrder newSpecifiedAccessOrder);
+ void setSpecifiedAccessOrder(A 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
index b2c8fd639a..3a60b730eb 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
+ * 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.
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.context;
+
/**
* Access Type
*
@@ -18,55 +19,61 @@ package org.eclipse.jpt.jaxb.core.context;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @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) {
+public class XmlAccessType {
+
+ public static final XmlAccessType FIELD =
+ new XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD);
+
+ public static final XmlAccessType NONE =
+ new XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE);
+
+ public static final XmlAccessType PROPERTY =
+ new XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PROPERTY);
+
+ public static final XmlAccessType PUBLIC_MEMBER =
+ new XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER);
+
+ public static XmlAccessType[] VALUES =
+ new XmlAccessType[] {
+ FIELD,
+ NONE,
+ PROPERTY,
+ PUBLIC_MEMBER };
+
+
+ public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType toJavaResourceModel(
+ XmlAccessType accessType) {
+ return (accessType != null) ? accessType.getJavaAccessType() : null;
+ }
+
+ public static XmlAccessType fromJavaResourceModel(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
+
if (javaAccessType == null) {
- throw new NullPointerException();
+ return null;
}
- 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()) {
+
+ 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();
+
+
+ protected org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType;
+
+
+ protected XmlAccessType(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
+ this.javaAccessType = javaAccessType;
+ }
+
+ public org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType getJavaAccessType() {
+ return this.javaAccessType;
}
}
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
index 6a562650ca..784a38974f 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
+ * 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.
@@ -17,17 +17,17 @@ package org.eclipse.jpt.jaxb.core.context;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.0
+ * @version 3.3
* @since 3.0
*/
-public interface XmlAccessTypeHolder
+public interface XmlAccessTypeHolder<A extends XmlAccessType>
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();
+ A getAccessType();
/**
* String constant associated with changes to the default access type
@@ -37,7 +37,7 @@ public interface XmlAccessTypeHolder
/**
* Return the default access type, never null
*/
- XmlAccessType getDefaultAccessType();
+ A getDefaultAccessType();
/**
* String constant associated with changes to the specified access type
@@ -47,10 +47,10 @@ public interface XmlAccessTypeHolder
/**
* Return the specified access type;
*/
- XmlAccessType getSpecifiedAccessType();
-
+ A getSpecifiedAccessType();
+
/**
* Set the specified access type.
*/
- void setSpecifiedAccessType(XmlAccessType newSpecifiedAccessType);
+ void setSpecifiedAccessType(A newSpecifiedAccessType);
}
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
index af98d645fe..23fdb4fd98 100644
--- 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
@@ -137,7 +137,7 @@ public class GenericJavaPackageInfo
}
protected XmlAccessType getResourceAccessType() {
- return XmlAccessType.fromJavaResourceModel(this.getAccessorTypeAnnotation().getValue());
+ return XmlAccessType.fromJavaResourceModel(getAccessorTypeAnnotation().getValue());
}
protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() {
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
index c3b3bd0967..99c17c663f 100644
--- 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
@@ -44,7 +44,7 @@ public enum XmlAccessType {
}
- // ********** static methods **********
+ // ***** to/from annotation values *****
public static XmlAccessType fromJavaAnnotationValue(Object javaAnnotationValue) {
return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
@@ -62,5 +62,4 @@ public enum XmlAccessType {
public static String toJavaAnnotationValue(XmlAccessType accessType) {
return (accessType == null) ? null : accessType.getJavaAnnotationValue();
}
-
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.ecore b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.ecore
index d59d1ce6ed..78a24531bd 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.ecore
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.ecore
@@ -120,7 +120,7 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlAccessorType" eType="#//EXmlAccessType"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlAccessorOrder" eType="#//EXmlAccessOrder"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlMappingMetadataComplete"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="packageName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlNameTransformer" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="xmlSchema" eType="#//EXmlSchema"
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.genmodel b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.genmodel
index 368849fc7b..fe7d1400ec 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.genmodel
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/model/oxm.genmodel
@@ -118,7 +118,6 @@
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference oxm.ecore#//EXmlAttribute/xmlSchemaType"/>
</genClasses>
<genClasses ecoreClass="oxm.ecore#//EXmlBindings">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute oxm.ecore#//EXmlBindings/impliedVersion"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute oxm.ecore#//EXmlBindings/xmlAccessorType"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute oxm.ecore#//EXmlBindings/xmlAccessorOrder"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute oxm.ecore#//EXmlBindings/xmlMappingMetadataComplete"/>
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrder.java
new file mode 100644
index 0000000000..00df6e46cc
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrder.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder;
+import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlAccessOrder;
+
+/**
+ * MOXy extension of 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.3
+ * @since 3.3
+ */
+public class ELJaxbXmlAccessOrder
+ extends XmlAccessOrder {
+
+ public static ELJaxbXmlAccessOrder ALPHABETICAL =
+ new ELJaxbXmlAccessOrder(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.ALPHABETICAL,
+ EXmlAccessOrder.ALPHABETICAL);
+
+ public static ELJaxbXmlAccessOrder UNDEFINED =
+ new ELJaxbXmlAccessOrder(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED,
+ EXmlAccessOrder.UNDEFINED);
+
+ public static ELJaxbXmlAccessOrder[] VALUES =
+ new ELJaxbXmlAccessOrder[] {
+ ALPHABETICAL,
+ UNDEFINED };
+
+
+ public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder toJavaResourceModel(
+ ELJaxbXmlAccessOrder accessOrder) {
+ return (accessOrder == null) ? null : accessOrder.getJavaAccessOrder();
+ }
+
+ public static ELJaxbXmlAccessOrder fromJavaResourceModel(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder) {
+
+ if (javaAccessOrder == null) {
+ return null;
+ }
+
+ for (ELJaxbXmlAccessOrder accessOrder : ELJaxbXmlAccessOrder.VALUES) {
+ if (accessOrder.getJavaAccessOrder() == javaAccessOrder) {
+ return accessOrder;
+ }
+ }
+ return null;
+ }
+
+ public static EXmlAccessOrder toOxmResourceModel(ELJaxbXmlAccessOrder accessOrder) {
+ return (accessOrder != null) ? accessOrder.getOxmAccessOrder() : null;
+ }
+
+ public static ELJaxbXmlAccessOrder fromOxmResourceModel(EXmlAccessOrder oxmAccessOrder) {
+
+ if (oxmAccessOrder == null) {
+ return null;
+ }
+
+ for (ELJaxbXmlAccessOrder accessOrder : ELJaxbXmlAccessOrder.VALUES) {
+ if (accessOrder.getOxmAccessOrder() == oxmAccessOrder) {
+ return accessOrder;
+ }
+ }
+
+ return null;
+ }
+
+
+ private EXmlAccessOrder oxmAccessOrder;
+
+
+ protected ELJaxbXmlAccessOrder(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder javaAccessOrder,
+ EXmlAccessOrder oxmAccessOrder) {
+ super(javaAccessOrder);
+ this.oxmAccessOrder = oxmAccessOrder;
+ }
+
+
+ public EXmlAccessOrder getOxmAccessOrder() {
+ return this.oxmAccessOrder;
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrderHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrderHolder.java
new file mode 100644
index 0000000000..242c4fbd4b
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessOrderHolder.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.jpt.jaxb.core.context.XmlAccessOrderHolder;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.3
+ * @since 3.3
+ */
+public interface ELJaxbXmlAccessOrderHolder
+ extends XmlAccessOrderHolder<ELJaxbXmlAccessOrder> {
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessType.java
new file mode 100644
index 0000000000..97900a70cd
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessType.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.jpt.jaxb.core.context.XmlAccessType;
+import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlAccessType;
+
+/**
+ * MOXy extension of 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.3
+ * @since 3.3
+ */
+public class ELJaxbXmlAccessType
+ extends XmlAccessType {
+
+ public static final ELJaxbXmlAccessType FIELD =
+ new ELJaxbXmlAccessType(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD,
+ EXmlAccessType.FIELD);
+
+ public static final ELJaxbXmlAccessType NONE =
+ new ELJaxbXmlAccessType(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.NONE,
+ EXmlAccessType.NONE);
+
+ public static final ELJaxbXmlAccessType PROPERTY =
+ new ELJaxbXmlAccessType(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PROPERTY,
+ EXmlAccessType.PROPERTY);
+
+ public static final ELJaxbXmlAccessType PUBLIC_MEMBER =
+ new ELJaxbXmlAccessType(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.PUBLIC_MEMBER,
+ EXmlAccessType.PUBLIC_MEMBER);
+
+ public static ELJaxbXmlAccessType[] VALUES =
+ new ELJaxbXmlAccessType[] {
+ ELJaxbXmlAccessType.FIELD,
+ ELJaxbXmlAccessType.NONE,
+ ELJaxbXmlAccessType.PROPERTY,
+ ELJaxbXmlAccessType.PUBLIC_MEMBER };
+
+
+ public static org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType toJavaResourceModel(
+ ELJaxbXmlAccessType accessType) {
+ return (accessType != null) ? accessType.getJavaAccessType() : null;
+ }
+
+ public static XmlAccessType fromJavaResourceModel(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType) {
+
+ if (javaAccessType == null) {
+ return null;
+ }
+
+ for (ELJaxbXmlAccessType accessType : ELJaxbXmlAccessType.VALUES) {
+ if (accessType.getJavaAccessType() == javaAccessType) {
+ return accessType;
+ }
+ }
+
+ return null;
+ }
+
+ public static EXmlAccessType toOxmResourceModel(ELJaxbXmlAccessType accessType) {
+ return (accessType != null) ? accessType.getOxmAccessType() : null;
+ }
+
+ public static ELJaxbXmlAccessType fromOxmResourceModel(EXmlAccessType oxmAccessType) {
+
+ if (oxmAccessType == null) {
+ return null;
+ }
+
+ for (ELJaxbXmlAccessType accessType : ELJaxbXmlAccessType.VALUES) {
+ if (accessType.getOxmAccessType() == oxmAccessType) {
+ return accessType;
+ }
+ }
+
+ return null;
+ }
+
+
+ protected EXmlAccessType oxmAccessType;
+
+
+ protected ELJaxbXmlAccessType(
+ org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType javaAccessType,
+ EXmlAccessType oxmAccessType) {
+ super(javaAccessType);
+ this.oxmAccessType = oxmAccessType;
+ }
+
+
+ public EXmlAccessType getOxmAccessType() {
+ return this.oxmAccessType;
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessTypeHolder.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessTypeHolder.java
new file mode 100644
index 0000000000..9aef8c7e44
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/ELJaxbXmlAccessTypeHolder.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.jpt.jaxb.core.context.XmlAccessTypeHolder;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.3
+ * @since 3.3
+ */
+public interface ELJaxbXmlAccessTypeHolder
+ extends XmlAccessTypeHolder<ELJaxbXmlAccessType> {
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmFile.java
index afc587b522..e024245f5e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmFile.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmFile.java
@@ -11,11 +11,23 @@ package org.eclipse.jpt.jaxb.eclipselink.core.context.oxm;
import org.eclipse.jpt.common.core.resource.xml.JptXmlResource;
import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.3
+ * @since 3.3
+ */
public interface OxmFile
extends JaxbContextNode {
- public JptXmlResource getOxmResource();
+ JptXmlResource getOxmResource();
+
+ String getPackageName();
- public String getPackageName();
+ OxmXmlBindings getXmlBindings();
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmXmlBindings.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmXmlBindings.java
index f29c2cbe35..66b09408f2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmXmlBindings.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/context/oxm/OxmXmlBindings.java
@@ -10,15 +10,36 @@
package org.eclipse.jpt.jaxb.eclipselink.core.context.oxm;
import org.eclipse.jpt.jaxb.core.context.JaxbContextNode;
-
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbXmlAccessOrderHolder;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbXmlAccessTypeHolder;
+
+/**
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.3
+ * @since 3.3
+ */
public interface OxmXmlBindings
- extends JaxbContextNode {
+ extends JaxbContextNode, ELJaxbXmlAccessTypeHolder, ELJaxbXmlAccessOrderHolder {
+
+ // ***** mapping metadata complete *****
+
+ final static String XML_MAPPING_METADATA_COMPLETE_PROPERTY = "xmlMappingMetadataComplete"; //$NON-NLS-1$
+
+ boolean isXmlMappingMetadataComplete();
+
+ void setXmlMappingMetadataComplete(boolean newValue);
+
// ***** package name *****
- public final static String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$
+ final static String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$
- public String getPackageName();
+ String getPackageName();
- public void setPackageName(String packageName);
+ void setPackageName(String packageName);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java
index 16b4467390..36d62e45d6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmFileImpl.java
@@ -1,3 +1,12 @@
+/*******************************************************************************
+ * 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.oxm;
import java.util.List;
@@ -78,6 +87,10 @@ public class OxmFileImpl
// ***** xml bindings *****
+ public OxmXmlBindings getXmlBindings() {
+ return this.xmlBindings;
+ }
+
protected OxmXmlBindings buildXmlBindings() {
// if less than 2.3, then there is no context model support
if (this.resourceType.isKindOf(Oxm.RESOURCE_TYPE_2_3)) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlBindingsImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlBindingsImpl.java
index ae95f00633..6068d799cf 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlBindingsImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/context/oxm/OxmXmlBindingsImpl.java
@@ -1,7 +1,18 @@
+/*******************************************************************************
+ * 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.oxm;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.internal.context.AbstractJaxbContextNode;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbXmlAccessOrder;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbXmlAccessType;
import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmFile;
import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmXmlBindings;
import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings;
@@ -12,13 +23,21 @@ public class OxmXmlBindingsImpl
protected EXmlBindings eXmlBindings;
- public final static String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$
+ protected ELJaxbXmlAccessType specifiedAccessType;
+
+ protected ELJaxbXmlAccessOrder specifiedAccessOrder;
+
+ protected boolean xmlMappingMetadataComplete;
+
protected String packageName;
public OxmXmlBindingsImpl(OxmFile parent, EXmlBindings eXmlBindings) {
super(parent);
this.eXmlBindings = eXmlBindings;
+ this.specifiedAccessType = buildSpecifiedAccessType();
+ this.specifiedAccessOrder = buildSpecifiedAccessOrder();
+ this.xmlMappingMetadataComplete = buildXmlMappingMetadataComplete();
this.packageName = buildPackageName();
}
@@ -28,10 +47,96 @@ public class OxmXmlBindingsImpl
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
+ setSpecifiedAccessType_(buildSpecifiedAccessType());
+ setSpecifiedAccessOrder_(buildSpecifiedAccessOrder());
+ setXmlMappingMetadataComplete_(buildXmlMappingMetadataComplete());
setPackageName_(buildPackageName());
}
+ // ***** xml access type *****
+
+ public ELJaxbXmlAccessType getAccessType() {
+ return (this.specifiedAccessType != null) ? this.specifiedAccessType : getDefaultAccessType();
+ }
+
+ public ELJaxbXmlAccessType getDefaultAccessType() {
+ return ELJaxbXmlAccessType.PUBLIC_MEMBER;
+ }
+
+ public ELJaxbXmlAccessType getSpecifiedAccessType() {
+ return this.specifiedAccessType;
+ }
+
+ public void setSpecifiedAccessType(ELJaxbXmlAccessType newAccessType) {
+ this.eXmlBindings.setXmlAccessorType(ELJaxbXmlAccessType.toOxmResourceModel(newAccessType));
+ setSpecifiedAccessType_(newAccessType);
+ }
+
+ protected void setSpecifiedAccessType_(ELJaxbXmlAccessType newAccessType) {
+ ELJaxbXmlAccessType oldAccessType = this.specifiedAccessType;
+ this.specifiedAccessType = newAccessType;
+ firePropertyChanged(SPECIFIED_ACCESS_TYPE_PROPERTY, oldAccessType, newAccessType);
+ }
+
+ protected ELJaxbXmlAccessType buildSpecifiedAccessType() {
+ return ELJaxbXmlAccessType.fromOxmResourceModel(this.eXmlBindings.getXmlAccessorType());
+ }
+
+
+ // ***** xml access order *****
+
+ public ELJaxbXmlAccessOrder getAccessOrder() {
+ return (this.specifiedAccessOrder != null) ? this.specifiedAccessOrder : getDefaultAccessOrder();
+ }
+
+ public ELJaxbXmlAccessOrder getDefaultAccessOrder() {
+ return ELJaxbXmlAccessOrder.UNDEFINED;
+ }
+
+ public ELJaxbXmlAccessOrder getSpecifiedAccessOrder() {
+ return this.specifiedAccessOrder;
+ }
+
+ public void setSpecifiedAccessOrder(ELJaxbXmlAccessOrder newAccessOrder) {
+ this.eXmlBindings.setXmlAccessorOrder(ELJaxbXmlAccessOrder.toOxmResourceModel(newAccessOrder));
+ setSpecifiedAccessOrder_(newAccessOrder);
+ }
+
+ protected void setSpecifiedAccessOrder_(ELJaxbXmlAccessOrder newAccessOrder) {
+ ELJaxbXmlAccessOrder oldAccessOrder = this.specifiedAccessOrder;
+ this.specifiedAccessOrder = newAccessOrder;
+ firePropertyChanged(SPECIFIED_ACCESS_ORDER_PROPERTY, oldAccessOrder, newAccessOrder);
+ }
+
+ protected ELJaxbXmlAccessOrder buildSpecifiedAccessOrder() {
+ return ELJaxbXmlAccessOrder.fromOxmResourceModel(this.eXmlBindings.getXmlAccessorOrder());
+ }
+
+
+ // ***** xml mapping metadata complete *****
+
+ public boolean isXmlMappingMetadataComplete() {
+ return this.xmlMappingMetadataComplete;
+ }
+
+ public void setXmlMappingMetadataComplete(boolean newValue) {
+ this.eXmlBindings.setXmlMappingMetadataComplete((newValue) ? newValue : null); // set to null if false
+ setXmlMappingMetadataComplete_(newValue);
+ }
+
+ protected void setXmlMappingMetadataComplete_(boolean newValue) {
+ boolean oldValue = this.xmlMappingMetadataComplete;
+ this.xmlMappingMetadataComplete = newValue;
+ firePropertyChanged(XML_MAPPING_METADATA_COMPLETE_PROPERTY, oldValue, newValue);
+ }
+
+ protected boolean buildXmlMappingMetadataComplete() {
+ Boolean eValue = this.eXmlBindings.getXmlMappingMetadataComplete();
+ return (eValue == null) ? false : eValue.booleanValue(); // if xml value is null or false, use false
+ }
+
+
// ***** package name *****
public String getPackageName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlAccessType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlAccessType.java
index a062ec16f9..e8c4fd645f 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlAccessType.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlAccessType.java
@@ -1,11 +1,17 @@
-/**
- */
+/*******************************************************************************
+ * 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.oxm;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-
import org.eclipse.emf.common.util.Enumerator;
/**
@@ -273,5 +279,4 @@ public enum EXmlAccessType implements Enumerator
{
return literal;
}
-
-} //EXmlAccessType
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlBindings.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlBindings.java
index 7332df9234..77bd82ac96 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlBindings.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/EXmlBindings.java
@@ -33,10 +33,9 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getImpliedVersion <em>Implied Version</em>}</li>
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlAccessorType <em>Xml Accessor Type</em>}</li>
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlAccessorOrder <em>Xml Accessor Order</em>}</li>
- * <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}</li>
+ * <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}</li>
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getPackageName <em>Package Name</em>}</li>
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlNameTransformer <em>Xml Name Transformer</em>}</li>
* <li>{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlSchema <em>Xml Schema</em>}</li>
@@ -56,28 +55,6 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
public class EXmlBindings extends ERootObjectImpl
{
/**
- * The default value of the '{@link #getImpliedVersion() <em>Implied Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getImpliedVersion()
- * @generated
- * @ordered
- */
- protected static final String IMPLIED_VERSION_EDEFAULT = null;
-
-
- /**
- * The cached value of the '{@link #getImpliedVersion() <em>Implied Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getImpliedVersion()
- * @generated
- * @ordered
- */
- protected String impliedVersion = IMPLIED_VERSION_EDEFAULT;
-
-
- /**
* The default value of the '{@link #getXmlAccessorType() <em>Xml Accessor Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -85,7 +62,7 @@ public class EXmlBindings extends ERootObjectImpl
* @generated
* @ordered
*/
- protected static final EXmlAccessType XML_ACCESSOR_TYPE_EDEFAULT = EXmlAccessType.FIELD;
+ protected static final EXmlAccessType XML_ACCESSOR_TYPE_EDEFAULT = null;
/**
@@ -107,7 +84,7 @@ public class EXmlBindings extends ERootObjectImpl
* @generated
* @ordered
*/
- protected static final EXmlAccessOrder XML_ACCESSOR_ORDER_EDEFAULT = EXmlAccessOrder.ALPHABETICAL;
+ protected static final EXmlAccessOrder XML_ACCESSOR_ORDER_EDEFAULT = null;
/**
@@ -122,25 +99,25 @@ public class EXmlBindings extends ERootObjectImpl
/**
- * The default value of the '{@link #isXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
+ * The default value of the '{@link #getXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #isXmlMappingMetadataComplete()
+ * @see #getXmlMappingMetadataComplete()
* @generated
* @ordered
*/
- protected static final boolean XML_MAPPING_METADATA_COMPLETE_EDEFAULT = false;
+ protected static final Boolean XML_MAPPING_METADATA_COMPLETE_EDEFAULT = null;
/**
- * The cached value of the '{@link #isXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
+ * The cached value of the '{@link #getXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #isXmlMappingMetadataComplete()
+ * @see #getXmlMappingMetadataComplete()
* @generated
* @ordered
*/
- protected boolean xmlMappingMetadataComplete = XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
+ protected Boolean xmlMappingMetadataComplete = XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
/**
@@ -369,27 +346,27 @@ public class EXmlBindings extends ERootObjectImpl
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Xml Mapping Metadata Complete</em>' attribute.
- * @see #setXmlMappingMetadataComplete(boolean)
+ * @see #setXmlMappingMetadataComplete(Boolean)
* @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.OxmPackage#getEXmlBindings_XmlMappingMetadataComplete()
- * @model
+ * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
* @generated
*/
- public boolean isXmlMappingMetadataComplete()
+ public Boolean getXmlMappingMetadataComplete()
{
return xmlMappingMetadataComplete;
}
/**
- * Sets the value of the '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}' attribute.
+ * Sets the value of the '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Xml Mapping Metadata Complete</em>' attribute.
- * @see #isXmlMappingMetadataComplete()
+ * @see #getXmlMappingMetadataComplete()
* @generated
*/
- public void setXmlMappingMetadataComplete(boolean newXmlMappingMetadataComplete)
+ public void setXmlMappingMetadataComplete(Boolean newXmlMappingMetadataComplete)
{
- boolean oldXmlMappingMetadataComplete = xmlMappingMetadataComplete;
+ Boolean oldXmlMappingMetadataComplete = xmlMappingMetadataComplete;
xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OxmPackage.EXML_BINDINGS__XML_MAPPING_METADATA_COMPLETE, oldXmlMappingMetadataComplete, xmlMappingMetadataComplete));
@@ -738,14 +715,12 @@ public class EXmlBindings extends ERootObjectImpl
{
switch (featureID)
{
- case OxmPackage.EXML_BINDINGS__IMPLIED_VERSION:
- return getImpliedVersion();
case OxmPackage.EXML_BINDINGS__XML_ACCESSOR_TYPE:
return getXmlAccessorType();
case OxmPackage.EXML_BINDINGS__XML_ACCESSOR_ORDER:
return getXmlAccessorOrder();
case OxmPackage.EXML_BINDINGS__XML_MAPPING_METADATA_COMPLETE:
- return isXmlMappingMetadataComplete();
+ return getXmlMappingMetadataComplete();
case OxmPackage.EXML_BINDINGS__PACKAGE_NAME:
return getPackageName();
case OxmPackage.EXML_BINDINGS__XML_NAME_TRANSFORMER:
@@ -779,9 +754,6 @@ public class EXmlBindings extends ERootObjectImpl
{
switch (featureID)
{
- case OxmPackage.EXML_BINDINGS__IMPLIED_VERSION:
- setImpliedVersion((String)newValue);
- return;
case OxmPackage.EXML_BINDINGS__XML_ACCESSOR_TYPE:
setXmlAccessorType((EXmlAccessType)newValue);
return;
@@ -837,9 +809,6 @@ public class EXmlBindings extends ERootObjectImpl
{
switch (featureID)
{
- case OxmPackage.EXML_BINDINGS__IMPLIED_VERSION:
- setImpliedVersion(IMPLIED_VERSION_EDEFAULT);
- return;
case OxmPackage.EXML_BINDINGS__XML_ACCESSOR_TYPE:
setXmlAccessorType(XML_ACCESSOR_TYPE_EDEFAULT);
return;
@@ -890,14 +859,12 @@ public class EXmlBindings extends ERootObjectImpl
{
switch (featureID)
{
- case OxmPackage.EXML_BINDINGS__IMPLIED_VERSION:
- return IMPLIED_VERSION_EDEFAULT == null ? impliedVersion != null : !IMPLIED_VERSION_EDEFAULT.equals(impliedVersion);
case OxmPackage.EXML_BINDINGS__XML_ACCESSOR_TYPE:
return xmlAccessorType != XML_ACCESSOR_TYPE_EDEFAULT;
case OxmPackage.EXML_BINDINGS__XML_ACCESSOR_ORDER:
return xmlAccessorOrder != XML_ACCESSOR_ORDER_EDEFAULT;
case OxmPackage.EXML_BINDINGS__XML_MAPPING_METADATA_COMPLETE:
- return xmlMappingMetadataComplete != XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
+ return XML_MAPPING_METADATA_COMPLETE_EDEFAULT == null ? xmlMappingMetadataComplete != null : !XML_MAPPING_METADATA_COMPLETE_EDEFAULT.equals(xmlMappingMetadataComplete);
case OxmPackage.EXML_BINDINGS__PACKAGE_NAME:
return PACKAGE_NAME_EDEFAULT == null ? packageName != null : !PACKAGE_NAME_EDEFAULT.equals(packageName);
case OxmPackage.EXML_BINDINGS__XML_NAME_TRANSFORMER:
@@ -932,9 +899,7 @@ public class EXmlBindings extends ERootObjectImpl
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (impliedVersion: ");
- result.append(impliedVersion);
- result.append(", xmlAccessorType: ");
+ result.append(" (xmlAccessorType: ");
result.append(xmlAccessorType);
result.append(", xmlAccessorOrder: ");
result.append(xmlAccessorOrder);
@@ -999,11 +964,35 @@ public class EXmlBindings extends ERootObjectImpl
buildNamespaceTranslator(Oxm.SCHEMA_NAMESPACE),
buildSchemaNamespaceTranslator(),
buildSchemaLocationTranslator(Oxm.SCHEMA_NAMESPACE, SCHEMA_LOCATIONS),
+ buildXmlAccessorTypeTranslator(),
+ buildXmlAccessorOrderTranslator(),
+ buildXmlMappingMetadataCompleteTranslator(),
buildPackageNameTranslator(),
EJavaType.buildTranslator()
};
}
+ protected static Translator buildXmlAccessorTypeTranslator() {
+ return new Translator(
+ Oxm.XML_ACCESSOR_TYPE,
+ OxmPackage.eINSTANCE.getEXmlBindings_XmlAccessorType(),
+ Translator.DOM_ATTRIBUTE);
+ }
+
+ protected static Translator buildXmlAccessorOrderTranslator() {
+ return new Translator(
+ Oxm.XML_ACCESSOR_ORDER,
+ OxmPackage.eINSTANCE.getEXmlBindings_XmlAccessorOrder(),
+ Translator.DOM_ATTRIBUTE);
+ }
+
+ protected static Translator buildXmlMappingMetadataCompleteTranslator() {
+ return new Translator(
+ Oxm.XML_MAPPING_METADATA_COMPLETE,
+ OxmPackage.eINSTANCE.getEXmlBindings_XmlMappingMetadataComplete(),
+ Translator.DOM_ATTRIBUTE);
+ }
+
protected static Translator buildPackageNameTranslator() {
return new Translator(
Oxm.PACKAGE_NAME,
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java
index f5f73c48b5..9da40e2da3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/Oxm.java
@@ -46,6 +46,8 @@ public interface Oxm {
String JAVA_TYPE = "java-type"; //$NON-NLS-1$
String JAVA_TYPES = "java-types"; //$NON-NLS-1$
String PACKAGE_NAME = "package-name"; //$NON-NLS-1$
+ String XML_ACCESSOR_ORDER = "xml-accessor-order"; //$NON-NLS-1$
+ String XML_ACCESSOR_TYPE = "xml-accessor-type"; //$NON-NLS-1$
String XML_ANY_ATTRIBUTE = "xml-any-attribute"; //$NON-NLS-1$
String XML_ANY_ELEMENT = "xml-any-element"; //$NON-NLS-1$
String XML_ATTRIBUTE = "xml-attribute"; //$NON-NLS-1$
@@ -58,6 +60,7 @@ public interface Oxm {
String XML_IS_SET_NULL_POLICY = "xml-is-set-null-policy"; //$NON-NLS-1$
String XML_JAVA_TYPE_ADAPTER = "xml-java-type-adapter"; //$NON-NLS-1$
String XML_JOIN_NODES = "xml-join-nodes"; //$NON-NLS-1$
+ String XML_MAPPING_METADATA_COMPLETE = "xml-mapping-metadata-complete"; //$NON-NLS-1$
String XML_NULL_POLICY = "xml-null-policy"; //$NON-NLS-1$
String XML_TRANSFORMATION = "xml-transformation"; //$NON-NLS-1$
String XML_TRANSIENT = "xml-transient"; //$NON-NLS-1$
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/OxmPackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/OxmPackage.java
index 314a28629e..c3f90a0131 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/OxmPackage.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/oxm/OxmPackage.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EValidator;
import org.eclipse.emf.ecore.impl.EPackageImpl;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
import org.eclipse.jpt.common.core.resource.xml.CommonPackage;
import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.util.OxmValidator;
@@ -1064,7 +1065,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__IMPLIED_VERSION = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 0;
+ public static final int EXML_BINDINGS__IMPLIED_VERSION = CommonPackage.EROOT_OBJECT_IMPL__IMPLIED_VERSION;
/**
* The feature id for the '<em><b>Xml Accessor Type</b></em>' attribute.
@@ -1073,7 +1074,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_ACCESSOR_TYPE = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 1;
+ public static final int EXML_BINDINGS__XML_ACCESSOR_TYPE = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Xml Accessor Order</b></em>' attribute.
@@ -1082,7 +1083,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_ACCESSOR_ORDER = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 2;
+ public static final int EXML_BINDINGS__XML_ACCESSOR_ORDER = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
@@ -1091,7 +1092,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_MAPPING_METADATA_COMPLETE = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 3;
+ public static final int EXML_BINDINGS__XML_MAPPING_METADATA_COMPLETE = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Package Name</b></em>' attribute.
@@ -1100,7 +1101,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__PACKAGE_NAME = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 4;
+ public static final int EXML_BINDINGS__PACKAGE_NAME = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>Xml Name Transformer</b></em>' attribute.
@@ -1109,7 +1110,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_NAME_TRANSFORMER = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 5;
+ public static final int EXML_BINDINGS__XML_NAME_TRANSFORMER = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 4;
/**
* The feature id for the '<em><b>Xml Schema</b></em>' containment reference.
@@ -1118,7 +1119,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_SCHEMA = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 6;
+ public static final int EXML_BINDINGS__XML_SCHEMA = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 5;
/**
* The feature id for the '<em><b>Xml Schema Type</b></em>' containment reference.
@@ -1127,7 +1128,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_SCHEMA_TYPE = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 7;
+ public static final int EXML_BINDINGS__XML_SCHEMA_TYPE = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 6;
/**
* The feature id for the '<em><b>Xml Schema Types</b></em>' containment reference list.
@@ -1136,7 +1137,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_SCHEMA_TYPES = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 8;
+ public static final int EXML_BINDINGS__XML_SCHEMA_TYPES = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 7;
/**
* The feature id for the '<em><b>Xml Java Type Adapters</b></em>' containment reference list.
@@ -1145,7 +1146,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_JAVA_TYPE_ADAPTERS = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 9;
+ public static final int EXML_BINDINGS__XML_JAVA_TYPE_ADAPTERS = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 8;
/**
* The feature id for the '<em><b>Xml Registries</b></em>' containment reference list.
@@ -1154,7 +1155,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_REGISTRIES = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 10;
+ public static final int EXML_BINDINGS__XML_REGISTRIES = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 9;
/**
* The feature id for the '<em><b>Xml Enums</b></em>' containment reference list.
@@ -1163,7 +1164,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__XML_ENUMS = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 11;
+ public static final int EXML_BINDINGS__XML_ENUMS = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 10;
/**
* The feature id for the '<em><b>Java Types</b></em>' containment reference list.
@@ -1172,7 +1173,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS__JAVA_TYPES = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 12;
+ public static final int EXML_BINDINGS__JAVA_TYPES = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 11;
/**
* The number of structural features of the '<em>EXml Bindings</em>' class.
@@ -1181,7 +1182,7 @@ public class OxmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int EXML_BINDINGS_FEATURE_COUNT = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 13;
+ public static final int EXML_BINDINGS_FEATURE_COUNT = CommonPackage.EROOT_OBJECT_IMPL_FEATURE_COUNT + 12;
/**
* The meta object id for the '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlClassExtractor <em>EXml Class Extractor</em>}' class.
@@ -3695,6 +3696,7 @@ public class OxmPackage extends EPackageImpl
// Initialize simple dependencies
CommonPackage.eINSTANCE.eClass();
+ XMLTypePackage.eINSTANCE.eClass();
// Create package meta-data objects
theOxmPackage.createPackageContents();
@@ -4706,21 +4708,6 @@ public class OxmPackage extends EPackageImpl
}
/**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getImpliedVersion <em>Implied Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Implied Version</em>'.
- * @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getImpliedVersion()
- * @see #getEXmlBindings()
- * @generated
- */
- public EAttribute getEXmlBindings_ImpliedVersion()
- {
- return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
* Returns the meta object for the attribute '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlAccessorType <em>Xml Accessor Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4731,7 +4718,7 @@ public class OxmPackage extends EPackageImpl
*/
public EAttribute getEXmlBindings_XmlAccessorType()
{
- return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(1);
+ return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(0);
}
@@ -4746,22 +4733,22 @@ public class OxmPackage extends EPackageImpl
*/
public EAttribute getEXmlBindings_XmlAccessorOrder()
{
- return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(2);
+ return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(1);
}
/**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}'.
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Xml Mapping Metadata Complete</em>'.
- * @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#isXmlMappingMetadataComplete()
+ * @see org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings#getXmlMappingMetadataComplete()
* @see #getEXmlBindings()
* @generated
*/
public EAttribute getEXmlBindings_XmlMappingMetadataComplete()
{
- return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(3);
+ return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(2);
}
@@ -4776,7 +4763,7 @@ public class OxmPackage extends EPackageImpl
*/
public EAttribute getEXmlBindings_PackageName()
{
- return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(4);
+ return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(3);
}
@@ -4791,7 +4778,7 @@ public class OxmPackage extends EPackageImpl
*/
public EAttribute getEXmlBindings_XmlNameTransformer()
{
- return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(5);
+ return (EAttribute)eXmlBindingsEClass.getEStructuralFeatures().get(4);
}
@@ -4806,7 +4793,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_XmlSchema()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(6);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(5);
}
@@ -4821,7 +4808,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_XmlSchemaType()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(7);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(6);
}
@@ -4836,7 +4823,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_XmlSchemaTypes()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(8);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(7);
}
@@ -4851,7 +4838,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_XmlJavaTypeAdapters()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(9);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(8);
}
@@ -4866,7 +4853,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_XmlRegistries()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(10);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(9);
}
@@ -4881,7 +4868,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_XmlEnums()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(11);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(10);
}
@@ -4896,7 +4883,7 @@ public class OxmPackage extends EPackageImpl
*/
public EReference getEXmlBindings_JavaTypes()
{
- return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(12);
+ return (EReference)eXmlBindingsEClass.getEStructuralFeatures().get(11);
}
/**
@@ -6932,7 +6919,6 @@ public class OxmPackage extends EPackageImpl
createEReference(eXmlAttributeEClass, EXML_ATTRIBUTE__XML_SCHEMA_TYPE);
eXmlBindingsEClass = createEClass(EXML_BINDINGS);
- createEAttribute(eXmlBindingsEClass, EXML_BINDINGS__IMPLIED_VERSION);
createEAttribute(eXmlBindingsEClass, EXML_BINDINGS__XML_ACCESSOR_TYPE);
createEAttribute(eXmlBindingsEClass, EXML_BINDINGS__XML_ACCESSOR_ORDER);
createEAttribute(eXmlBindingsEClass, EXML_BINDINGS__XML_MAPPING_METADATA_COMPLETE);
@@ -7138,6 +7124,7 @@ public class OxmPackage extends EPackageImpl
// Obtain other dependent packages
CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
+ XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
// Create type parameters
@@ -7294,10 +7281,9 @@ public class OxmPackage extends EPackageImpl
initEReference(getEXmlAttribute_XmlSchemaType(), this.getEXmlSchemaType(), null, "xmlSchemaType", null, 0, 1, EXmlAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(eXmlBindingsEClass, EXmlBindings.class, "EXmlBindings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEXmlBindings_ImpliedVersion(), ecorePackage.getEString(), "impliedVersion", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getEXmlBindings_XmlAccessorType(), this.getEXmlAccessType(), "xmlAccessorType", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getEXmlBindings_XmlAccessorOrder(), this.getEXmlAccessOrder(), "xmlAccessorOrder", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getEXmlBindings_XmlMappingMetadataComplete(), ecorePackage.getEBoolean(), "xmlMappingMetadataComplete", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getEXmlBindings_XmlMappingMetadataComplete(), theXMLTypePackage.getBooleanObject(), "xmlMappingMetadataComplete", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getEXmlBindings_PackageName(), ecorePackage.getEString(), "packageName", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getEXmlBindings_XmlNameTransformer(), ecorePackage.getEString(), "xmlNameTransformer", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getEXmlBindings_XmlSchema(), this.getEXmlSchema(), null, "xmlSchema", null, 0, 1, EXmlBindings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -8105,14 +8091,6 @@ public class OxmPackage extends EPackageImpl
public static final EClass EXML_BINDINGS = eINSTANCE.getEXmlBindings();
/**
- * The meta object literal for the '<em><b>Implied Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute EXML_BINDINGS__IMPLIED_VERSION = eINSTANCE.getEXmlBindings_ImpliedVersion();
-
- /**
* The meta object literal for the '<em><b>Xml Accessor Type</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
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
index a0117e9ba6..f36e067f4a 100644
--- 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
@@ -13,6 +13,7 @@ import junit.framework.Test;
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;
+import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.oxm.ELJaxbCoreOxmContextModelTests;
public class ELJaxbCoreContextModelTests {
@@ -23,6 +24,7 @@ public class ELJaxbCoreContextModelTests {
if (ELJaxbCoreTests.requiredJarsExists()) {
suite.addTestSuite(ELJaxbContextRootTests.class);
suite.addTest(ELJaxbCoreJavaContextModelTests.suite());
+ suite.addTest(ELJaxbCoreOxmContextModelTests.suite());
}
else {
suite.addTest(TestSuite.warning(ELJaxbCoreTests.buildMissingJarErrorMessage()));
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/ELJaxbCoreOxmContextModelTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/ELJaxbCoreOxmContextModelTests.java
new file mode 100644
index 0000000000..47f2d4d838
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/ELJaxbCoreOxmContextModelTests.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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.oxm;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class ELJaxbCoreOxmContextModelTests
+ extends TestCase {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(ELJaxbCoreOxmContextModelTests.class.getName());
+ suite.addTestSuite(OxmXmlBindingsTests.class);
+ return suite;
+ }
+
+
+ private ELJaxbCoreOxmContextModelTests() {
+ 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/oxm/OxmContextModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmContextModelTestCase.java
new file mode 100644
index 0000000000..f9cd25514a
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmContextModelTestCase.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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.oxm;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jpt.jaxb.eclipselink.core.tests.internal.context.ELJaxbContextModelTestCase;
+
+public class OxmContextModelTestCase
+ extends ELJaxbContextModelTestCase {
+
+ protected OxmContextModelTestCase(String name) {
+ super(name);
+ }
+
+
+ protected void addOxmFile(String fileName, StringBuffer contents) throws Exception {
+ IFile oxmFile = getJavaProject().getProject().getFolder("src").getFile(fileName);
+ oxmFile.create(new ByteArrayInputStream(contents.toString().getBytes()), true, null);
+ }
+
+ protected void assertFileContentsContains(String fileName, String stringToTest, boolean doesContain) throws Exception {
+ StringBuilder sb = new StringBuilder();
+ IFile oxmFile = getJavaProject().getProject().getFolder("src").getFile(fileName);
+ InputStream is = oxmFile.getContents();
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+
+ String line;
+ while ((line = br.readLine()) != null) {
+ sb.append(line);
+ }
+
+ is.close();
+
+ if (doesContain) {
+ assertTrue(new String(sb).contains(stringToTest));
+ }
+ else {
+ assertFalse(new String(sb).contains(stringToTest));
+ }
+ }
+}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmXmlBindingsTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmXmlBindingsTests.java
new file mode 100644
index 0000000000..8af195283e
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.eclipselink.core.tests/src/org/eclipse/jpt/jaxb/eclipselink/core/tests/internal/context/oxm/OxmXmlBindingsTests.java
@@ -0,0 +1,317 @@
+/*******************************************************************************
+ * 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.oxm;
+
+import org.eclipse.jpt.common.core.resource.xml.JptXmlResource;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbContextRoot;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbXmlAccessOrder;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.ELJaxbXmlAccessType;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmFile;
+import org.eclipse.jpt.jaxb.eclipselink.core.context.oxm.OxmXmlBindings;
+import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlAccessOrder;
+import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlAccessType;
+import org.eclipse.jpt.jaxb.eclipselink.core.resource.oxm.EXmlBindings;
+
+public class OxmXmlBindingsTests
+ extends OxmContextModelTestCase {
+
+ public OxmXmlBindingsTests(String name) {
+ super(name);
+ }
+
+
+ protected void addOxmFile(String fileName, String packageName) throws Exception {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>").append(CR);
+ sb.append("<xml-bindings").append(CR);
+ sb.append(" version=\"2.4\"").append(CR);
+ sb.append(" xmlns=\"http://www.eclipse.org/eclipselink/xsds/persistence/oxm\"").append(CR);
+ sb.append(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"").append(CR);
+ sb.append(" xsi:schemaLocation=\"http://www.eclipse.org/eclipselink/xsds/persistence/oxm http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_4.xsd\"").append(CR);
+ sb.append(" package-name=\"").append(packageName).append("\"").append(CR);
+ sb.append(" xml-accessor-type=\"PUBLIC_MEMBER\"").append(CR);
+ sb.append(" />").append(CR);
+ addOxmFile(fileName, sb);
+ }
+
+ public void testUpdateAccessType() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ // the value is not exactly specified, but since the attribute has a default value, it's "specified"
+ assertEquals(EXmlAccessType.PUBLIC_MEMBER, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.PUBLIC_MEMBER, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.PUBLIC_MEMBER, xmlBindings.getAccessType());
+
+ eXmlBindings.setXmlAccessorType(EXmlAccessType.FIELD);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=\"FIELD\"", true);
+ assertEquals(EXmlAccessType.FIELD, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.FIELD, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.FIELD, xmlBindings.getAccessType());
+
+ eXmlBindings.setXmlAccessorType(EXmlAccessType.NONE);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=\"NONE\"", true);
+ assertEquals(EXmlAccessType.NONE, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.NONE, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.NONE, xmlBindings.getAccessType());
+
+ eXmlBindings.setXmlAccessorType(EXmlAccessType.PROPERTY);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=\"PROPERTY\"", true);
+ assertEquals(EXmlAccessType.PROPERTY, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.PROPERTY, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.PROPERTY, xmlBindings.getAccessType());
+
+ eXmlBindings.setXmlAccessorType(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=", false);
+ assertNull(eXmlBindings.getXmlAccessorType());
+ assertNull(xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.PUBLIC_MEMBER, xmlBindings.getAccessType());
+ }
+
+ public void testModifyAccessType() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ // the value is not exactly specified, but since the attribute has a default value, it's "specified"
+ assertEquals(EXmlAccessType.PUBLIC_MEMBER, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.PUBLIC_MEMBER, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.PUBLIC_MEMBER, xmlBindings.getAccessType());
+
+ xmlBindings.setSpecifiedAccessType(ELJaxbXmlAccessType.FIELD);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=\"FIELD\"", true);
+ assertEquals(EXmlAccessType.FIELD, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.FIELD, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.FIELD, xmlBindings.getAccessType());
+
+ xmlBindings.setSpecifiedAccessType(ELJaxbXmlAccessType.NONE);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=\"NONE\"", true);
+ assertEquals(EXmlAccessType.NONE, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.NONE, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.NONE, xmlBindings.getAccessType());
+
+ xmlBindings.setSpecifiedAccessType(ELJaxbXmlAccessType.PROPERTY);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=\"PROPERTY\"", true);
+ assertEquals(EXmlAccessType.PROPERTY, eXmlBindings.getXmlAccessorType());
+ assertEquals(ELJaxbXmlAccessType.PROPERTY, xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.PROPERTY, xmlBindings.getAccessType());
+
+ xmlBindings.setSpecifiedAccessType(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-type=", false);
+ assertNull(eXmlBindings.getXmlAccessorType());
+ assertNull(xmlBindings.getSpecifiedAccessType());
+ assertEquals(ELJaxbXmlAccessType.PUBLIC_MEMBER, xmlBindings.getAccessType());
+ }
+
+ public void testUpdateAccessOrder() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ // the value is not exactly specified, but since the attribute has a default value, it's "specified"
+ assertEquals(EXmlAccessOrder.UNDEFINED, eXmlBindings.getXmlAccessorOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getAccessOrder());
+
+ eXmlBindings.setXmlAccessorOrder(EXmlAccessOrder.ALPHABETICAL);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-order=\"ALPHABETICAL\"", true);
+ assertEquals(EXmlAccessOrder.ALPHABETICAL, eXmlBindings.getXmlAccessorOrder());
+ assertEquals(ELJaxbXmlAccessOrder.ALPHABETICAL, xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.ALPHABETICAL, xmlBindings.getAccessOrder());
+
+ eXmlBindings.setXmlAccessorOrder(EXmlAccessOrder.UNDEFINED);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-order=\"UNDEFINED\"", true);
+ assertEquals(EXmlAccessOrder.UNDEFINED, eXmlBindings.getXmlAccessorOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getAccessOrder());
+
+ eXmlBindings.setXmlAccessorOrder(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-order=", false);
+ assertNull(eXmlBindings.getXmlAccessorOrder());
+ assertNull(xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getAccessOrder());
+ }
+
+ public void testModifyAccessOrder() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ // the value is not exactly specified, but since the attribute has a default value, it's "specified"
+ assertEquals(EXmlAccessOrder.UNDEFINED, eXmlBindings.getXmlAccessorOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getAccessOrder());
+
+ xmlBindings.setSpecifiedAccessOrder(ELJaxbXmlAccessOrder.ALPHABETICAL);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-order=\"ALPHABETICAL\"", true);
+ assertEquals(EXmlAccessOrder.ALPHABETICAL, eXmlBindings.getXmlAccessorOrder());
+ assertEquals(ELJaxbXmlAccessOrder.ALPHABETICAL, xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.ALPHABETICAL, xmlBindings.getAccessOrder());
+
+ xmlBindings.setSpecifiedAccessOrder(ELJaxbXmlAccessOrder.UNDEFINED);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-order=\"UNDEFINED\"", true);
+ assertEquals(EXmlAccessOrder.UNDEFINED, eXmlBindings.getXmlAccessorOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getAccessOrder());
+
+ xmlBindings.setSpecifiedAccessOrder(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-accessor-order=", false);
+ assertNull(eXmlBindings.getXmlAccessorOrder());
+ assertNull(xmlBindings.getSpecifiedAccessOrder());
+ assertEquals(ELJaxbXmlAccessOrder.UNDEFINED, xmlBindings.getAccessOrder());
+ }
+
+ public void testUpdateXmlMappingMetadataComplete() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ // the value is not exactly specified, but since the attribute has a default value, it's "specified"
+ assertEquals(Boolean.FALSE, eXmlBindings.getXmlMappingMetadataComplete());
+ assertFalse(xmlBindings.isXmlMappingMetadataComplete());
+
+ eXmlBindings.setXmlMappingMetadataComplete(Boolean.TRUE);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-mapping-metadata-complete=\"true\"", true);
+ assertEquals(Boolean.TRUE, eXmlBindings.getXmlMappingMetadataComplete());
+ assertTrue(xmlBindings.isXmlMappingMetadataComplete());
+
+ eXmlBindings.setXmlMappingMetadataComplete(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-mapping-metadata-complete=", false);
+ assertNull(eXmlBindings.getXmlMappingMetadataComplete());
+ assertFalse(xmlBindings.isXmlMappingMetadataComplete());
+ }
+
+ public void testModifyXmlMappingMetadataComplete() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ // the value is not exactly specified, but since the attribute has a default value, it's "specified"
+ assertEquals(Boolean.FALSE, eXmlBindings.getXmlMappingMetadataComplete());
+ assertFalse(xmlBindings.isXmlMappingMetadataComplete());
+
+ xmlBindings.setXmlMappingMetadataComplete(true);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-mapping-metadata-complete=\"true\"", true);
+ assertEquals(Boolean.TRUE, eXmlBindings.getXmlMappingMetadataComplete());
+ assertTrue(xmlBindings.isXmlMappingMetadataComplete());
+
+ xmlBindings.setXmlMappingMetadataComplete(false);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "xml-mapping-metadata-complete=", false);
+ assertNull(eXmlBindings.getXmlMappingMetadataComplete());
+ assertFalse(xmlBindings.isXmlMappingMetadataComplete());
+ }
+
+ public void testUpdatePackageName() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ assertEquals("test.oxm", eXmlBindings.getPackageName());
+ assertEquals("test.oxm", xmlBindings.getPackageName());
+
+ eXmlBindings.setPackageName("foo");
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "package-name=\"foo\"", true);
+ assertEquals("foo", eXmlBindings.getPackageName());
+ assertEquals("foo", xmlBindings.getPackageName());
+
+ eXmlBindings.setPackageName(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "package-name=", false);
+ assertNull(eXmlBindings.getPackageName());
+ assertNull(xmlBindings.getPackageName());
+ }
+
+ public void testModifyPackageName() throws Exception {
+ addOxmFile("oxm.xml", "test.oxm");
+ ELJaxbContextRoot root = (ELJaxbContextRoot) getJaxbProject().getContextRoot();
+ OxmFile oxmFile = root.getOxmFile("test.oxm");
+ OxmXmlBindings xmlBindings = oxmFile.getXmlBindings();
+ JptXmlResource oxmResource = oxmFile.getOxmResource();
+ EXmlBindings eXmlBindings = (EXmlBindings) oxmResource.getRootObject();
+
+ assertEquals("test.oxm", eXmlBindings.getPackageName());
+ assertEquals("test.oxm", xmlBindings.getPackageName());
+
+ xmlBindings.setPackageName("foo");
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "package-name=\"foo\"", true);
+ assertEquals("foo", eXmlBindings.getPackageName());
+ assertEquals("foo", xmlBindings.getPackageName());
+
+ xmlBindings.setPackageName(null);
+ oxmResource.save();
+
+ assertFileContentsContains("oxm.xml", "package-name=", false);
+ assertNull(eXmlBindings.getPackageName());
+ assertNull(xmlBindings.getPackageName());
+ }
+}

Back to the top