diff options
author | pfullbright | 2011-08-23 21:22:47 +0000 |
---|---|---|
committer | pfullbright | 2011-08-23 21:22:47 +0000 |
commit | 0bd4f94a03c7278eb052173e157360474e168474 (patch) | |
tree | 5fbd35a82e44f907ed4f02f587bc635d189bfcf3 /jaxb | |
parent | 38ad7d04356e63f181e22b2722035b391f39a39c (diff) | |
download | webtools.dali-0bd4f94a03c7278eb052173e157360474e168474.tar.gz webtools.dali-0bd4f94a03c7278eb052173e157360474e168474.tar.xz webtools.dali-0bd4f94a03c7278eb052173e157360474e168474.zip |
changed "SchemaComponentRef" -> "QName"
Diffstat (limited to 'jaxb')
35 files changed, 410 insertions, 410 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties index 401836f65c..fc45c950bd 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/property_files/jaxb_validation.properties @@ -39,5 +39,5 @@ XML_ANY_ATTRIBUTE_MAPPING_DEFINED_ON_NON_MAP = XmlAnyAttribute is only allowed o XML_ID_DEFINED_ON_NON_STRING = XmlID is only allowed on a java.lang.String property MULTIPLE_XML_IDS_DEFINED = Attribute ''{0}'' cannot have an XmlID because attribute ''{1}'' already has an XmlID, cannot define multiple mappings with XmlID -SCHEMA_COMPONENT_REF__MISSING_NAME = {0} name not specified -SCHEMA_COMPONENT_REF__UNRESOLVED_COMPONENT = Cannot resolve {0} with namespace ''{1}'' and name ''{2}'' in this context
\ No newline at end of file +QNAME__MISSING_NAME = {0} name not specified +QNAME__UNRESOLVED_COMPONENT = Cannot resolve {0} with namespace ''{1}'' and name ''{2}'' in this context
\ No newline at end of file diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java index bc6effc3bf..674d654b21 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbPersistentType.java @@ -28,9 +28,9 @@ import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition; public interface JaxbPersistentType extends JaxbType { - // ***** schema type ref ***** + // ***** qname ***** - JaxbSchemaComponentRef getSchemaTypeRef(); + JaxbQName getQName(); // **************** factory class *****************/ diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbSchemaComponentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java index 77cb5d2fc8..2053baa3c0 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbSchemaComponentRef.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/JaxbQName.java @@ -26,7 +26,7 @@ import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; * @version 3.? * @since 3.? */ -public interface JaxbSchemaComponentRef +public interface JaxbQName extends JavaContextNode { // ***** namespace ***** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java index 771c598d75..d79ce44365 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlAttributeMapping.java @@ -25,9 +25,9 @@ package org.eclipse.jpt.jaxb.core.context; public interface XmlAttributeMapping extends JaxbBasicMapping { - // ***** schema component ref ***** + // ***** qname ***** - JaxbSchemaComponentRef getSchemaComponentRef(); + JaxbQName getQName(); // ***** required ***** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java index c8f3b84d27..cd4780f986 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElement.java @@ -34,9 +34,9 @@ public interface XmlElement XmlElementAnnotation getAnnotation(boolean createIfNull); - // ***** schema element ref ***** + // ***** qname ***** - JaxbSchemaComponentRef getSchemaElementRef(); + JaxbQName getQName(); // ***** nillable ***** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java index e153a6dbe4..0aaf6bc7f5 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementRef.java @@ -34,9 +34,9 @@ public interface XmlElementRef XmlElementRefAnnotation getAnnotation(); - // ***** schema element ref ***** + // ***** qname ***** - JaxbSchemaComponentRef getSchemaElementRef(); + JaxbQName getQName(); // ***** required ***** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java index 7ed984cc37..d5e1e7fd4a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlElementWrapper.java @@ -28,9 +28,9 @@ import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration; public interface XmlElementWrapper extends JavaContextNode { - // ***** schema element ref ***** + // ***** qname ***** - JaxbSchemaComponentRef getSchemaElementRef(); + JaxbQName getQName(); // ***** nillable ***** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java index 7d9fae23f4..78b619c001 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/context/XmlRootElement.java @@ -29,5 +29,5 @@ public interface XmlRootElement JaxbPersistentType getPersistentType(); - JaxbSchemaComponentRef getSchemaElementRef(); + JaxbQName getQName(); } 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 20ed1b56de..32ae281959 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 @@ -32,10 +32,10 @@ public interface XmlSchemaType XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation(); - JaxbSchemaComponentRef getSchemaTypeRef(); + JaxbQName getQName(); - /**************** type *****************/ + // ***** type ***** /** * Corresponds to the XmlSchemaType annotation 'type' element diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaPersistentType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaPersistentType.java index bcf9878863..47dfec3fa6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaPersistentType.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaPersistentType.java @@ -23,13 +23,13 @@ import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentType; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlRootElement; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; @@ -41,7 +41,7 @@ public abstract class AbstractJavaPersistentType extends AbstractJavaType implements JaxbPersistentType { - protected final JaxbSchemaComponentRef schemaTypeRef; + protected final JaxbQName qName; protected String factoryClass; @@ -54,7 +54,7 @@ public abstract class AbstractJavaPersistentType public AbstractJavaPersistentType(JaxbContextRoot parent, JavaResourceAbstractType resourceType) { super(parent, resourceType); - this.schemaTypeRef = buildSchemaTypeRef(); + this.qName = buildQName(); this.factoryClass = this.getResourceFactoryClass(); this.factoryMethod = this.getResourceFactoryMethod(); this.propOrderContainer = new PropOrderContainer(); @@ -62,8 +62,8 @@ public abstract class AbstractJavaPersistentType } - protected JaxbSchemaComponentRef buildSchemaTypeRef() { - return new PersistentTypeSchemaTypeRef(this); + protected JaxbQName buildQName() { + return new XmlTypeQName(this); } @Override @@ -82,7 +82,7 @@ public abstract class AbstractJavaPersistentType @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaTypeRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); this.setFactoryClass_(getResourceFactoryClass()); this.setFactoryMethod_(getResourceFactoryMethod()); this.syncPropOrder(); @@ -92,7 +92,7 @@ public abstract class AbstractJavaPersistentType @Override public void update() { super.update(); - this.schemaTypeRef.update(); + this.qName.update(); } @@ -105,8 +105,8 @@ public abstract class AbstractJavaPersistentType // ***** schema type ref ***** - public JaxbSchemaComponentRef getSchemaTypeRef() { - return this.schemaTypeRef; + public JaxbQName getQName() { + return this.qName; } @@ -263,7 +263,7 @@ public abstract class AbstractJavaPersistentType return result; } - result = this.schemaTypeRef.getJavaCompletionProposals(pos, filter, astRoot); + result = this.qName.getJavaCompletionProposals(pos, filter, astRoot); if (! CollectionTools.isEmpty(result)) { return result; } @@ -291,7 +291,7 @@ public abstract class AbstractJavaPersistentType public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { super.validate(messages, reporter, astRoot); - this.schemaTypeRef.validate(messages, reporter, astRoot); + this.qName.validate(messages, reporter, astRoot); if (this.rootElement != null) { this.rootElement.validate(messages, reporter, astRoot); @@ -303,7 +303,7 @@ public abstract class AbstractJavaPersistentType public XsdTypeDefinition getXsdTypeDefinition() { XsdSchema xsdSchema = getJaxbPackage().getXsdSchema(); - return (xsdSchema == null) ? null : xsdSchema.getTypeDefinition(this.schemaTypeRef.getNamespace(), this.schemaTypeRef.getName()); + return (xsdSchema == null) ? null : xsdSchema.getTypeDefinition(this.qName.getNamespace(), this.qName.getName()); } @Override @@ -313,16 +313,16 @@ public abstract class AbstractJavaPersistentType } - protected class PersistentTypeSchemaTypeRef - extends AbstractJavaSchemaComponentRef { + protected class XmlTypeQName + extends AbstractJavaQName { - protected PersistentTypeSchemaTypeRef(JavaContextNode parent) { + protected XmlTypeQName(JavaContextNode parent) { super(parent); } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { // never null return AbstractJavaPersistentType.this.getXmlTypeAnnotation(); } @@ -356,7 +356,7 @@ public abstract class AbstractJavaPersistentType } @Override - public String getSchemaComponentTypeDescription() { + public String getReferencedComponentTypeDescription() { return JptJaxbCoreMessages.XML_TYPE_DESC; } @@ -378,7 +378,7 @@ public abstract class AbstractJavaPersistentType } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { // if name is not absent (""), type must be from schema associated with this package String name = getName(); String namespace = getNamespace(); diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaSchemaComponentRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java index bc3b4fe788..e658fe46f1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaSchemaComponentRef.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/AbstractJavaQName.java @@ -16,25 +16,25 @@ import org.eclipse.jpt.common.utility.Filter; import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.wst.validation.internal.provisional.core.IMessage; import org.eclipse.wst.validation.internal.provisional.core.IReporter; -public abstract class AbstractJavaSchemaComponentRef +public abstract class AbstractJavaQName extends AbstractJavaContextNode - implements JaxbSchemaComponentRef { + implements JaxbQName { protected String specifiedNamespace; protected String specifiedName; - public AbstractJavaSchemaComponentRef(JavaContextNode parent) { + public AbstractJavaQName(JavaContextNode parent) { super(parent); this.specifiedNamespace = buildSpecifiedNamespace(); this.specifiedName = buildSpecifiedName(); @@ -46,7 +46,7 @@ public abstract class AbstractJavaSchemaComponentRef return (JavaContextNode) super.getParent(); } - protected abstract SchemaComponentRefAnnotation getAnnotation(boolean createIfNull); + protected abstract QNameAnnotation getAnnotation(boolean createIfNull); @Override public void synchronizeWithResourceModel() { @@ -81,7 +81,7 @@ public abstract class AbstractJavaSchemaComponentRef } protected String buildSpecifiedNamespace() { - SchemaComponentRefAnnotation annotation = getAnnotation(false); + QNameAnnotation annotation = getAnnotation(false); return annotation == null ? null : annotation.getNamespace(); } @@ -110,7 +110,7 @@ public abstract class AbstractJavaSchemaComponentRef } protected String buildSpecifiedName() { - SchemaComponentRefAnnotation annotation = getAnnotation(false); + QNameAnnotation annotation = getAnnotation(false); return annotation == null ? null : annotation.getName(); } @@ -137,14 +137,14 @@ public abstract class AbstractJavaSchemaComponentRef } protected boolean namespaceTouches(int pos, CompilationUnit astRoot) { - SchemaComponentRefAnnotation annotation = getAnnotation(false); + QNameAnnotation annotation = getAnnotation(false); return (annotation == null) ? false : annotation.namespaceTouches(pos, astRoot); } protected abstract Iterable<String> getNamespaceProposals(Filter<String> filter); protected boolean nameTouches(int pos, CompilationUnit astRoot) { - SchemaComponentRefAnnotation annotation = getAnnotation(false); + QNameAnnotation annotation = getAnnotation(false); return (annotation == null) ? false : annotation.nameTouches(pos, astRoot); } @@ -159,12 +159,12 @@ public abstract class AbstractJavaSchemaComponentRef } public TextRange getNamespaceTextRange(CompilationUnit astRoot) { - SchemaComponentRefAnnotation annotation = getAnnotation(false); + QNameAnnotation annotation = getAnnotation(false); return (annotation == null) ? null : getTextRange(annotation.getNamespaceTextRange(astRoot), astRoot); } public TextRange getNameTextRange(CompilationUnit astRoot) { - SchemaComponentRefAnnotation annotation = getAnnotation(false); + QNameAnnotation annotation = getAnnotation(false); return (annotation == null) ? null : getTextRange(annotation.getNameTextRange(astRoot), astRoot); } @@ -175,7 +175,7 @@ public abstract class AbstractJavaSchemaComponentRef /** * e.g. "XML element" */ - protected String getSchemaComponentTypeDescription() { + protected String getReferencedComponentTypeDescription() { // default impl return null; } @@ -187,7 +187,7 @@ public abstract class AbstractJavaSchemaComponentRef validateName(messages, reporter, astRoot); if (! StringTools.stringIsEmpty(getName())) { - validateSchemaComponentRef(messages, reporter, astRoot); + validateReference(messages, reporter, astRoot); } } @@ -196,20 +196,20 @@ public abstract class AbstractJavaSchemaComponentRef messages.add( DefaultValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, - JaxbValidationMessages.SCHEMA_COMPONENT_REF__MISSING_NAME, - new String[] { getSchemaComponentTypeDescription() }, + JaxbValidationMessages.QNAME__MISSING_NAME, + new String[] { getReferencedComponentTypeDescription() }, this, getNameTextRange(astRoot))); } } - protected abstract void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot); + protected abstract void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot); protected IMessage getUnresolveSchemaComponentMessage(CompilationUnit astRoot) { return DefaultValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, - JaxbValidationMessages.SCHEMA_COMPONENT_REF__UNRESOLVED_COMPONENT, - new String[] { getSchemaComponentTypeDescription(), getNamespace(), getName() }, + JaxbValidationMessages.QNAME__UNRESOLVED_COMPONENT, + new String[] { getReferencedComponentTypeDescription(), getNamespace(), getName() }, this, getValidationTextRange(astRoot)); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java index bfed1cc684..f4b1b04d57 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAttributeMapping.java @@ -17,13 +17,13 @@ import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable; import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlNsForm; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages; import org.eclipse.jpt.jaxb.core.internal.context.java.GenericJavaXmlIDREF.ValidatableType; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition; @@ -34,28 +34,28 @@ public class GenericJavaXmlAttributeMapping extends GenericJavaBasicMapping<XmlAttributeAnnotation> implements XmlAttributeMapping { - protected final JaxbSchemaComponentRef schemaComponentRef; + protected final JaxbQName qName; protected Boolean specifiedRequired; public GenericJavaXmlAttributeMapping(JaxbPersistentAttribute parent) { super(parent); - this.schemaComponentRef = buildSchemaComponentRef(); + this.qName = buildQName(); this.specifiedRequired = buildSpecifiedRequired(); } @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaComponentRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); setSpecifiedRequired_(buildSpecifiedRequired()); } @Override public void update() { super.update(); - this.schemaComponentRef.update(); + this.qName.update(); } public String getKey() { @@ -70,12 +70,12 @@ public class GenericJavaXmlAttributeMapping // ***** schema component ref ***** - public JaxbSchemaComponentRef getSchemaComponentRef() { - return this.schemaComponentRef; + public JaxbQName getQName() { + return this.qName; } - protected JaxbSchemaComponentRef buildSchemaComponentRef() { - return new XmlSchemaAttributeRef(this); + protected JaxbQName buildQName() { + return new XmlAttributeQName(this); } @@ -118,21 +118,21 @@ public class GenericJavaXmlAttributeMapping } - protected class XmlSchemaAttributeRef - extends AbstractJavaSchemaComponentRef { + protected class XmlAttributeQName + extends AbstractJavaQName { - protected XmlSchemaAttributeRef(JavaContextNode parent) { + protected XmlAttributeQName(JavaContextNode parent) { super(parent); } @Override - public String getSchemaComponentTypeDescription() { + public String getReferencedComponentTypeDescription() { return JptJaxbCoreMessages.XML_ATTRIBUTE_DESC; } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { if (createIfNull) { return GenericJavaXmlAttributeMapping.this.getOrCreateAnnotation(); } @@ -155,7 +155,7 @@ public class GenericJavaXmlAttributeMapping @Override public String getDefaultNamespace() { return (GenericJavaXmlAttributeMapping.this.getJaxbPackage().getAttributeFormDefault() == XmlNsForm.QUALIFIED) ? - GenericJavaXmlAttributeMapping.this.getPersistentClass().getSchemaTypeRef().getNamespace() : ""; + GenericJavaXmlAttributeMapping.this.getPersistentClass().getQName().getNamespace() : ""; } @Override @@ -165,7 +165,7 @@ public class GenericJavaXmlAttributeMapping } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { XsdTypeDefinition type = getPersistentClass().getXsdTypeDefinition(); if (type != null) { if (type.getAttribute(getNamespace(), getName()) == null) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java index f7e4ed6f1b..a07ce2ae78 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElement.java @@ -22,7 +22,7 @@ import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlElement; import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper; import org.eclipse.jpt.jaxb.core.context.XmlNsForm; @@ -30,7 +30,7 @@ import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; @@ -45,7 +45,7 @@ public class GenericJavaXmlElement protected final Context context; - protected final JaxbSchemaComponentRef schemaElementRef; + protected final JaxbQName qName; protected Boolean specifiedNillable; @@ -63,7 +63,7 @@ public class GenericJavaXmlElement public GenericJavaXmlElement(JavaContextNode parent, Context context) { super(parent); this.context = context; - this.schemaElementRef = buildSchemaElementRef(); + this.qName = buildQName(); this.specifiedNillable = buildSpecifiedNillable(); this.defaultNillable = buildDefaultNillable(); this.specifiedRequired = buildSpecifiedRequired(); @@ -76,7 +76,7 @@ public class GenericJavaXmlElement @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaElementRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); setSpecifiedNillable_(buildSpecifiedNillable()); setDefaultNillable_(buildDefaultNillable()); setSpecifiedRequired_(buildSpecifiedRequired()); @@ -88,7 +88,7 @@ public class GenericJavaXmlElement @Override public void update() { super.update(); - this.schemaElementRef.update(); + this.qName.update(); } @Override @@ -119,12 +119,12 @@ public class GenericJavaXmlElement // ***** schema component ref ***** - public JaxbSchemaComponentRef getSchemaElementRef() { - return this.schemaElementRef; + public JaxbQName getQName() { + return this.qName; } - protected JaxbSchemaComponentRef buildSchemaElementRef() { - return new XmlSchemaElementRef(this); + protected JaxbQName buildQName() { + return new XmlElementQName(this); } @@ -286,7 +286,7 @@ public class GenericJavaXmlElement return result; } - result = this.schemaElementRef.getJavaCompletionProposals(pos, filter, astRoot); + result = this.qName.getJavaCompletionProposals(pos, filter, astRoot); if (! CollectionTools.isEmpty(result)) { return result; } @@ -314,13 +314,13 @@ public class GenericJavaXmlElement validateType(messages, reporter, astRoot); - if (StringTools.stringIsEmpty(this.schemaElementRef.getName())) { + if (StringTools.stringIsEmpty(this.qName.getName())) { messages.add( DefaultValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, JaxbValidationMessages.XML_ELEMENT__UNSPECIFIED_ELEMENT_NAME, this, - this.schemaElementRef.getNameTextRange(astRoot))); + this.qName.getNameTextRange(astRoot))); } } @@ -352,20 +352,20 @@ public class GenericJavaXmlElement } - protected class XmlSchemaElementRef - extends AbstractJavaSchemaComponentRef { + protected class XmlElementQName + extends AbstractJavaQName { - protected XmlSchemaElementRef(JavaContextNode parent) { + protected XmlElementQName(JavaContextNode parent) { super(parent); } @Override - public String getSchemaComponentTypeDescription() { + public String getReferencedComponentTypeDescription() { return JptJaxbCoreMessages.XML_ELEMENT_DESC; } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { return GenericJavaXmlElement.this.getAnnotation(createIfNull); } @@ -399,7 +399,7 @@ public class GenericJavaXmlElement @Override public String getDefaultNamespace() { return (GenericJavaXmlElement.this.getJaxbPackage().getElementFormDefault() == XmlNsForm.QUALIFIED) ? - GenericJavaXmlElement.this.getPersistentClass().getSchemaTypeRef().getNamespace() : ""; + GenericJavaXmlElement.this.getPersistentClass().getQName().getNamespace() : ""; } @Override @@ -409,7 +409,7 @@ public class GenericJavaXmlElement } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { XsdTypeDefinition xsdType = GenericJavaXmlElement.this.getPersistentClass().getXsdTypeDefinition(); if (xsdType == null) { return; diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java index c3689cbcf2..a2bb271f97 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementRef.java @@ -20,12 +20,12 @@ import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlElementRef; import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper; import org.eclipse.jpt.jaxb.core.context.XmlNsForm; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -38,7 +38,7 @@ public class GenericJavaXmlElementRef protected final Context context; - protected final JaxbSchemaComponentRef schemaElementRef; + protected final JaxbQName qName; protected Boolean specifiedRequired; @@ -50,7 +50,7 @@ public class GenericJavaXmlElementRef public GenericJavaXmlElementRef(JavaContextNode parent, Context context) { super(parent); this.context = context; - this.schemaElementRef = buildSchemaElementRef(); + this.qName = buildQName(); this.specifiedRequired = buildSpecifiedRequired(); this.specifiedType = buildSpecifiedType(); this.defaultType = buildDefaultType(); @@ -60,7 +60,7 @@ public class GenericJavaXmlElementRef @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaElementRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); setSpecifiedRequired_(buildSpecifiedRequired()); setSpecifiedType_(buildSpecifiedType()); setDefaultType_(buildDefaultType()); @@ -69,7 +69,7 @@ public class GenericJavaXmlElementRef @Override public void update() { super.update(); - this.schemaElementRef.update(); + this.qName.update(); } @Override @@ -100,12 +100,12 @@ public class GenericJavaXmlElementRef // ***** schema component ref ***** - public JaxbSchemaComponentRef getSchemaElementRef() { - return this.schemaElementRef; + public JaxbQName getQName() { + return this.qName; } - protected JaxbSchemaComponentRef buildSchemaElementRef() { - return new XmlElementDeclRef(this); + protected JaxbQName buildQName() { + return new XmlElementRefQName(this); } @@ -200,7 +200,7 @@ public class GenericJavaXmlElementRef return result; } - result = this.schemaElementRef.getJavaCompletionProposals(pos, filter, astRoot); + result = this.qName.getJavaCompletionProposals(pos, filter, astRoot); if (! CollectionTools.isEmpty(result)) { return result; } @@ -267,15 +267,15 @@ public class GenericJavaXmlElementRef } - protected class XmlElementDeclRef - extends AbstractJavaSchemaComponentRef { + protected class XmlElementRefQName + extends AbstractJavaQName { - protected XmlElementDeclRef(JavaContextNode parent) { + protected XmlElementRefQName(JavaContextNode parent) { super(parent); } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { return GenericJavaXmlElementRef.this.getAnnotation(); } @@ -311,7 +311,7 @@ public class GenericJavaXmlElementRef @Override public String getDefaultNamespace() { return (GenericJavaXmlElementRef.this.getJaxbPackage().getElementFormDefault() == XmlNsForm.QUALIFIED) ? - GenericJavaXmlElementRef.this.getPersistentClass().getSchemaTypeRef().getNamespace() : ""; + GenericJavaXmlElementRef.this.getPersistentClass().getQName().getNamespace() : ""; } @Override @@ -321,7 +321,7 @@ public class GenericJavaXmlElementRef } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { // TODO // XsdTypeDefinition xsdType = GenericJavaXmlElementRef.this.getPersistentClass().getXsdTypeDefinition(); diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java index 278da25cfc..2e889042bc 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementWrapper.java @@ -18,14 +18,14 @@ import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlElementWrapper; import org.eclipse.jpt.jaxb.core.context.XmlNsForm; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; @@ -39,7 +39,7 @@ public class GenericJavaXmlElementWrapper protected final XmlElementWrapperAnnotation annotation; - protected JaxbSchemaComponentRef schemaComponentRef; + protected JaxbQName qName; protected Boolean specifiedRequired; @@ -49,14 +49,14 @@ public class GenericJavaXmlElementWrapper public GenericJavaXmlElementWrapper(JaxbAttributeMapping parent, XmlElementWrapperAnnotation annotation) { super(parent); this.annotation = annotation; - this.schemaComponentRef = buildSchemaComponentRef(); + this.qName = buildQName(); this.specifiedRequired = buildSpecifiedRequired(); this.specifiedNillable = this.buildSpecifiedNillable(); } - protected JaxbSchemaComponentRef buildSchemaComponentRef() { - return new XmlElementSchemaComponentRef(this); + protected JaxbQName buildQName() { + return new XmlElementQName(this); } @Override @@ -82,7 +82,7 @@ public class GenericJavaXmlElementWrapper @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaComponentRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); setSpecifiedRequired_(buildSpecifiedRequired()); this.setSpecifiedNillable_(this.buildSpecifiedNillable()); } @@ -90,14 +90,14 @@ public class GenericJavaXmlElementWrapper @Override public void update() { super.update(); - this.schemaComponentRef.update(); + this.qName.update(); } // ***** schema component ref ***** - public JaxbSchemaComponentRef getSchemaElementRef() { - return this.schemaComponentRef; + public JaxbQName getQName() { + return this.qName; } @@ -165,7 +165,7 @@ public class GenericJavaXmlElementWrapper public XsdElementDeclaration getXsdElementDeclaration() { XsdTypeDefinition xsdType = getPersistentAttribute().getPersistentClass().getXsdTypeDefinition(); - return (xsdType == null) ? null : xsdType.getElement(this.schemaComponentRef.getNamespace(), this.schemaComponentRef.getName()); + return (xsdType == null) ? null : xsdType.getElement(this.qName.getNamespace(), this.qName.getName()); } @@ -179,7 +179,7 @@ public class GenericJavaXmlElementWrapper return result; } - result = this.schemaComponentRef.getJavaCompletionProposals(pos, filter, astRoot); + result = this.qName.getJavaCompletionProposals(pos, filter, astRoot); if (! CollectionTools.isEmpty(result)) { return result; } @@ -209,16 +209,16 @@ public class GenericJavaXmlElementWrapper } - protected class XmlElementSchemaComponentRef - extends AbstractJavaSchemaComponentRef { + protected class XmlElementQName + extends AbstractJavaQName { - protected XmlElementSchemaComponentRef(JavaContextNode parent) { + protected XmlElementQName(JavaContextNode parent) { super(parent); } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { // never null return GenericJavaXmlElementWrapper.this.annotation; } @@ -231,7 +231,7 @@ public class GenericJavaXmlElementWrapper @Override public String getDefaultNamespace() { return (GenericJavaXmlElementWrapper.this.getPersistentClass().getJaxbPackage().getElementFormDefault() == XmlNsForm.QUALIFIED) ? - GenericJavaXmlElementWrapper.this.getPersistentClass().getSchemaTypeRef().getNamespace() : ""; + GenericJavaXmlElementWrapper.this.getPersistentClass().getQName().getNamespace() : ""; } @Override @@ -247,12 +247,12 @@ public class GenericJavaXmlElementWrapper } @Override - public String getSchemaComponentTypeDescription() { + public String getReferencedComponentTypeDescription() { return JptJaxbCoreMessages.XML_ELEMENT_DESC; } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { XsdTypeDefinition type = getPersistentClass().getXsdTypeDefinition(); if (type == null) { return; diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java index 65161e0a1b..77edcb25c9 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementsMapping.java @@ -385,9 +385,9 @@ public class GenericJavaXmlElementsMapping if (! StringTools.stringIsEmpty(typeName)) { xmlElementTypes.add(typeName); } - String elementName = xmlElement.getSchemaElementRef().getName(); + String elementName = xmlElement.getQName().getName(); if (! StringTools.stringIsEmpty(elementName)) { - xmlElementQnames.add(new QName(xmlElement.getSchemaElementRef().getNamespace(), elementName)); + xmlElementQnames.add(new QName(xmlElement.getQName().getNamespace(), elementName)); } } @@ -403,8 +403,8 @@ public class GenericJavaXmlElementsMapping xmlElement.getTypeTextRange(astRoot))); } - String xmlElementNamespace = xmlElement.getSchemaElementRef().getNamespace(); - String xmlElementName = xmlElement.getSchemaElementRef().getName(); + String xmlElementNamespace = xmlElement.getQName().getNamespace(); + String xmlElementName = xmlElement.getQName().getName(); if (xmlElementQnames.count(new QName(xmlElementNamespace, xmlElementName)) > 1) { messages.add( DefaultValidationMessages.buildMessage( @@ -412,7 +412,7 @@ public class GenericJavaXmlElementsMapping JaxbValidationMessages.XML_ELEMENTS__DUPLICATE_XML_ELEMENT_QNAME, new String[] { xmlElementName }, xmlElement, - xmlElement.getSchemaElementRef().getNameTextRange(astRoot))); + xmlElement.getQName().getNameTextRange(astRoot))); } } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java index ed032ad335..e8683ce416 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlRootElement.java @@ -17,13 +17,13 @@ import org.eclipse.jpt.common.utility.Filter; import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentType; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlRootElement; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdElementDeclaration; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; @@ -37,18 +37,18 @@ public class GenericJavaXmlRootElement protected final XmlRootElementAnnotation annotation; - protected JaxbSchemaComponentRef schemaElementRef; + protected JaxbQName qName; public GenericJavaXmlRootElement(JaxbPersistentType parent, XmlRootElementAnnotation resourceXmlRootElementAnnotation) { super(parent); this.annotation = resourceXmlRootElementAnnotation; - this.schemaElementRef = buildSchemaElementRef(); + this.qName = buildQName(); } - protected JaxbSchemaComponentRef buildSchemaElementRef() { - return new XmlRootElementSchemaElementRef(this); + protected JaxbQName buildQName() { + return new XmlRootElementQName(this); } public JaxbPersistentType getPersistentType() { @@ -61,20 +61,20 @@ public class GenericJavaXmlRootElement @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaElementRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); } @Override public void update() { super.update(); - this.schemaElementRef.update(); + this.qName.update(); } // ***** schema element ref ***** - public JaxbSchemaComponentRef getSchemaElementRef() { - return this.schemaElementRef; + public JaxbQName getQName() { + return this.qName; } @@ -87,7 +87,7 @@ public class GenericJavaXmlRootElement return result; } - result = this.schemaElementRef.getJavaCompletionProposals(pos, filter, astRoot); + result = this.qName.getJavaCompletionProposals(pos, filter, astRoot); if (! CollectionTools.isEmpty(result)) { return result; } @@ -107,7 +107,7 @@ public class GenericJavaXmlRootElement public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { super.validate(messages, reporter, astRoot); - this.schemaElementRef.validate(messages, reporter, astRoot); + this.qName.validate(messages, reporter, astRoot); } @@ -116,20 +116,20 @@ public class GenericJavaXmlRootElement @Override public void toString(StringBuilder sb) { super.toString(sb); - sb.append(this.schemaElementRef.toString()); + sb.append(this.qName.toString()); } - protected class XmlRootElementSchemaElementRef - extends AbstractJavaSchemaComponentRef { + protected class XmlRootElementQName + extends AbstractJavaQName { - protected XmlRootElementSchemaElementRef(JavaContextNode parent) { + protected XmlRootElementQName(JavaContextNode parent) { super(parent); } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { // never null return GenericJavaXmlRootElement.this.annotation; } @@ -163,12 +163,12 @@ public class GenericJavaXmlRootElement } @Override - public String getSchemaComponentTypeDescription() { + public String getReferencedComponentTypeDescription() { return JptJaxbCoreMessages.XML_ELEMENT_DESC; } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { String name = getName(); String namespace = getNamespace(); XsdSchema schema = GenericJavaXmlRootElement.this.getPersistentType().getJaxbPackage().getXsdSchema(); 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 e2e667ee78..c67779124b 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 @@ -18,11 +18,11 @@ import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.jaxb.core.context.JaxbContextNode; import org.eclipse.jpt.jaxb.core.context.JaxbPackage; -import org.eclipse.jpt.jaxb.core.context.JaxbSchemaComponentRef; +import org.eclipse.jpt.jaxb.core.context.JaxbQName; import org.eclipse.jpt.jaxb.core.context.XmlSchemaType; import org.eclipse.jpt.jaxb.core.context.java.JavaContextNode; import org.eclipse.jpt.jaxb.core.internal.JptJaxbCoreMessages; -import org.eclipse.jpt.jaxb.core.resource.java.SchemaComponentRefAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; import org.eclipse.jpt.jaxb.core.xsd.XsdTypeDefinition; @@ -35,7 +35,7 @@ public abstract class GenericJavaXmlSchemaType protected final XmlSchemaTypeAnnotation annotation; - protected JaxbSchemaComponentRef schemaTypeRef; + protected JaxbQName qName; protected String type; @@ -43,17 +43,17 @@ public abstract class GenericJavaXmlSchemaType protected GenericJavaXmlSchemaType(JaxbContextNode parent, XmlSchemaTypeAnnotation annotation) { super(parent); this.annotation = annotation; - this.schemaTypeRef = buildSchemaTypeRef(); + this.qName = buildQName(); this.type = this.getResourceTypeString(); } - protected JaxbSchemaComponentRef buildSchemaTypeRef() { - return new XmlSchemaTypeRef(this); + protected JaxbQName buildQName() { + return new XmlSchemaTypeQName(this); } - public JaxbSchemaComponentRef getSchemaTypeRef() { - return this.schemaTypeRef; + public JaxbQName getQName() { + return this.qName; } public XmlSchemaTypeAnnotation getXmlSchemaTypeAnnotation() { @@ -68,14 +68,14 @@ public abstract class GenericJavaXmlSchemaType @Override public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); - this.schemaTypeRef.synchronizeWithResourceModel(); + this.qName.synchronizeWithResourceModel(); this.setType_(this.getResourceTypeString()); } @Override public void update() { super.update(); - this.schemaTypeRef.update(); + this.qName.update(); } @@ -110,7 +110,7 @@ public abstract class GenericJavaXmlSchemaType return result; } - result = this.schemaTypeRef.getJavaCompletionProposals(pos, filter, astRoot); + result = this.qName.getJavaCompletionProposals(pos, filter, astRoot); if (! CollectionTools.isEmpty(result)) { return result; } @@ -130,26 +130,26 @@ public abstract class GenericJavaXmlSchemaType public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { super.validate(messages, reporter, astRoot); - this.schemaTypeRef.validate(messages, reporter, astRoot); + this.qName.validate(messages, reporter, astRoot); } - protected class XmlSchemaTypeRef - extends AbstractJavaSchemaComponentRef { + protected class XmlSchemaTypeQName + extends AbstractJavaQName { - protected XmlSchemaTypeRef(JavaContextNode parent) { + protected XmlSchemaTypeQName(JavaContextNode parent) { super(parent); } @Override - protected SchemaComponentRefAnnotation getAnnotation(boolean createIfNull) { + protected QNameAnnotation getAnnotation(boolean createIfNull) { // never null return GenericJavaXmlSchemaType.this.annotation; } @Override - protected String getSchemaComponentTypeDescription() { + protected String getReferencedComponentTypeDescription() { return JptJaxbCoreMessages.XML_TYPE_DESC; } @@ -182,7 +182,7 @@ public abstract class GenericJavaXmlSchemaType } @Override - protected void validateSchemaComponentRef(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + protected void validateReference(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { String name = getName(); String namespace = getNamespace(); diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java index fcf0f105d5..d3d1ae59ef 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/validation/JaxbValidationMessages.java @@ -62,6 +62,6 @@ public interface JaxbValidationMessages { // general validation - String SCHEMA_COMPONENT_REF__MISSING_NAME = "SCHEMA_COMPONENT_REF__MISSING_NAME"; - String SCHEMA_COMPONENT_REF__UNRESOLVED_COMPONENT = "SCHEMA_COMPONENT_REF__UNRESOLVED_COMPONENT"; + String QNAME__MISSING_NAME = "QNAME__MISSING_NAME"; + String QNAME__UNRESOLVED_COMPONENT = "QNAME__UNRESOLVED_COMPONENT"; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java index f3e6af57d0..5dd3b0d7de 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JaxbBasicSchemaComponentAnnotation.java @@ -25,7 +25,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface JaxbBasicSchemaComponentAnnotation - extends SchemaComponentRefAnnotation { + extends QNameAnnotation { /** * Corresponds to the 'required' element of the XmlAttribute annotation. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/SchemaComponentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java index 144e135f5a..d87da74fbe 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/SchemaComponentRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/QNameAnnotation.java @@ -25,7 +25,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @version 3.? * @since 3.? */ -public interface SchemaComponentRefAnnotation +public interface QNameAnnotation extends Annotation { /** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java index 031c1afa2d..403d4dbd24 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java @@ -27,7 +27,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlElementRefAnnotation - extends SchemaComponentRefAnnotation, NestableAnnotation { + extends QNameAnnotation, NestableAnnotation { String ANNOTATION_NAME = JAXB.XML_ELEMENT_REF; diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java index 506f19fd17..2b7e419a5d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java @@ -26,7 +26,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlElementWrapperAnnotation - extends SchemaComponentRefAnnotation { + extends QNameAnnotation { String ANNOTATION_NAME = JAXB.XML_ELEMENT_WRAPPER; diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java index 30732da084..e2b6e77992 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java @@ -24,7 +24,7 @@ package org.eclipse.jpt.jaxb.core.resource.java; * @since 3.0 */ public interface XmlRootElementAnnotation - extends SchemaComponentRefAnnotation { + extends QNameAnnotation { String ANNOTATION_NAME = JAXB.XML_ROOT_ELEMENT; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java index 8a287a405a..b395b0608b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java @@ -27,7 +27,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlSchemaTypeAnnotation - extends SchemaComponentRefAnnotation, NestableAnnotation { + extends QNameAnnotation, NestableAnnotation { String ANNOTATION_NAME = JAXB.XML_SCHEMA_TYPE; /** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java index 1736e8da7d..944e93c9ed 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java @@ -27,7 +27,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; * @since 3.0 */ public interface XmlTypeAnnotation - extends SchemaComponentRefAnnotation { + extends QNameAnnotation { String ANNOTATION_NAME = JAXB.XML_TYPE; diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java index 106a3bf80e..7e6634b112 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageInfoTests.java @@ -215,8 +215,8 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes(); ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); } @@ -256,9 +256,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("bar"); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("foo"); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("baz"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("foo"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("baz"); Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage); @@ -279,9 +279,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("bar"); - contextPackageInfo.addXmlSchemaType(1).getSchemaTypeRef().setSpecifiedName("foo"); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("baz"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar"); + contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("baz"); Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage); @@ -296,9 +296,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("bar"); - contextPackageInfo.addXmlSchemaType(1).getSchemaTypeRef().setSpecifiedName("foo"); - contextPackageInfo.addXmlSchemaType(2).getSchemaTypeRef().setSpecifiedName("baz"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar"); + contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo"); + contextPackageInfo.addXmlSchemaType(2).getQName().setSpecifiedName("baz"); Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage); assertEquals("bar", xmlSchemaTypes.next().getName()); @@ -328,9 +328,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase JaxbPackageInfo contextPackageInfo = CollectionTools.get(getContextRoot().getPackages(), 0).getPackageInfo(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - contextPackageInfo.addXmlSchemaType(0).getSchemaTypeRef().setSpecifiedName("bar"); - contextPackageInfo.addXmlSchemaType(1).getSchemaTypeRef().setSpecifiedName("foo"); - contextPackageInfo.addXmlSchemaType(2).getSchemaTypeRef().setSpecifiedName("baz"); + contextPackageInfo.addXmlSchemaType(0).getQName().setSpecifiedName("bar"); + contextPackageInfo.addXmlSchemaType(1).getQName().setSpecifiedName("foo"); + contextPackageInfo.addXmlSchemaType(2).getQName().setSpecifiedName("baz"); Iterator<XmlSchemaTypeAnnotation> xmlSchemaTypes = this.getSchemaTypeAnnotations(resourcePackage); assertEquals("bar", xmlSchemaTypes.next().getName()); @@ -374,9 +374,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes(); ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); @@ -388,9 +388,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); @@ -402,9 +402,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); @@ -416,8 +416,8 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); @@ -429,7 +429,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); @@ -462,7 +462,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes(); ListIterator<XmlSchemaType> xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); @@ -476,8 +476,8 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes(); xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); //add 1 XmlSchemaType when a container annotations exists @@ -490,9 +490,9 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes(); xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); //add 1 XmlSchemaType to beginning of list when a container annotations exists @@ -505,10 +505,10 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase xmlSchemaTypes = contextPackageInfo.getXmlSchemaTypes(); xmlSchemaTypesIterator = xmlSchemaTypes.iterator(); assertTrue(xmlSchemaTypesIterator.hasNext()); - assertEquals("foobaz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("bar", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("foo", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); - assertEquals("baz", xmlSchemaTypesIterator.next().getSchemaTypeRef().getName()); + assertEquals("foobaz", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("bar", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("foo", xmlSchemaTypesIterator.next().getQName().getName()); + assertEquals("baz", xmlSchemaTypesIterator.next().getQName().getName()); assertFalse(xmlSchemaTypesIterator.hasNext()); } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentClassTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentClassTests.java index 94aff3c27f..73bb001a97 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentClassTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentClassTests.java @@ -383,32 +383,32 @@ public class GenericJavaPersistentClassTests JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, persistentClass.getSchemaTypeRef().getDefaultName()); - assertEquals(defaultXmlTypeName, persistentClass.getSchemaTypeRef().getName()); + assertNull(persistentClass.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, persistentClass.getQName().getDefaultName()); + assertEquals(defaultXmlTypeName, persistentClass.getQName().getName()); - persistentClass.getSchemaTypeRef().setSpecifiedName("foo"); + persistentClass.getQName().setSpecifiedName("foo"); XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getName()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getName()); + assertEquals("foo", persistentClass.getQName().getSpecifiedName()); + assertEquals("foo", persistentClass.getQName().getName()); - persistentClass.getSchemaTypeRef().setSpecifiedName(null); + persistentClass.getQName().setSpecifiedName(null); xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertNull(xmlTypeAnnotation.getName()); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, persistentClass.getSchemaTypeRef().getName()); + assertNull(persistentClass.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, persistentClass.getQName().getName()); //add another annotation so that the context model does not get blown away persistentClass.setSpecifiedAccessType(XmlAccessType.FIELD); resourceType.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); //set name again, this time starting with no XmlType annotation - persistentClass.getSchemaTypeRef().setSpecifiedName("foo"); + persistentClass.getQName().setSpecifiedName("foo"); xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getName()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getName()); + assertEquals("foo", persistentClass.getQName().getSpecifiedName()); + assertEquals("foo", persistentClass.getQName().getName()); } public void testUpdateSchemaTypeName() throws Exception { @@ -418,9 +418,9 @@ public class GenericJavaPersistentClassTests JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, persistentClass.getSchemaTypeRef().getDefaultName()); - assertEquals(defaultXmlTypeName, persistentClass.getSchemaTypeRef().getName()); + assertNull(persistentClass.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, persistentClass.getQName().getDefaultName()); + assertEquals(defaultXmlTypeName, persistentClass.getQName().getName()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourceType); @@ -429,8 +429,8 @@ public class GenericJavaPersistentClassTests GenericJavaPersistentClassTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAME, "foo"); } }); - assertEquals("foo", persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getName()); + assertEquals("foo", persistentClass.getQName().getSpecifiedName()); + assertEquals("foo", persistentClass.getQName().getName()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -439,8 +439,8 @@ public class GenericJavaPersistentClassTests GenericJavaPersistentClassTests.this.values(xmlTypeAnnotation).remove(0); } }); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, persistentClass.getSchemaTypeRef().getName()); + assertNull(persistentClass.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, persistentClass.getQName().getName()); } public void testModifyNamespace() throws Exception { @@ -449,32 +449,32 @@ public class GenericJavaPersistentClassTests JaxbPersistentClass persistentClass = CollectionTools.get(getContextRoot().getPersistentClasses(), 0); JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", persistentClass.getSchemaTypeRef().getDefaultNamespace()); - assertEquals("", persistentClass.getSchemaTypeRef().getNamespace()); + assertNull(persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("", persistentClass.getQName().getDefaultNamespace()); + assertEquals("", persistentClass.getQName().getNamespace()); - persistentClass.getSchemaTypeRef().setSpecifiedNamespace("foo"); + persistentClass.getQName().setSpecifiedNamespace("foo"); XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getNamespace()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getNamespace()); + assertEquals("foo", persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("foo", persistentClass.getQName().getNamespace()); - persistentClass.getSchemaTypeRef().setSpecifiedNamespace(null); + persistentClass.getQName().setSpecifiedNamespace(null); xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertNull(xmlTypeAnnotation.getNamespace()); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", persistentClass.getSchemaTypeRef().getNamespace()); + assertNull(persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("", persistentClass.getQName().getNamespace()); //add another annotation so that the context model does not get blown away persistentClass.setSpecifiedAccessType(XmlAccessType.FIELD); resourceType.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); //set namespace again, this time starting with no XmlType annotation - persistentClass.getSchemaTypeRef().setSpecifiedNamespace("foo"); + persistentClass.getQName().setSpecifiedNamespace("foo"); xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getNamespace()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getNamespace()); + assertEquals("foo", persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("foo", persistentClass.getQName().getNamespace()); } public void testUpdateNamespace() throws Exception { @@ -483,9 +483,9 @@ public class GenericJavaPersistentClassTests JaxbPersistentClass persistentClass = CollectionTools.get(getContextRoot().getPersistentClasses(), 0); JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", persistentClass.getSchemaTypeRef().getDefaultNamespace()); - assertEquals("", persistentClass.getSchemaTypeRef().getNamespace()); + assertNull(persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("", persistentClass.getQName().getDefaultNamespace()); + assertEquals("", persistentClass.getQName().getNamespace()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourceType); @@ -494,8 +494,8 @@ public class GenericJavaPersistentClassTests GenericJavaPersistentClassTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAMESPACE, "foo"); } }); - assertEquals("foo", persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", persistentClass.getSchemaTypeRef().getNamespace()); + assertEquals("foo", persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("foo", persistentClass.getQName().getNamespace()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -504,8 +504,8 @@ public class GenericJavaPersistentClassTests GenericJavaPersistentClassTests.this.values(xmlTypeAnnotation).remove(0); } }); - assertNull(persistentClass.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", persistentClass.getSchemaTypeRef().getNamespace()); + assertNull(persistentClass.getQName().getSpecifiedNamespace()); + assertEquals("", persistentClass.getQName().getNamespace()); } public void testModifyAccessType() throws Exception { @@ -956,7 +956,7 @@ public class GenericJavaPersistentClassTests persistentClass.setRootElement("foo"); XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlRootElementAnnotation.getName()); - assertEquals("foo", persistentClass.getRootElement().getSchemaElementRef().getName()); + assertEquals("foo", persistentClass.getRootElement().getQName().getName()); assertTrue(persistentClass.isRootElement()); persistentClass.setRootElement(null); @@ -984,7 +984,7 @@ public class GenericJavaPersistentClassTests GenericJavaPersistentClassTests.this.addMemberValuePair(annotation, JAXB.XML_ROOT_ELEMENT__NAME, "foo"); } }); - assertEquals("foo", persistentClass.getRootElement().getSchemaElementRef().getName()); + assertEquals("foo", persistentClass.getRootElement().getQName().getName()); assertTrue(persistentClass.isRootElement()); //remove the XmlRootElement annotation 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 a6909a1e23..618fafe311 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 @@ -167,30 +167,30 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase JavaResourceEnum resourceEnum = contextEnum.getJavaResourceType(); String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, contextEnum.getSchemaTypeRef().getDefaultName()); - assertEquals(defaultXmlTypeName, contextEnum.getSchemaTypeRef().getName()); + assertNull(contextEnum.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, contextEnum.getQName().getDefaultName()); + assertEquals(defaultXmlTypeName, contextEnum.getQName().getName()); - contextEnum.getSchemaTypeRef().setSpecifiedName("foo"); + contextEnum.getQName().setSpecifiedName("foo"); XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getName()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getName()); + assertEquals("foo", contextEnum.getQName().getSpecifiedName()); + assertEquals("foo", contextEnum.getQName().getName()); - contextEnum.getSchemaTypeRef().setSpecifiedName(null); + contextEnum.getQName().setSpecifiedName(null); xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertNull(xmlTypeAnnotation.getName()); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, contextEnum.getSchemaTypeRef().getName()); + assertNull(contextEnum.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, contextEnum.getQName().getName()); resourceEnum.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); //set name again, this time starting with no XmlType annotation - contextEnum.getSchemaTypeRef().setSpecifiedName("foo"); + contextEnum.getQName().setSpecifiedName("foo"); xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getName()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getName()); + assertEquals("foo", contextEnum.getQName().getSpecifiedName()); + assertEquals("foo", contextEnum.getQName().getName()); } public void testUpdateSchemaTypeName() throws Exception { @@ -200,9 +200,9 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase JavaResourceEnum resourceEnum = contextEnum.getJavaResourceType(); String defaultXmlTypeName = Introspector.decapitalize(TYPE_NAME); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, contextEnum.getSchemaTypeRef().getDefaultName()); - assertEquals(defaultXmlTypeName, contextEnum.getSchemaTypeRef().getName()); + assertNull(contextEnum.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, contextEnum.getQName().getDefaultName()); + assertEquals(defaultXmlTypeName, contextEnum.getQName().getName()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum); @@ -212,8 +212,8 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase GenericJavaPersistentEnumTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAME, "foo"); } }); - assertEquals("foo", contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getName()); + assertEquals("foo", contextEnum.getQName().getSpecifiedName()); + assertEquals("foo", contextEnum.getQName().getName()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -222,8 +222,8 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase GenericJavaPersistentEnumTests.this.values(xmlTypeAnnotation).remove(0); } }); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedName()); - assertEquals(defaultXmlTypeName, contextEnum.getSchemaTypeRef().getName()); + assertNull(contextEnum.getQName().getSpecifiedName()); + assertEquals(defaultXmlTypeName, contextEnum.getQName().getName()); } public void testModifyNamespace() throws Exception { @@ -232,30 +232,30 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase JaxbPersistentEnum contextEnum = CollectionTools.get(getContextRoot().getPersistentEnums(), 0); JavaResourceEnum resourceEnum = contextEnum.getJavaResourceType(); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", contextEnum.getSchemaTypeRef().getDefaultNamespace()); - assertEquals("", contextEnum.getSchemaTypeRef().getNamespace()); + assertNull(contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("", contextEnum.getQName().getDefaultNamespace()); + assertEquals("", contextEnum.getQName().getNamespace()); - contextEnum.getSchemaTypeRef().setSpecifiedNamespace("foo"); + contextEnum.getQName().setSpecifiedNamespace("foo"); XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getNamespace()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getNamespace()); + assertEquals("foo", contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextEnum.getQName().getNamespace()); - contextEnum.getSchemaTypeRef().setSpecifiedNamespace(null); + contextEnum.getQName().setSpecifiedNamespace(null); xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertNull(xmlTypeAnnotation.getNamespace()); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", contextEnum.getSchemaTypeRef().getNamespace()); + assertNull(contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("", contextEnum.getQName().getNamespace()); resourceEnum.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); //set namespace again, this time starting with no XmlType annotation - contextEnum.getSchemaTypeRef().setSpecifiedNamespace("foo"); + contextEnum.getQName().setSpecifiedNamespace("foo"); xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlTypeAnnotation.getNamespace()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getNamespace()); + assertEquals("foo", contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextEnum.getQName().getNamespace()); } public void testUpdateNamespace() throws Exception { @@ -264,9 +264,9 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase JaxbPersistentEnum contextEnum = CollectionTools.get(getContextRoot().getPersistentEnums(), 0); JavaResourceEnum resourceEnum = contextEnum.getJavaResourceType(); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", contextEnum.getSchemaTypeRef().getDefaultNamespace()); - assertEquals("", contextEnum.getSchemaTypeRef().getNamespace()); + assertNull(contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("", contextEnum.getQName().getDefaultNamespace()); + assertEquals("", contextEnum.getQName().getNamespace()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourceEnum); @@ -276,8 +276,8 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase GenericJavaPersistentEnumTests.this.addXmlTypeMemberValuePair(declaration, JAXB.XML_TYPE__NAMESPACE, "foo"); } }); - assertEquals("foo", contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", contextEnum.getSchemaTypeRef().getNamespace()); + assertEquals("foo", contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextEnum.getQName().getNamespace()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -286,8 +286,8 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase GenericJavaPersistentEnumTests.this.values(xmlTypeAnnotation).remove(0); } }); - assertNull(contextEnum.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("", contextEnum.getSchemaTypeRef().getNamespace()); + assertNull(contextEnum.getQName().getSpecifiedNamespace()); + assertEquals("", contextEnum.getQName().getNamespace()); } public void testGetPropOrder() throws Exception { @@ -573,7 +573,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase contextEnum.setRootElement("foo"); XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlRootElementAnnotation.getName()); - assertEquals("foo", contextEnum.getRootElement().getSchemaElementRef().getName()); + assertEquals("foo", contextEnum.getRootElement().getQName().getName()); assertTrue(contextEnum.isRootElement()); contextEnum.setRootElement(null); @@ -601,7 +601,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase GenericJavaPersistentEnumTests.this.addMemberValuePair(annotation, JAXB.XML_ROOT_ELEMENT__NAME, "foo"); } }); - assertEquals("foo", contextEnum.getRootElement().getSchemaElementRef().getName()); + assertEquals("foo", contextEnum.getRootElement().getQName().getName()); assertTrue(contextEnum.isRootElement()); //remove the XmlRootElement annotation diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java index 206db4d8a2..ec13d08334 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAttributeMappingTests.java @@ -69,21 +69,21 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) CollectionTools.get(persistentClass.getAttributes(), 0).getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedName()); - assertEquals("id", xmlAttributeMapping.getSchemaComponentRef().getDefaultName()); - assertEquals("id", xmlAttributeMapping.getSchemaComponentRef().getName()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedName()); + assertEquals("id", xmlAttributeMapping.getQName().getDefaultName()); + assertEquals("id", xmlAttributeMapping.getQName().getName()); - xmlAttributeMapping.getSchemaComponentRef().setSpecifiedName("foo"); + xmlAttributeMapping.getQName().setSpecifiedName("foo"); XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlAttributeAnnotation.getName()); - assertEquals("foo", xmlAttributeMapping.getSchemaComponentRef().getSpecifiedName()); - assertEquals("id", xmlAttributeMapping.getSchemaComponentRef().getDefaultName()); - assertEquals("foo", xmlAttributeMapping.getSchemaComponentRef().getName()); + assertEquals("foo", xmlAttributeMapping.getQName().getSpecifiedName()); + assertEquals("id", xmlAttributeMapping.getQName().getDefaultName()); + assertEquals("foo", xmlAttributeMapping.getQName().getName()); - xmlAttributeMapping.getSchemaComponentRef().setSpecifiedName(null); + xmlAttributeMapping.getQName().setSpecifiedName(null); xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); assertNull(xmlAttributeAnnotation.getName()); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedName()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedName()); } public void testUpdateName() throws Exception { @@ -93,7 +93,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) CollectionTools.get(persistentClass.getAttributes(), 0).getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedName()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedName()); //add a Name member value pair @@ -103,7 +103,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__NAME, "foo"); } }); - assertEquals("foo", xmlAttributeMapping.getSchemaComponentRef().getName()); + assertEquals("foo", xmlAttributeMapping.getQName().getName()); //remove the Name member value pair annotatedElement.edit(new Member.Editor() { @@ -112,7 +112,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0); } }); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedName()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedName()); } public void testModifyNamespace() throws Exception { @@ -122,17 +122,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) CollectionTools.get(persistentClass.getAttributes(), 0).getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedNamespace()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace()); - xmlAttributeMapping.getSchemaComponentRef().setSpecifiedNamespace("foo"); + xmlAttributeMapping.getQName().setSpecifiedNamespace("foo"); XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlAttributeAnnotation.getNamespace()); - assertEquals("foo", xmlAttributeMapping.getSchemaComponentRef().getNamespace()); + assertEquals("foo", xmlAttributeMapping.getQName().getNamespace()); - xmlAttributeMapping.getSchemaComponentRef().setSpecifiedNamespace(null); + xmlAttributeMapping.getQName().setSpecifiedNamespace(null); xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); assertNull(xmlAttributeAnnotation.getNamespace()); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedNamespace()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace()); } public void testUpdateNamespace() throws Exception { @@ -142,7 +142,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) CollectionTools.get(persistentClass.getAttributes(), 0).getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedNamespace()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace()); //add a namespace member value pair @@ -152,7 +152,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas GenericJavaXmlAttributeMappingTests.this.addXmlAttributeMemberValuePair(declaration, JAXB.XML_ATTRIBUTE__NAMESPACE, "foo"); } }); - assertEquals("foo", xmlAttributeMapping.getSchemaComponentRef().getNamespace()); + assertEquals("foo", xmlAttributeMapping.getQName().getNamespace()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -161,7 +161,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas GenericJavaXmlAttributeMappingTests.this.values(xmlAttributeAnnotation).remove(0); } }); - assertNull(xmlAttributeMapping.getSchemaComponentRef().getSpecifiedNamespace()); + assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace()); } public void testModifyRequired() throws Exception { diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java index b8f687588e..14248a1788 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementMappingTests.java @@ -92,21 +92,21 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElement xmlElement = xmlElementMapping.getXmlElement(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedName()); - assertEquals("id", xmlElement.getSchemaElementRef().getDefaultName()); - assertEquals("id", xmlElement.getSchemaElementRef().getName()); + assertNull(xmlElement.getQName().getSpecifiedName()); + assertEquals("id", xmlElement.getQName().getDefaultName()); + assertEquals("id", xmlElement.getQName().getName()); - xmlElement.getSchemaElementRef().setSpecifiedName("foo"); + xmlElement.getQName().setSpecifiedName("foo"); XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlElementAnnotation.getName()); - assertEquals("foo", xmlElement.getSchemaElementRef().getSpecifiedName()); - assertEquals("id", xmlElement.getSchemaElementRef().getDefaultName()); - assertEquals("foo", xmlElement.getSchemaElementRef().getName()); + assertEquals("foo", xmlElement.getQName().getSpecifiedName()); + assertEquals("id", xmlElement.getQName().getDefaultName()); + assertEquals("foo", xmlElement.getQName().getName()); - xmlElement.getSchemaElementRef().setSpecifiedName(null); + xmlElement.getQName().setSpecifiedName(null); xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); assertNull(xmlElementAnnotation.getName()); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedName()); + assertNull(xmlElement.getQName().getSpecifiedName()); } public void testUpdateName() throws Exception { @@ -117,7 +117,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElement xmlElement = xmlElementMapping.getXmlElement(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedName()); + assertNull(xmlElement.getQName().getSpecifiedName()); //add a Name member value pair @@ -127,7 +127,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NAME, "foo"); } }); - assertEquals("foo", xmlElement.getSchemaElementRef().getName()); + assertEquals("foo", xmlElement.getQName().getName()); //remove the Name member value pair annotatedElement.edit(new Member.Editor() { @@ -136,7 +136,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0); } }); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedName()); + assertNull(xmlElement.getQName().getSpecifiedName()); } public void testModifyNamespace() throws Exception { @@ -147,17 +147,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElement xmlElement = xmlElementMapping.getXmlElement(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElement.getQName().getSpecifiedNamespace()); - xmlElement.getSchemaElementRef().setSpecifiedNamespace("foo"); + xmlElement.getQName().setSpecifiedNamespace("foo"); XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlElementAnnotation.getNamespace()); - assertEquals("foo", xmlElement.getSchemaElementRef().getNamespace()); + assertEquals("foo", xmlElement.getQName().getNamespace()); - xmlElement.getSchemaElementRef().setSpecifiedNamespace(null); + xmlElement.getQName().setSpecifiedNamespace(null); xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); assertNull(xmlElementAnnotation.getNamespace()); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElement.getQName().getSpecifiedNamespace()); } public void testUpdateNamespace() throws Exception { @@ -168,7 +168,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElement xmlElement = xmlElementMapping.getXmlElement(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElement.getQName().getSpecifiedNamespace()); //add a namespace member value pair @@ -178,7 +178,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase GenericJavaXmlElementMappingTests.this.addXmlElementMemberValuePair(declaration, JAXB.XML_ELEMENT__NAMESPACE, "foo"); } }); - assertEquals("foo", xmlElement.getSchemaElementRef().getNamespace()); + assertEquals("foo", xmlElement.getQName().getNamespace()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -187,7 +187,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase GenericJavaXmlElementMappingTests.this.values(xmlElementAnnotation).remove(0); } }); - assertNull(xmlElement.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElement.getQName().getSpecifiedNamespace()); } public void testModifyRequired() throws Exception { diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java index 8263a1c7fe..54adc70729 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementRefMappingTests.java @@ -71,21 +71,21 @@ public class GenericJavaXmlElementRefMappingTests XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef(); JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedName()); - assertEquals("id", xmlElementRef.getSchemaElementRef().getDefaultName()); - assertEquals("id", xmlElementRef.getSchemaElementRef().getName()); + assertNull(xmlElementRef.getQName().getSpecifiedName()); + assertEquals("id", xmlElementRef.getQName().getDefaultName()); + assertEquals("id", xmlElementRef.getQName().getName()); - xmlElementRef.getSchemaElementRef().setSpecifiedName("foo"); + xmlElementRef.getQName().setSpecifiedName("foo"); XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlElementRefAnnotation.getName()); - assertEquals("foo", xmlElementRef.getSchemaElementRef().getSpecifiedName()); - assertEquals("id", xmlElementRef.getSchemaElementRef().getDefaultName()); - assertEquals("foo", xmlElementRef.getSchemaElementRef().getName()); + assertEquals("foo", xmlElementRef.getQName().getSpecifiedName()); + assertEquals("id", xmlElementRef.getQName().getDefaultName()); + assertEquals("foo", xmlElementRef.getQName().getName()); - xmlElementRef.getSchemaElementRef().setSpecifiedName(null); + xmlElementRef.getQName().setSpecifiedName(null); xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); assertNull(xmlElementRefAnnotation.getName()); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedName()); + assertNull(xmlElementRef.getQName().getSpecifiedName()); } public void testUpdateName() throws Exception { @@ -96,7 +96,7 @@ public class GenericJavaXmlElementRefMappingTests XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef(); JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedName()); + assertNull(xmlElementRef.getQName().getSpecifiedName()); //add a Name member value pair @@ -106,7 +106,7 @@ public class GenericJavaXmlElementRefMappingTests GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__NAME, "foo"); } }); - assertEquals("foo", xmlElementRef.getSchemaElementRef().getName()); + assertEquals("foo", xmlElementRef.getQName().getName()); //remove the Name member value pair annotatedElement.edit(new Member.Editor() { @@ -115,7 +115,7 @@ public class GenericJavaXmlElementRefMappingTests GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0); } }); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedName()); + assertNull(xmlElementRef.getQName().getSpecifiedName()); } public void testModifyNamespace() throws Exception { @@ -126,17 +126,17 @@ public class GenericJavaXmlElementRefMappingTests XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef(); JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElementRef.getQName().getSpecifiedNamespace()); - xmlElementRef.getSchemaElementRef().setSpecifiedNamespace("foo"); + xmlElementRef.getQName().setSpecifiedNamespace("foo"); XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); assertEquals("foo", xmlElementRefAnnotation.getNamespace()); - assertEquals("foo", xmlElementRef.getSchemaElementRef().getNamespace()); + assertEquals("foo", xmlElementRef.getQName().getNamespace()); - xmlElementRef.getSchemaElementRef().setSpecifiedNamespace(null); + xmlElementRef.getQName().setSpecifiedNamespace(null); xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); assertNull(xmlElementRefAnnotation.getNamespace()); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElementRef.getQName().getSpecifiedNamespace()); } public void testUpdateNamespace() throws Exception { @@ -147,7 +147,7 @@ public class GenericJavaXmlElementRefMappingTests XmlElementRef xmlElementRef = xmlElementRefMapping.getXmlElementRef(); JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElementRef.getQName().getSpecifiedNamespace()); //add a namespace member value pair @@ -157,7 +157,7 @@ public class GenericJavaXmlElementRefMappingTests GenericJavaXmlElementRefMappingTests.this.addXmlElementRefMemberValuePair(declaration, JAXB.XML_ELEMENT_REF__NAMESPACE, "foo"); } }); - assertEquals("foo", xmlElementRef.getSchemaElementRef().getNamespace()); + assertEquals("foo", xmlElementRef.getQName().getNamespace()); //remove the namespace member value pair annotatedElement.edit(new Member.Editor() { @@ -166,7 +166,7 @@ public class GenericJavaXmlElementRefMappingTests GenericJavaXmlElementRefMappingTests.this.values(xmlElementRefAnnotation).remove(0); } }); - assertNull(xmlElementRef.getSchemaElementRef().getSpecifiedNamespace()); + assertNull(xmlElementRef.getQName().getSpecifiedNamespace()); } public void testModifyRequired() throws Exception { diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java index 5492c306fd..a41c2a5ab9 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlElementsMappingTests.java @@ -107,8 +107,8 @@ public class GenericJavaXmlElementsMappingTests assertFalse(CollectionTools.isEmpty(mapping.getXmlElements())); assertEquals(2, mapping.getXmlElementsSize()); - assertEquals("foo", CollectionTools.get(xmlElements, 0).getSchemaElementRef().getName()); - assertEquals("bar", CollectionTools.get(xmlElements, 1).getSchemaElementRef().getName()); + assertEquals("foo", CollectionTools.get(xmlElements, 0).getQName().getName()); + assertEquals("bar", CollectionTools.get(xmlElements, 1).getQName().getName()); // switch XmlElement annotations annotatedElement.edit( @@ -123,8 +123,8 @@ public class GenericJavaXmlElementsMappingTests assertFalse(CollectionTools.isEmpty(mapping.getXmlElements())); assertEquals(2, mapping.getXmlElementsSize()); - assertEquals("bar", CollectionTools.get(xmlElements, 0).getSchemaElementRef().getName()); - assertEquals("foo", CollectionTools.get(xmlElements, 1).getSchemaElementRef().getName()); + assertEquals("bar", CollectionTools.get(xmlElements, 0).getQName().getName()); + assertEquals("foo", CollectionTools.get(xmlElements, 1).getQName().getName()); // remove XmlElement annotations annotatedElement.edit( @@ -154,9 +154,9 @@ public class GenericJavaXmlElementsMappingTests assertEquals(0, xmlElementsAnnotation.getXmlElementsSize()); assertEquals(0, mapping.getXmlElementsSize()); - mapping.addXmlElement(0).getSchemaElementRef().setSpecifiedName("foo"); - mapping.addXmlElement(1).getSchemaElementRef().setSpecifiedName("baz"); - mapping.addXmlElement(1).getSchemaElementRef().setSpecifiedName("bar"); + mapping.addXmlElement(0).getQName().setSpecifiedName("foo"); + mapping.addXmlElement(1).getQName().setSpecifiedName("baz"); + mapping.addXmlElement(1).getQName().setSpecifiedName("bar"); xmlElementAnnotations = xmlElementsAnnotation.getXmlElements(); diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java index 192dae92a1..7241dfd5ac 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlRootElementTests.java @@ -56,21 +56,21 @@ public class GenericJavaXmlRootElementTests XmlRootElement contextRootElement = persistentClass.getRootElement(); JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); - assertNull(contextRootElement.getSchemaElementRef().getSpecifiedNamespace()); - assertEquals("", contextRootElement.getSchemaElementRef().getDefaultNamespace()); - assertEquals("", contextRootElement.getSchemaElementRef().getNamespace()); + assertNull(contextRootElement.getQName().getSpecifiedNamespace()); + assertEquals("", contextRootElement.getQName().getDefaultNamespace()); + assertEquals("", contextRootElement.getQName().getNamespace()); - contextRootElement.getSchemaElementRef().setSpecifiedNamespace("foo"); + contextRootElement.getQName().setSpecifiedNamespace("foo"); XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); assertEquals("foo", rootElementAnnotation.getNamespace()); - assertEquals("foo", contextRootElement.getSchemaElementRef().getSpecifiedNamespace()); - assertEquals("foo", contextRootElement.getSchemaElementRef().getNamespace()); + assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextRootElement.getQName().getNamespace()); - contextRootElement.getSchemaElementRef().setSpecifiedNamespace(null); + contextRootElement.getQName().setSpecifiedNamespace(null); rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); assertNull(rootElementAnnotation.getNamespace()); - assertNull(contextRootElement.getSchemaElementRef().getSpecifiedNamespace()); - assertEquals("", contextRootElement.getSchemaElementRef().getNamespace()); + assertNull(contextRootElement.getQName().getSpecifiedNamespace()); + assertEquals("", contextRootElement.getQName().getNamespace()); } public void testUpdateNamespace() throws Exception { @@ -79,9 +79,9 @@ public class GenericJavaXmlRootElementTests XmlRootElement contextRootElement = persistentClass.getRootElement(); JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); - assertNull(contextRootElement.getSchemaElementRef().getSpecifiedNamespace()); - assertEquals("", contextRootElement.getSchemaElementRef().getDefaultNamespace()); - assertEquals("", contextRootElement.getSchemaElementRef().getNamespace()); + assertNull(contextRootElement.getQName().getSpecifiedNamespace()); + assertEquals("", contextRootElement.getQName().getDefaultNamespace()); + assertEquals("", contextRootElement.getQName().getNamespace()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourceType); @@ -90,8 +90,8 @@ public class GenericJavaXmlRootElementTests GenericJavaXmlRootElementTests.this.addXmlRootElementMemberValuePair(declaration, JAXB.XML_ROOT_ELEMENT__NAMESPACE, "foo"); } }); - assertEquals("foo", contextRootElement.getSchemaElementRef().getSpecifiedNamespace()); - assertEquals("foo", contextRootElement.getSchemaElementRef().getNamespace()); + assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextRootElement.getQName().getNamespace()); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { @@ -109,21 +109,21 @@ public class GenericJavaXmlRootElementTests JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); String defaultName = Introspector.decapitalize(TYPE_NAME); - assertNull(contextRootElement.getSchemaElementRef().getSpecifiedName()); - assertEquals(defaultName, contextRootElement.getSchemaElementRef().getDefaultName()); - assertEquals(defaultName, contextRootElement.getSchemaElementRef().getName()); + assertNull(contextRootElement.getQName().getSpecifiedName()); + assertEquals(defaultName, contextRootElement.getQName().getDefaultName()); + assertEquals(defaultName, contextRootElement.getQName().getName()); - contextRootElement.getSchemaElementRef().setSpecifiedName("foo"); + contextRootElement.getQName().setSpecifiedName("foo"); XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); assertEquals("foo", rootElementAnnotation.getName()); - assertEquals("foo", contextRootElement.getSchemaElementRef().getSpecifiedName()); - assertEquals("foo", contextRootElement.getSchemaElementRef().getName()); + assertEquals("foo", contextRootElement.getQName().getSpecifiedName()); + assertEquals("foo", contextRootElement.getQName().getName()); - contextRootElement.getSchemaElementRef().setSpecifiedName(null); + contextRootElement.getQName().setSpecifiedName(null); rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); assertNull(rootElementAnnotation.getName()); - assertNull(contextRootElement.getSchemaElementRef().getSpecifiedName()); - assertEquals(defaultName, contextRootElement.getSchemaElementRef().getName()); + assertNull(contextRootElement.getQName().getSpecifiedName()); + assertEquals(defaultName, contextRootElement.getQName().getName()); } public void testUpdateName() throws Exception { @@ -133,9 +133,9 @@ public class GenericJavaXmlRootElementTests JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); String defaultName = Introspector.decapitalize(TYPE_NAME); - assertNull(contextRootElement.getSchemaElementRef().getSpecifiedName()); - assertEquals(defaultName, contextRootElement.getSchemaElementRef().getDefaultName()); - assertEquals(defaultName, contextRootElement.getSchemaElementRef().getName()); + assertNull(contextRootElement.getQName().getSpecifiedName()); + assertEquals(defaultName, contextRootElement.getQName().getDefaultName()); + assertEquals(defaultName, contextRootElement.getQName().getName()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourceType); @@ -144,8 +144,8 @@ public class GenericJavaXmlRootElementTests GenericJavaXmlRootElementTests.this.addXmlRootElementMemberValuePair(declaration, JAXB.XML_ROOT_ELEMENT__NAME, "foo"); } }); - assertEquals("foo", contextRootElement.getSchemaElementRef().getSpecifiedName()); - assertEquals("foo", contextRootElement.getSchemaElementRef().getName()); + assertEquals("foo", contextRootElement.getQName().getSpecifiedName()); + assertEquals("foo", contextRootElement.getQName().getName()); 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/GenericJavaXmlSchemaTypeTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTypeTests.java index 74d59c14b5..c6f74abf93 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 @@ -47,18 +47,18 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - assertNull(contextXmlSchemaType.getSchemaTypeRef().getName()); + assertNull(contextXmlSchemaType.getQName().getName()); - contextXmlSchemaType.getSchemaTypeRef().setSpecifiedName("foo"); + contextXmlSchemaType.getQName().setSpecifiedName("foo"); XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", schemaTypeAnnotation.getName()); - assertEquals("foo", contextXmlSchemaType.getSchemaTypeRef().getName()); + assertEquals("foo", contextXmlSchemaType.getQName().getName()); //verify the xml schema type annotation is not removed when the name is set to null - contextXmlSchemaType.getSchemaTypeRef().setSpecifiedName(null); + contextXmlSchemaType.getQName().setSpecifiedName(null); schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); assertNull(schemaTypeAnnotation.getName()); - assertNull(contextXmlSchemaType.getSchemaTypeRef().getName()); + assertNull(contextXmlSchemaType.getQName().getName()); } public void testUpdateName() throws Exception { @@ -67,7 +67,7 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - assertNull(contextXmlSchemaType.getSchemaTypeRef().getName()); + assertNull(contextXmlSchemaType.getQName().getName()); //add a name member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage); @@ -76,7 +76,7 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAME, "foo"); } }); - assertEquals("foo", contextXmlSchemaType.getSchemaTypeRef().getName()); + assertEquals("foo", contextXmlSchemaType.getQName().getName()); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { @@ -92,22 +92,22 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - assertNull(contextXmlSchemaType.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getSchemaTypeRef().getDefaultNamespace()); - assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getSchemaTypeRef().getNamespace()); + assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace()); + assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getDefaultNamespace()); + assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace()); - contextXmlSchemaType.getSchemaTypeRef().setSpecifiedNamespace("foo"); + contextXmlSchemaType.getQName().setSpecifiedNamespace("foo"); XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); assertEquals("foo", schemaTypeAnnotation.getNamespace()); - assertEquals("foo", contextXmlSchemaType.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", contextXmlSchemaType.getSchemaTypeRef().getNamespace()); + assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextXmlSchemaType.getQName().getNamespace()); //verify the xml schema type annotation is not removed when the namespace is set to null - contextXmlSchemaType.getSchemaTypeRef().setSpecifiedNamespace(null); + contextXmlSchemaType.getQName().setSpecifiedNamespace(null); schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); assertNull(schemaTypeAnnotation.getNamespace()); - assertNull(contextXmlSchemaType.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getSchemaTypeRef().getNamespace()); + assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace()); + assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace()); } public void testUpdateNamespace() throws Exception { @@ -116,9 +116,9 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase XmlSchemaType contextXmlSchemaType = contextPackageInfo.getXmlSchemaTypes().iterator().next(); JavaResourcePackage resourcePackage = contextPackageInfo.getResourcePackage(); - assertNull(contextXmlSchemaType.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getSchemaTypeRef().getDefaultNamespace()); - assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getSchemaTypeRef().getNamespace()); + assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace()); + assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getDefaultNamespace()); + assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace()); //add a namespace member value pair AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage); @@ -127,8 +127,8 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase GenericJavaXmlSchemaTypeTests.this.addXmlSchemaTypeMemberValuePair(declaration, JAXB.XML_SCHEMA_TYPE__NAMESPACE, "foo"); } }); - assertEquals("foo", contextXmlSchemaType.getSchemaTypeRef().getSpecifiedNamespace()); - assertEquals("foo", contextXmlSchemaType.getSchemaTypeRef().getNamespace()); + assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace()); + assertEquals("foo", contextXmlSchemaType.getQName().getNamespace()); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { |