Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-12-17 13:56:15 -0500
committerkmoore2010-12-17 13:56:15 -0500
commit509a5c41f5e71239e0ef823a104ef7d78e7557b7 (patch)
tree80acc2426f996e931be2966307348dfa5c0d327b
parent3e675de3beabdd57832d249ff93cbbdc503a69f8 (diff)
downloadwebtools.dali-509a5c41f5e71239e0ef823a104ef7d78e7557b7.tar.gz
webtools.dali-509a5c41f5e71239e0ef823a104ef7d78e7557b7.tar.xz
webtools.dali-509a5c41f5e71239e0ef823a104ef7d78e7557b7.zip
removed some of the getDefault*() methods from our jaxb interfaces. I don't think they are needed if the default never changes
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java18
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java15
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java87
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java24
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java2
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java14
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlJavaTypeAdapter.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java84
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java56
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentEnumTests.java24
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlJavaTypeAdapterTests.java20
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java96
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java40
15 files changed, 154 insertions, 366 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
index 3aa677ea2c..c662f829cb 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbElementFactoryMethod.java
@@ -29,6 +29,9 @@ public interface JaxbElementFactoryMethod
JavaResourceMethod getResourceMethod();
+ /**
+ * Return the method name
+ */
String getName();
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
index 4e4aafb5d4..71d8238701 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbEnumConstant.java
@@ -29,10 +29,28 @@ public interface JaxbEnumConstant
JavaResourceEnumConstant getResourceEnumConstant();
+ /**
+ * Return the name of the enum constant. This will not change, a
+ * new JaxbEnumConstant will be built if the name changes.
+ */
String getName();
+
+ /**
+ * Return the enum constant's value, whether specified or default.
+ */
String getValue();
+
+ /**
+ * The default value will be the name of the enum constant.
+ * It will be used if the XmlEnumValue annotation is null.
+ * @see getName()
+ */
String getDefaultValue();
+
+ /**
+ * Corresponds to the XmlEnumValue annotation 'value' element
+ */
String getSpecifiedValue();
void setSpecifiedValue(String value);
String SPECIFIED_VALUE_PROPERTY = "specifiedValue"; //$NON-NLS-1$
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java
index 8f7060da14..3d047e3f98 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentEnum.java
@@ -36,21 +36,12 @@ public interface JaxbPersistentEnum
/**************** enum type *****************/
/**
- * Return the enum type, whether specified or defaulted.
- * This should never return null since at least the default will be set
+ * enum type corresponds to the XmlEnum annotation value element
*/
String getEnumType();
- /**
- * Return the default enum type which is always java.lang.String
- */
- String getDefaultEnumType();
+ void setEnumType(String enumType);
+ String ENUM_TYPE_PROPERTY = "enumType"; //$NON-NLS-1$
String DEFAULT_ENUM_TYPE = "java.lang.String"; //$NON-NLS-1$
- /**
- * enum type corresponds to the XmlEnum annotation value element
- */
- String getSpecifiedEnumType();
- void setSpecifiedEnumType(String specifiedEnumType);
- String SPECIFIED_ENUM_TYPE_PROPERTY = "specifiedEnumType"; //$NON-NLS-1$
/********** enum constants **********/
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
index 00abcc3ca3..cfbe0b70aa 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlJavaTypeAdapter.java
@@ -40,12 +40,7 @@ public interface XmlJavaTypeAdapter
/**************** type *****************/
String getType();
-
- String getSpecifiedType();
- void setSpecifiedType(String type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
+ void setType(String type);
+ String TYPE_PROPERTY = "type"; //$NON-NLS-1$
String DEFAULT_TYPE = "javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT"; //$NON-NLS-1$
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
index 10ecf31a6c..aed08b703e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchema.java
@@ -36,95 +36,30 @@ public interface XmlSchema
String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
/**
- * Return the location, whether specified or defaulted.
- * This should never return null since at least the default will be set
+ * Corresponds to the XmlSchema annotation location element
*/
String getLocation();
-
- /**
- * Return the default location
- */
- String getDefaultLocation();
-
- /**
- * String constant associated with changes to the location
- */
- String DEFAULT_LOCATION_PROPERTY = "defaultLocation"; //$NON-NLS-1$
-
+ void setLocation(String location);
+ String LOCATION_PROPERTY = "location"; //$NON-NLS-1$
String DEFAULT_LOCATION = "##generate"; //$NON-NLS-1$
- String getSpecifiedLocation();
-
- void setSpecifiedLocation(String location);
-
- /**
- * String constant associated with changes to the location
- */
- String SPECIFIED_LOCATION_PROPERTY = "specifiedLocation"; //$NON-NLS-1$
-
/**
- * Return the attribute form default, whether specified or defaulted.
- * This should never return null since at least the default will be set
+ * Corresponds to the XmlSchema annotation 'attributeFormDefault' element
*/
XmlNsForm getAttributeFormDefault();
-
- /**
- * Return the default attribute form default, never null
- */
- XmlNsForm getDefaultAttributeFormDefault();
-
- /**
- * String constant associated with changes to the default attribute form default
- */
- String DEFAULT_ATTRIBUTE_FORM_DEFAULT_PROPERTY = "defaultAttributeFormDefault"; //$NON-NLS-1$
-
- /**
- * Return the specified attribute form default;
- */
- XmlNsForm getSpecifiedAttributeFormDefault();
-
- /**
- * Set the specified attribute form default.
- */
- void setSpecifiedAttributeFormDefault(XmlNsForm newSpecifiedAttributeFormDefault);
-
- /**
- * String constant associated with changes to the specified attribute form default
- */
- String SPECIFIED_ATTRIBUTE_FROM_DEFAULT_PROPERTY = "specifiedAttributeFormDefault"; //$NON-NLS-1$
+ void setAttributeFormDefault(XmlNsForm newAttributeFormDefault);
+ String ATTRIBUTE_FROM_DEFAULT_PROPERTY = "atributeFormDefault"; //$NON-NLS-1$
+ XmlNsForm DEFAULT_ATTRIBUTE_FORM_DEFAULT = XmlNsForm.UNSET;
/**
- * Return the element form default, whether specified or defaulted.
- * This should never return null since at least the default will be set
+ * Corresponds to the XmlSchema annotation 'elementFormDefault' element
*/
XmlNsForm getElementFormDefault();
-
- /**
- * Return the default element form default, never null
- */
- XmlNsForm getDefaultElementFormDefault();
-
- /**
- * String constant associated with changes to the default element form default
- */
- String DEFAULT_ELEMENT_FORM_DEFAULT_PROPERTY = "defaultElementFormDefault"; //$NON-NLS-1$
-
- /**
- * Return the specified element form default;
- */
- XmlNsForm getSpecifiedElementFormDefault();
-
- /**
- * Set the specified element form default.
- */
- void setSpecifiedElementFormDefault(XmlNsForm newSpecifiedElementFormDefault);
-
- /**
- * String constant associated with changes to the specified element form default
- */
- String SPECIFIED_ELEMENT_FROM_DEFAULT_PROPERTY = "specifiedElementFormDefault"; //$NON-NLS-1$
+ void setElementFormDefault(XmlNsForm newElementFormDefault);
+ String ELEMENT_FROM_DEFAULT_PROPERTY = "elementFormDefault"; //$NON-NLS-1$
+ XmlNsForm DEFAULT_ELEMENT_FORM_DEFAULT = XmlNsForm.UNSET;
// ********** xml namespace prefixes **********
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
index e7c5793466..f7952a1837 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlSchemaType.java
@@ -41,29 +41,21 @@ public interface XmlSchemaType
/**************** namespace *****************/
/**
- * Return the namespace, whether specified or defaulted.
- * This should never return null since at least the default will be set
+ * Corresponds to the XmlSchemaType annotation 'namespace' element
*/
String getNamespace();
-
- String getSpecifiedNamespace();
- void setSpecifiedNamespace(String specifiedNamespace);
- String SPECIFIED_NAMESPACE_PROPERTY = "specifiedNamespace"; //$NON-NLS-1$
-
- String getDefaultNamespace();
- String DEFAULT_NAMEPSACE_PROPERTY = "defaultNamespace"; //$NON-NLS-1$
+ void setNamespace(String namespace);
+ String NAMESPACE_PROPERTY = "namespace"; //$NON-NLS-1$
String DEFAULT_NAMESPACE = "http://www.w3.org/2001/XMLSchema"; //$NON-NLS-1$
/**************** type *****************/
+ /**
+ * Corresponds to the XmlSchemaType annotation 'type' element
+ */
String getType();
-
- String getSpecifiedType();
- void setSpecifiedType(String type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- String getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
+ void setType(String type);
+ String TYPE_PROPERTY = "type"; //$NON-NLS-1$
String DEFAULT_TYPE = "javax.xml.bind.annotation.XmlSchemaType.DEFAULT"; //$NON-NLS-1$
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
index 2299c6d1db..692add0b8b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaEnumConstant.java
@@ -20,8 +20,6 @@ public class GenericJavaEnumConstant
implements JaxbEnumConstant {
final protected JavaResourceEnumConstant resourceEnumConstant;
-
- protected String name;
protected String specifiedValue;
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java
index 2093b9f138..d43101901b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java
@@ -69,11 +69,11 @@ public class GenericJavaPersistentEnum
// ********** enum type **********
- public String getSpecifiedEnumType() {
+ public String getEnumType() {
return this.enumType;
}
- public void setSpecifiedEnumType(String enumType) {
+ public void setEnumType(String enumType) {
this.getXmlEnumAnnotation().setValue(enumType);
this.setEnumType_(enumType);
}
@@ -81,15 +81,7 @@ public class GenericJavaPersistentEnum
protected void setEnumType_(String enumType) {
String old = this.enumType;
this.enumType = enumType;
- this.firePropertyChanged(SPECIFIED_ENUM_TYPE_PROPERTY, old, enumType);
- }
-
- public String getDefaultEnumType() {
- return DEFAULT_ENUM_TYPE;
- }
-
- public String getEnumType() {
- return this.getSpecifiedEnumType() != null ? this.getSpecifiedEnumType() : getDefaultEnumType();
+ this.firePropertyChanged(ENUM_TYPE_PROPERTY, old, enumType);
}
protected String getResourceEnumType() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlJavaTypeAdapter.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlJavaTypeAdapter.java
index 5d4661428b..2a899e016c 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlJavaTypeAdapter.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlJavaTypeAdapter.java
@@ -23,13 +23,13 @@ public class GenericJavaXmlJavaTypeAdapter
protected String value;
- protected String specifiedType;
+ protected String type;
public GenericJavaXmlJavaTypeAdapter(JaxbContextNode parent, XmlJavaTypeAdapterAnnotation resource) {
super(parent);
this.resourceXmlJavaTypeAdapter = resource;
this.value = this.getResourceValue();
- this.specifiedType = this.getResourceTypeString();
+ this.type = this.getResourceTypeString();
}
@@ -37,7 +37,7 @@ public class GenericJavaXmlJavaTypeAdapter
public void synchronizeWithResourceModel() {
this.setValue_(this.getResourceValue());
- this.setSpecifiedType_(this.getResourceTypeString());
+ this.setType_(this.getResourceTypeString());
}
public void update() {
@@ -76,26 +76,18 @@ public class GenericJavaXmlJavaTypeAdapter
// ********** type **********
public String getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
+ return this.type;
}
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String location) {
+ public void setType(String location) {
this.resourceXmlJavaTypeAdapter.setType(location);
- this.setSpecifiedType_(location);
- }
-
- protected void setSpecifiedType_(String type) {
- String old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
+ this.setType_(location);
}
- public String getDefaultType() {
- return DEFAULT_TYPE;
+ protected void setType_(String type) {
+ String old = this.type;
+ this.type = type;
+ this.firePropertyChanged(TYPE_PROPERTY, old, type);
}
protected String getResourceTypeString() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
index 3b78581597..0643d00a93 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java
@@ -26,20 +26,20 @@ public class GenericJavaXmlSchema
protected String namespace;
- protected String specifiedLocation;
+ protected String location;
- protected XmlNsForm specifiedAttributeFormDefault;
+ protected XmlNsForm attributeFormDefault;
- protected XmlNsForm specifiedElementFormDefault;
+ protected XmlNsForm elementFormDefault;
protected final XmlNsPrefixContainer xmlNsPrefixContainer;
public GenericJavaXmlSchema(JaxbPackageInfo parent) {
super(parent);
this.namespace = this.getResourceNamespace();
- this.specifiedLocation = this.getResourceLocation();
- this.specifiedAttributeFormDefault = this.getResourceAttributeFormDefault();
- this.specifiedElementFormDefault = this.getResourceElementFormDefault();
+ this.location = this.getResourceLocation();
+ this.attributeFormDefault = this.getResourceAttributeFormDefault();
+ this.elementFormDefault = this.getResourceElementFormDefault();
this.xmlNsPrefixContainer = new XmlNsPrefixContainer();
}
@@ -48,9 +48,9 @@ public class GenericJavaXmlSchema
public void synchronizeWithResourceModel() {
this.setNamespace_(this.getResourceNamespace());
- this.setSpecifiedLocation_(this.getResourceLocation());
- this.setSpecifiedAttributeFormDefault_(this.getResourceAttributeFormDefault());
- this.setSpecifiedElementFormDefault_(this.getResourceElementFormDefault());
+ this.setLocation_(this.getResourceLocation());
+ this.setAttributeFormDefault_(this.getResourceAttributeFormDefault());
+ this.setElementFormDefault_(this.getResourceElementFormDefault());
this.syncXmlNsPrefixes();
}
@@ -99,26 +99,18 @@ public class GenericJavaXmlSchema
// ********** location **********
public String getLocation() {
- return (this.specifiedLocation != null) ? this.specifiedLocation : this.getDefaultLocation();
+ return this.location;
}
- public String getSpecifiedLocation() {
- return this.specifiedLocation;
- }
-
- public void setSpecifiedLocation(String location) {
+ public void setLocation(String location) {
this.getXmlSchemaAnnotation().setLocation(location);
- this.setSpecifiedLocation_(location);
- }
-
- protected void setSpecifiedLocation_(String location) {
- String old = this.specifiedLocation;
- this.specifiedLocation = location;
- this.firePropertyChanged(SPECIFIED_LOCATION_PROPERTY, old, location);
+ this.setLocation_(location);
}
- public String getDefaultLocation() {
- return DEFAULT_LOCATION;
+ protected void setLocation_(String location) {
+ String old = this.location;
+ this.location = location;
+ this.firePropertyChanged(LOCATION_PROPERTY, old, location);
}
protected String getResourceLocation() {
@@ -128,26 +120,18 @@ public class GenericJavaXmlSchema
// ********** attribute form default **********
public XmlNsForm getAttributeFormDefault() {
- return (this.specifiedAttributeFormDefault != null) ? this.specifiedAttributeFormDefault : this.getDefaultAttributeFormDefault();
- }
-
- public XmlNsForm getSpecifiedAttributeFormDefault() {
- return this.specifiedAttributeFormDefault;
+ return this.attributeFormDefault;
}
- public void setSpecifiedAttributeFormDefault(XmlNsForm xmlNsForm) {
+ public void setAttributeFormDefault(XmlNsForm xmlNsForm) {
this.getXmlSchemaAnnotation().setAttributeFormDefault(XmlNsForm.toJavaResourceModel(xmlNsForm));
- this.setSpecifiedAttributeFormDefault_(xmlNsForm);
+ this.setAttributeFormDefault_(xmlNsForm);
}
- protected void setSpecifiedAttributeFormDefault_(XmlNsForm xmlNsForm) {
- XmlNsForm old = this.specifiedAttributeFormDefault;
- this.specifiedAttributeFormDefault = xmlNsForm;
- this.firePropertyChanged(SPECIFIED_ATTRIBUTE_FROM_DEFAULT_PROPERTY, old, xmlNsForm);
- }
-
- public XmlNsForm getDefaultAttributeFormDefault() {
- return XmlNsForm.UNSET;
+ protected void setAttributeFormDefault_(XmlNsForm xmlNsForm) {
+ XmlNsForm old = this.attributeFormDefault;
+ this.attributeFormDefault = xmlNsForm;
+ this.firePropertyChanged(ATTRIBUTE_FROM_DEFAULT_PROPERTY, old, xmlNsForm);
}
protected XmlNsForm getResourceAttributeFormDefault() {
@@ -157,26 +141,18 @@ public class GenericJavaXmlSchema
// ********** element form default **********
public XmlNsForm getElementFormDefault() {
- return (this.specifiedElementFormDefault != null) ? this.specifiedElementFormDefault : this.getDefaultElementFormDefault();
- }
-
- public XmlNsForm getSpecifiedElementFormDefault() {
- return this.specifiedElementFormDefault;
+ return this.elementFormDefault;
}
- public void setSpecifiedElementFormDefault(XmlNsForm xmlNsForm) {
+ public void setElementFormDefault(XmlNsForm xmlNsForm) {
this.getXmlSchemaAnnotation().setElementFormDefault(XmlNsForm.toJavaResourceModel(xmlNsForm));
- this.setSpecifiedElementFormDefault_(xmlNsForm);
- }
-
- protected void setSpecifiedElementFormDefault_(XmlNsForm xmlNsForm) {
- XmlNsForm old = this.specifiedElementFormDefault;
- this.specifiedElementFormDefault = xmlNsForm;
- this.firePropertyChanged(SPECIFIED_ELEMENT_FROM_DEFAULT_PROPERTY, old, xmlNsForm);
+ this.setElementFormDefault_(xmlNsForm);
}
- public XmlNsForm getDefaultElementFormDefault() {
- return XmlNsForm.UNSET;
+ protected void setElementFormDefault_(XmlNsForm xmlNsForm) {
+ XmlNsForm old = this.elementFormDefault;
+ this.elementFormDefault = xmlNsForm;
+ this.firePropertyChanged(ELEMENT_FROM_DEFAULT_PROPERTY, old, xmlNsForm);
}
protected XmlNsForm getResourceElementFormDefault() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
index fedf06cfa6..39959f0987 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchemaType.java
@@ -23,16 +23,16 @@ public class GenericJavaXmlSchemaType
protected String name;
- protected String specifiedNamespace;
+ protected String namespace;
- protected String specifiedType;
+ protected String type;
public GenericJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation) {
super(parent);
this.xmlSchemaTypeAnnotation = xmlSchemaTypeAnnotation;
this.name = this.getResourceName();
- this.specifiedNamespace = this.getResourceNamespace();
- this.specifiedType = this.getResourceTypeString();
+ this.namespace = this.getResourceNamespace();
+ this.type = this.getResourceTypeString();
}
@@ -40,8 +40,8 @@ public class GenericJavaXmlSchemaType
public void synchronizeWithResourceModel() {
this.setName_(this.getResourceName());
- this.setSpecifiedNamespace_(this.getResourceNamespace());
- this.setSpecifiedType_(this.getResourceTypeString());
+ this.setNamespace_(this.getResourceNamespace());
+ this.setType_(this.getResourceTypeString());
}
public void update() {
@@ -79,26 +79,18 @@ public class GenericJavaXmlSchemaType
// ********** namespace **********
public String getNamespace() {
- return (this.specifiedNamespace != null) ? this.specifiedNamespace : this.getDefaultNamespace();
+ return this.namespace;
}
- public String getSpecifiedNamespace() {
- return this.specifiedNamespace;
- }
-
- public void setSpecifiedNamespace(String location) {
+ public void setNamespace(String location) {
this.xmlSchemaTypeAnnotation.setNamespace(location);
- this.setSpecifiedNamespace_(location);
- }
-
- protected void setSpecifiedNamespace_(String namespace) {
- String old = this.specifiedNamespace;
- this.specifiedNamespace = namespace;
- this.firePropertyChanged(SPECIFIED_NAMESPACE_PROPERTY, old, namespace);
+ this.setNamespace_(location);
}
- public String getDefaultNamespace() {
- return DEFAULT_NAMESPACE;
+ protected void setNamespace_(String namespace) {
+ String old = this.namespace;
+ this.namespace = namespace;
+ this.firePropertyChanged(NAMESPACE_PROPERTY, old, namespace);
}
protected String getResourceNamespace() {
@@ -108,26 +100,18 @@ public class GenericJavaXmlSchemaType
// ********** type **********
public String getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
+ return this.type;
}
- public String getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(String location) {
+ public void setType(String location) {
this.xmlSchemaTypeAnnotation.setType(location);
- this.setSpecifiedType_(location);
- }
-
- protected void setSpecifiedType_(String type) {
- String old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
+ this.setType_(location);
}
- public String getDefaultType() {
- return DEFAULT_TYPE;
+ protected void setType_(String type) {
+ String old = this.type;
+ this.type = type;
+ this.firePropertyChanged(TYPE_PROPERTY, old, type);
}
protected String getResourceTypeString() {
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentEnumTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentEnumTests.java
index 6d55900400..246c68a61d 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentEnumTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentEnumTests.java
@@ -601,30 +601,22 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase
JaxbPersistentEnum contextEnum = CollectionTools.get(getContextRoot().getPersistentEnums(), 0);
JavaResourceEnum resourceEnum = contextEnum.getJavaResourceType();
- assertNull(contextEnum.getSpecifiedEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getDefaultEnumType());
+ assertNull(contextEnum.getEnumType());
- contextEnum.setSpecifiedEnumType("Integer");
+ contextEnum.setEnumType("Integer");
XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(XmlEnumAnnotation.ANNOTATION_NAME);
assertEquals("Integer", xmlEnumAnnotation.getValue());
- assertEquals("Integer", contextEnum.getSpecifiedEnumType());
assertEquals("Integer", contextEnum.getEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getDefaultEnumType());
- contextEnum.setSpecifiedEnumType(null);
+ contextEnum.setEnumType(null);
xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(XmlEnumAnnotation.ANNOTATION_NAME);
assertNull(xmlEnumAnnotation.getValue());
- assertNull(contextEnum.getSpecifiedEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getDefaultEnumType());
+ assertNull(contextEnum.getEnumType());
resourceEnum.addAnnotation(XmlTypeAnnotation.ANNOTATION_NAME);
resourceEnum.removeAnnotation(XmlEnumAnnotation.ANNOTATION_NAME);
contextEnum = CollectionTools.get(getContextRoot().getPersistentEnums(), 0);
- assertNull(contextEnum.getSpecifiedEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getEnumType());
- assertEquals(JaxbPersistentEnum.DEFAULT_ENUM_TYPE, contextEnum.getDefaultEnumType());
+ assertNull(contextEnum.getEnumType());
}
public void testUpdateEnumType() throws Exception {
@@ -633,7 +625,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase
JaxbPersistentEnum contextEnum = CollectionTools.get(getContextRoot().getPersistentEnums(), 0);
JavaResourceEnum resourceEnum = contextEnum.getJavaResourceType();
- assertNull(contextEnum.getSpecifiedEnumType());
+ assertNull(contextEnum.getEnumType());
//add a factoryClass member value pair
@@ -643,7 +635,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase
GenericJavaPersistentEnumTests.this.addXmlEnumTypeMemberValuePair(declaration, JAXB.XML_ENUM__VALUE, "String");
}
});
- assertEquals("String", contextEnum.getSpecifiedEnumType());
+ assertEquals("String", contextEnum.getEnumType());
//remove the factoryClass member value pair
annotatedElement.edit(new Member.Editor() {
@@ -652,7 +644,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase
GenericJavaPersistentEnumTests.this.values(xmlEnumAnnotation).remove(0);
}
});
- assertNull(contextEnum.getSpecifiedEnumType());
+ assertNull(contextEnum.getEnumType());
}
public void testUpdateEnumConstants() throws Exception {
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlJavaTypeAdapterTests.java
index e067b9d0b3..9501b0796b 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlJavaTypeAdapterTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlJavaTypeAdapterTests.java
@@ -92,24 +92,18 @@ public class GenericJavaXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getDefaultType());
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
+ assertNull(contextXmlJavaTypeAdapter.getType());
- contextXmlJavaTypeAdapter.setSpecifiedType("foo");
+ contextXmlJavaTypeAdapter.setType("foo");
XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
assertEquals("foo", javaTypeAdapterAnnotation.getType());
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getDefaultType());
assertEquals("foo", contextXmlJavaTypeAdapter.getType());
- assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType());
//verify the xml schema type annotation is not removed when the type is set to null
- contextXmlJavaTypeAdapter.setSpecifiedType(null);
+ contextXmlJavaTypeAdapter.setType(null);
javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME);
assertNull(javaTypeAdapterAnnotation.getType());
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getDefaultType());
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
+ assertNull(contextXmlJavaTypeAdapter.getType());
}
public void testUpdateType() throws Exception {
@@ -118,9 +112,7 @@ public class GenericJavaXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
XmlJavaTypeAdapter contextXmlJavaTypeAdapter = contextPackageInfo.getXmlJavaTypeAdapters().iterator().next();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getDefaultType());
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getType());
- assertNull(contextXmlJavaTypeAdapter.getSpecifiedType());
+ assertNull(contextXmlJavaTypeAdapter.getType());
//add a type member value pair
AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
@@ -129,9 +121,7 @@ public class GenericJavaXmlJavaTypeAdapterTests extends JaxbContextModelTestCase
GenericJavaXmlJavaTypeAdapterTests.this.addXmlJavaTypeAdapterTypeMemberValuePair(declaration, JAXB.XML_JAVA_TYPE_ADAPTER__TYPE, "String");
}
});
- assertEquals(XmlJavaTypeAdapter.DEFAULT_TYPE, contextXmlJavaTypeAdapter.getDefaultType());
assertEquals("String", contextXmlJavaTypeAdapter.getType());
- assertEquals("String", contextXmlJavaTypeAdapter.getSpecifiedType());
annotatedElement.edit(new Member.Editor() {
public void edit(ModifiedDeclaration declaration) {
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
index e5b8924ddc..e559fa6699 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java
@@ -113,33 +113,25 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getLocation());
- assertNull(contextXmlSchema.getSpecifiedLocation());
+ assertNull(contextXmlSchema.getLocation());
- contextXmlSchema.setSpecifiedLocation("foo");
+ contextXmlSchema.setLocation("foo");
XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertEquals("foo", schemaAnnotation.getLocation());
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
assertEquals("foo", contextXmlSchema.getLocation());
- assertEquals("foo", contextXmlSchema.getSpecifiedLocation());
//set another annotation so the context model is not blown away by removing the XmlSchema annotation
contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedLocation(null);
+ contextXmlSchema.setLocation(null);
schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertNull(schemaAnnotation);
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getLocation());
- assertNull(contextXmlSchema.getSpecifiedLocation());
+ assertNull(contextXmlSchema.getLocation());
//set location again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedLocation("foo");
+ contextXmlSchema.setLocation("foo");
schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertEquals("foo", schemaAnnotation.getLocation());
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
assertEquals("foo", contextXmlSchema.getLocation());
- assertEquals("foo", contextXmlSchema.getSpecifiedLocation());
}
public void testUpdateLocation() throws Exception {
@@ -148,9 +140,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getLocation());
- assertNull(contextXmlSchema.getSpecifiedLocation());
+ assertNull(contextXmlSchema.getLocation());
//add a location member value pair
AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
@@ -160,9 +150,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
}
});
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
assertEquals("foo", contextXmlSchema.getLocation());
- assertEquals("foo", contextXmlSchema.getSpecifiedLocation());
annotatedElement.edit(new Member.Editor() {
public void edit(ModifiedDeclaration declaration) {
@@ -170,9 +158,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
}
});
contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getDefaultLocation());
- assertEquals(XmlSchema.DEFAULT_LOCATION, contextXmlSchema.getLocation());
- assertNull(contextXmlSchema.getSpecifiedLocation());
+ assertNull(contextXmlSchema.getLocation());
}
public void testModifyAttributeFormDefault() throws Exception {
@@ -181,39 +167,29 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
+ assertNull(contextXmlSchema.getAttributeFormDefault());
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED);
+ contextXmlSchema.setAttributeFormDefault(XmlNsForm.QUALIFIED);
XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.UNQUALIFIED);
+ contextXmlSchema.setAttributeFormDefault(XmlNsForm.UNQUALIFIED);
assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
//set another annotation so the context model is not blown away by removing the XmlSchema annotation
contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedAttributeFormDefault(null);
+ contextXmlSchema.setAttributeFormDefault(null);
schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertNull(schemaAnnotation);
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
+ assertNull(contextXmlSchema.getAttributeFormDefault());
//set attribute form default again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED);
+ contextXmlSchema.setAttributeFormDefault(XmlNsForm.QUALIFIED);
schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
}
public void testUpdateAttributeFormDefault() throws Exception {
@@ -222,9 +198,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
+ assertNull(contextXmlSchema.getAttributeFormDefault());
//set the attribute form default value to QUALIFIED
AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
@@ -237,9 +211,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
}
});
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
//set the attribute form default value to UNQUALIFIED
@@ -252,9 +224,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
}
});
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getAttributeFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedAttributeFormDefault());
annotatedElement.edit(new Member.Editor() {
public void edit(ModifiedDeclaration declaration) {
@@ -263,9 +233,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
});
contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultAttributeFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault());
- assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault());
+ assertNull(contextXmlSchema.getAttributeFormDefault());
}
public void testModifyElementFormDefault() throws Exception {
@@ -274,39 +242,29 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
+ assertNull(contextXmlSchema.getElementFormDefault());
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED);
+ contextXmlSchema.setElementFormDefault(XmlNsForm.QUALIFIED);
XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.UNQUALIFIED);
+ contextXmlSchema.setElementFormDefault(XmlNsForm.UNQUALIFIED);
assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.UNQUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getElementFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
//set another annotation so the context model is not blown away by removing the XmlSchema annotation
contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD);
- contextXmlSchema.setSpecifiedElementFormDefault(null);
+ contextXmlSchema.setElementFormDefault(null);
schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertNull(schemaAnnotation);
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
+ assertNull(contextXmlSchema.getElementFormDefault());
//set element form default again, this time starting with no XmlSchema annotation
- contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED);
+ contextXmlSchema.setElementFormDefault(XmlNsForm.QUALIFIED);
schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME);
assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
}
public void testUpdateElementFormDefault() throws Exception {
@@ -315,9 +273,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
XmlSchema contextXmlSchema = contextPackageInfo.getXmlSchema();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
+ assertNull(contextXmlSchema.getElementFormDefault());
//set the element form default value to QUALIFIED
AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
@@ -330,9 +286,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
}
});
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault());
- assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
//set the element form default value to UNQUALIFIED
@@ -345,9 +299,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
}
});
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getElementFormDefault());
- assertEquals(XmlNsForm.UNQUALIFIED, contextXmlSchema.getSpecifiedElementFormDefault());
annotatedElement.edit(new Member.Editor() {
public void edit(ModifiedDeclaration declaration) {
@@ -356,9 +308,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase
});
contextXmlSchema = contextPackageInfo.getXmlSchema();
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getDefaultElementFormDefault());
- assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault());
- assertNull(contextXmlSchema.getSpecifiedElementFormDefault());
+ assertNull(contextXmlSchema.getElementFormDefault());
}
public void testGetXmlNsPrefixes() throws Exception {
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
index 99af6faf4a..c5e96bfb83 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java
@@ -91,24 +91,18 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getDefaultNamespace());
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getNamespace());
- assertNull(contextXmlSchemaType.getSpecifiedNamespace());
+ assertNull(contextXmlSchemaType.getNamespace());
- contextXmlSchemaType.setSpecifiedNamespace("foo");
+ contextXmlSchemaType.setNamespace("foo");
XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
assertEquals("foo", schemaTypeAnnotation.getNamespace());
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getDefaultNamespace());
assertEquals("foo", contextXmlSchemaType.getNamespace());
- assertEquals("foo", contextXmlSchemaType.getSpecifiedNamespace());
//verify the xml schema type annotation is not removed when the namespace is set to null
- contextXmlSchemaType.setSpecifiedNamespace(null);
+ contextXmlSchemaType.setNamespace(null);
schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
assertNull(schemaTypeAnnotation.getNamespace());
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getDefaultNamespace());
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getNamespace());
- assertNull(contextXmlSchemaType.getSpecifiedNamespace());
+ assertNull(contextXmlSchemaType.getNamespace());
}
public void testUpdateNamespace() throws Exception {
@@ -117,9 +111,7 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getDefaultNamespace());
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getNamespace());
- assertNull(contextXmlSchemaType.getSpecifiedNamespace());
+ assertNull(contextXmlSchemaType.getNamespace());
//add a namespace member value pair
AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
@@ -128,9 +120,7 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAMESPACE, "foo");
}
});
- assertEquals(XmlSchemaType.DEFAULT_NAMESPACE, contextXmlSchemaType.getDefaultNamespace());
assertEquals("foo", contextXmlSchemaType.getNamespace());
- assertEquals("foo", contextXmlSchemaType.getSpecifiedNamespace());
annotatedElement.edit(new Member.Editor() {
public void edit(ModifiedDeclaration declaration) {
@@ -146,24 +136,18 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getDefaultType());
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getType());
- assertNull(contextXmlSchemaType.getSpecifiedType());
+ assertNull(contextXmlSchemaType.getType());
- contextXmlSchemaType.setSpecifiedType("foo");
+ contextXmlSchemaType.setType("foo");
XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
assertEquals("foo", schemaTypeAnnotation.getType());
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getDefaultType());
assertEquals("foo", contextXmlSchemaType.getType());
- assertEquals("foo", contextXmlSchemaType.getSpecifiedType());
//verify the xml schema type annotation is not removed when the type is set to null
- contextXmlSchemaType.setSpecifiedType(null);
+ contextXmlSchemaType.setType(null);
schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME);
assertNull(schemaTypeAnnotation.getType());
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getDefaultType());
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getType());
- assertNull(contextXmlSchemaType.getSpecifiedType());
+ assertNull(contextXmlSchemaType.getType());
}
public void testUpdateType() throws Exception {
@@ -172,9 +156,7 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next();
JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage();
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getDefaultType());
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getType());
- assertNull(contextXmlSchemaType.getSpecifiedType());
+ assertNull(contextXmlSchemaType.getType());
//add a type member value pair
AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage);
@@ -183,9 +165,7 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase
GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__TYPE, "String");
}
});
- assertEquals(XmlSchemaType.DEFAULT_TYPE, contextXmlSchemaType.getDefaultType());
assertEquals("String", contextXmlSchemaType.getType());
- assertEquals("String", contextXmlSchemaType.getSpecifiedType());
annotatedElement.edit(new Member.Editor() {
public void edit(ModifiedDeclaration declaration) {

Back to the top