From 29a22cf833fdfe81da513af4e876e51030e6d593 Mon Sep 17 00:00:00 2001 From: pfullbright Date: Fri, 26 Aug 2011 00:33:28 +0000 Subject: removed ANNOTATION_NAME from annotation interfaces --- .../context/java/AbstractJavaPersistentType.java | 9 +- .../context/java/GenericJavaBasicMapping.java | 26 ++-- .../java/GenericJavaElementFactoryMethod.java | 3 +- .../context/java/GenericJavaEnumConstant.java | 3 +- .../context/java/GenericJavaPackageInfo.java | 21 +-- .../context/java/GenericJavaPersistentClass.java | 4 +- .../context/java/GenericJavaPersistentEnum.java | 3 +- .../internal/context/java/GenericJavaRegistry.java | 6 +- .../context/java/GenericJavaTransientClass.java | 7 +- .../context/java/GenericJavaXmlAdaptable.java | 7 +- .../java/GenericJavaXmlAnyAttributeMapping.java | 3 +- .../java/GenericJavaXmlAnyElementMapping.java | 2 +- .../java/GenericJavaXmlAttributeMapping.java | 3 +- .../context/java/GenericJavaXmlElementMapping.java | 4 +- .../internal/context/java/GenericJavaXmlID.java | 2 +- .../internal/context/java/GenericJavaXmlList.java | 2 +- .../context/java/GenericJavaXmlSchema.java | 3 +- .../java/GenericJavaXmlTransientMapping.java | 3 +- .../context/java/GenericJavaXmlValueMapping.java | 3 +- .../java/JavaXmlAnyAttributeMappingDefinition.java | 9 +- .../java/JavaXmlAnyElementMappingDefinition.java | 13 +- .../java/JavaXmlAttributeMappingDefinition.java | 30 ++--- .../java/JavaXmlTransientMappingDefinition.java | 4 +- .../java/JavaXmlValueMappingDefinition.java | 12 +- .../java/NullXmlAccessorOrderAnnotation.java | 3 +- .../java/NullXmlAccessorTypeAnnotation.java | 3 +- .../java/NullXmlElementDeclAnnotation.java | 3 +- .../resource/java/NullXmlEnumAnnotation.java | 3 +- .../resource/java/NullXmlEnumValueAnnotation.java | 3 +- .../resource/java/NullXmlSchemaAnnotation.java | 3 +- .../resource/java/NullXmlTypeAnnotation.java | 3 +- .../binary/BinaryXmlAccessorOrderAnnotation.java | 2 +- .../binary/BinaryXmlAccessorTypeAnnotation.java | 2 +- .../binary/BinaryXmlAnyAttributeAnnotation.java | 3 +- .../java/binary/BinaryXmlAnyElementAnnotation.java | 2 +- .../binary/BinaryXmlAttachmentRefAnnotation.java | 3 +- .../java/binary/BinaryXmlAttributeAnnotation.java | 2 +- .../java/binary/BinaryXmlElementAnnotation.java | 2 +- .../binary/BinaryXmlElementDeclAnnotation.java | 2 +- .../java/binary/BinaryXmlElementRefAnnotation.java | 2 +- .../binary/BinaryXmlElementRefsAnnotation.java | 2 +- .../binary/BinaryXmlElementWrapperAnnotation.java | 2 +- .../java/binary/BinaryXmlElementsAnnotation.java | 2 +- .../java/binary/BinaryXmlEnumAnnotation.java | 2 +- .../java/binary/BinaryXmlEnumValueAnnotation.java | 2 +- .../java/binary/BinaryXmlIDAnnotation.java | 3 +- .../java/binary/BinaryXmlIDREFAnnotation.java | 3 +- .../BinaryXmlInlineBinaryDataAnnotation.java | 12 +- .../binary/BinaryXmlJavaTypeAdapterAnnotation.java | 2 +- .../java/binary/BinaryXmlListAnnotation.java | 12 +- .../java/binary/BinaryXmlMimeTypeAnnotation.java | 2 +- .../java/binary/BinaryXmlMixedAnnotation.java | 12 +- .../java/binary/BinaryXmlRegistryAnnotation.java | 3 +- .../binary/BinaryXmlRootElementAnnotation.java | 2 +- .../java/binary/BinaryXmlSeeAlsoAnnotation.java | 2 +- .../java/binary/BinaryXmlTransientAnnotation.java | 3 +- .../java/binary/BinaryXmlTypeAnnotation.java | 2 +- .../java/binary/BinaryXmlValueAnnotation.java | 3 +- .../source/SourceXmlAccessorOrderAnnotation.java | 4 +- .../source/SourceXmlAccessorTypeAnnotation.java | 4 +- .../source/SourceXmlAnyAttributeAnnotation.java | 5 +- .../java/source/SourceXmlAnyElementAnnotation.java | 4 +- .../source/SourceXmlAttachmentRefAnnotation.java | 5 +- .../java/source/SourceXmlAttributeAnnotation.java | 4 +- .../java/source/SourceXmlElementAnnotation.java | 4 +- .../source/SourceXmlElementDeclAnnotation.java | 4 +- .../java/source/SourceXmlElementRefAnnotation.java | 4 +- .../source/SourceXmlElementRefsAnnotation.java | 4 +- .../source/SourceXmlElementWrapperAnnotation.java | 4 +- .../java/source/SourceXmlElementsAnnotation.java | 4 +- .../java/source/SourceXmlEnumAnnotation.java | 4 +- .../java/source/SourceXmlEnumValueAnnotation.java | 4 +- .../java/source/SourceXmlIDAnnotation.java | 5 +- .../java/source/SourceXmlIDREFAnnotation.java | 5 +- .../SourceXmlInlineBinaryDataAnnotation.java | 21 +-- .../source/SourceXmlJavaTypeAdapterAnnotation.java | 5 +- .../java/source/SourceXmlListAnnotation.java | 5 +- .../java/source/SourceXmlMimeTypeAnnotation.java | 4 +- .../java/source/SourceXmlMixedAnnotation.java | 5 +- .../java/source/SourceXmlNsAnnotation.java | 3 +- .../java/source/SourceXmlRegistryAnnotation.java | 5 +- .../source/SourceXmlRootElementAnnotation.java | 4 +- .../java/source/SourceXmlSchemaAnnotation.java | 4 +- .../java/source/SourceXmlSchemaTypeAnnotation.java | 5 +- .../java/source/SourceXmlSeeAlsoAnnotation.java | 4 +- .../java/source/SourceXmlTransientAnnotation.java | 5 +- .../java/source/SourceXmlTypeAnnotation.java | 4 +- .../java/source/SourceXmlValueAnnotation.java | 5 +- .../resource/java/XmlAccessorOrderAnnotation.java | 6 +- .../resource/java/XmlAccessorTypeAnnotation.java | 6 +- .../resource/java/XmlAnyAttributeAnnotation.java | 6 +- .../resource/java/XmlAnyElementAnnotation.java | 6 +- .../resource/java/XmlAttachmentRefAnnotation.java | 6 +- .../core/resource/java/XmlAttributeAnnotation.java | 3 +- .../core/resource/java/XmlElementAnnotation.java | 2 - .../resource/java/XmlElementDeclAnnotation.java | 6 +- .../resource/java/XmlElementRefAnnotation.java | 3 - .../resource/java/XmlElementRefsAnnotation.java | 3 - .../resource/java/XmlElementWrapperAnnotation.java | 2 - .../core/resource/java/XmlElementsAnnotation.java | 3 - .../jaxb/core/resource/java/XmlEnumAnnotation.java | 6 +- .../core/resource/java/XmlEnumValueAnnotation.java | 7 +- .../jaxb/core/resource/java/XmlIDAnnotation.java | 6 +- .../core/resource/java/XmlIDREFAnnotation.java | 6 +- .../java/XmlInlineBinaryDataAnnotation.java | 6 +- .../java/XmlJavaTypeAdapterAnnotation.java | 2 - .../jaxb/core/resource/java/XmlListAnnotation.java | 6 +- .../core/resource/java/XmlMimeTypeAnnotation.java | 6 +- .../core/resource/java/XmlMixedAnnotation.java | 1 - .../jaxb/core/resource/java/XmlNsAnnotation.java | 2 - .../core/resource/java/XmlRegistryAnnotation.java | 6 +- .../resource/java/XmlRootElementAnnotation.java | 1 - .../core/resource/java/XmlSchemaAnnotation.java | 2 - .../resource/java/XmlSchemaTypeAnnotation.java | 1 - .../core/resource/java/XmlSeeAlsoAnnotation.java | 2 - .../core/resource/java/XmlTransientAnnotation.java | 6 +- .../jaxb/core/resource/java/XmlTypeAnnotation.java | 2 - .../core/resource/java/XmlValueAnnotation.java | 6 +- .../BinaryXmlInverseReferenceAnnotation.java | 2 +- .../binary/BinaryXmlTransformationAnnotation.java | 2 +- .../SourceXmlInverseReferenceAnnotation.java | 4 +- .../source/SourceXmlTransformationAnnotation.java | 4 +- .../java/XmlInverseReferenceAnnotation.java | 4 +- .../resource/java/XmlTransformationAnnotation.java | 2 - ...enericJavaAttributeXmlJavaTypeAdapterTests.java | 12 +- .../java/GenericJavaElementFactoryMethodTests.java | 28 ++-- .../context/java/GenericJavaEnumConstantTests.java | 4 +- .../context/java/GenericJavaPackageInfoTests.java | 25 ++-- .../GenericJavaPackageXmlJavaTypeAdapterTests.java | 15 +-- .../java/GenericJavaPersistentClassTests.java | 132 +++++++++---------- .../java/GenericJavaPersistentEnumTests.java | 54 ++++---- .../GenericJavaTypeXmlJavaTypeAdapterTests.java | 15 +-- .../GenericJavaXmlAnyAttributeMappingTests.java | 37 +++--- .../java/GenericJavaXmlAnyElementMappingTests.java | 46 ++++--- .../java/GenericJavaXmlAttributeMappingTests.java | 121 +++++++++-------- .../java/GenericJavaXmlElementMappingTests.java | 145 ++++++++++----------- .../java/GenericJavaXmlElementRefMappingTests.java | 41 +++--- .../java/GenericJavaXmlRootElementTests.java | 14 +- .../context/java/GenericJavaXmlSchemaTests.java | 39 +++--- .../java/GenericJavaXmlSchemaTypeTests.java | 19 ++- .../java/GenericJavaXmlValueMappingTests.java | 37 +++--- .../resource/java/XmlSchemaAnnotationTests.java | 8 +- 142 files changed, 661 insertions(+), 716 deletions(-) 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 915d42c9e2..3d9d377ce6 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 @@ -29,6 +29,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.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation; @@ -100,7 +101,7 @@ public abstract class AbstractJavaPersistentType // ********** xml type annotation ********** protected XmlTypeAnnotation getXmlTypeAnnotation() { - return (XmlTypeAnnotation) this.getJavaResourceType().getNonNullAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + return (XmlTypeAnnotation) this.getJavaResourceType().getNonNullAnnotation(JAXB.XML_TYPE); } @@ -205,11 +206,11 @@ public abstract class AbstractJavaPersistentType public XmlRootElement setRootElement(String name) { if (name == null) { - this.getJavaResourceType().removeAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + this.getJavaResourceType().removeAnnotation(JAXB.XML_ROOT_ELEMENT); this.setRootElement_(null); return null; } - XmlRootElementAnnotation resourceRootElement = (XmlRootElementAnnotation) getJavaResourceType().addAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + XmlRootElementAnnotation resourceRootElement = (XmlRootElementAnnotation) getJavaResourceType().addAnnotation(JAXB.XML_ROOT_ELEMENT); resourceRootElement.setName(name); XmlRootElement contextRootElement = this.buildRootElement(resourceRootElement); this.setRootElement_(contextRootElement); @@ -247,7 +248,7 @@ public abstract class AbstractJavaPersistentType } protected XmlRootElementAnnotation getRootElementAnnotation() { - return (XmlRootElementAnnotation) this.getJavaResourceType().getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + return (XmlRootElementAnnotation) this.getJavaResourceType().getAnnotation(JAXB.XML_ROOT_ELEMENT); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java index a11f6ac637..0a4d017542 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaBasicMapping.java @@ -138,7 +138,7 @@ public abstract class GenericJavaBasicMapping getXmlSchemaTypeAnnotations() { return new SubListIterableWrapper( - this.resourcePackage.getAnnotations(XmlSchemaTypeAnnotation.ANNOTATION_NAME)); + this.resourcePackage.getAnnotations(JAXB.XML_SCHEMA_TYPE)); } @@ -240,7 +241,7 @@ public class GenericJavaPackageInfo } public XmlJavaTypeAdapter addXmlJavaTypeAdapter(int index) { - XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.resourcePackage.addAnnotation(index, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.resourcePackage.addAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER); return this.xmlJavaTypeAdapterContainer.addContextElement(index, annotation); } @@ -249,12 +250,12 @@ public class GenericJavaPackageInfo } public void removeXmlJavaTypeAdapter(int index) { - this.resourcePackage.removeAnnotation(index, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + this.resourcePackage.removeAnnotation(index, JAXB.XML_JAVA_TYPE_ADAPTER); this.xmlJavaTypeAdapterContainer.removeContextElement(index); } public void moveXmlJavaTypeAdapter(int targetIndex, int sourceIndex) { - this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + this.resourcePackage.moveAnnotation(targetIndex, sourceIndex, JAXB.XML_JAVA_TYPE_ADAPTER); this.xmlJavaTypeAdapterContainer.moveContextElement(targetIndex, sourceIndex); } @@ -272,7 +273,7 @@ public class GenericJavaPackageInfo protected ListIterable getXmlJavaTypeAdapterAnnotations() { return new SubListIterableWrapper( - this.resourcePackage.getAnnotations(XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME)); + this.resourcePackage.getAnnotations(JAXB.XML_JAVA_TYPE_ADAPTER)); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java index 6ef62bcc17..e64c8cbfba 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentClass.java @@ -270,7 +270,7 @@ public class GenericJavaPersistentClass } protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() { - return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME); + return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE); } /** @@ -337,7 +337,7 @@ public class GenericJavaPersistentClass } protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() { - return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME); + return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER); } /** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java index e0b85d262a..3148a73222 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaPersistentEnum.java @@ -14,6 +14,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceEnumConstant; import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot; import org.eclipse.jpt.jaxb.core.context.JaxbEnumConstant; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentEnum; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation; public class GenericJavaPersistentEnum @@ -61,7 +62,7 @@ public class GenericJavaPersistentEnum // ********** xml enum annotation ********** protected XmlEnumAnnotation getXmlEnumAnnotation() { - return (XmlEnumAnnotation) this.getJavaResourceType().getNonNullAnnotation(XmlEnumAnnotation.ANNOTATION_NAME); + return (XmlEnumAnnotation) this.getJavaResourceType().getNonNullAnnotation(JAXB.XML_ENUM); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java index 91a3b8cbe9..879ae5f9df 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaRegistry.java @@ -17,7 +17,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot; import org.eclipse.jpt.jaxb.core.context.JaxbElementFactoryMethod; import org.eclipse.jpt.jaxb.core.context.JaxbRegistry; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation; @@ -40,7 +40,7 @@ public class GenericJavaRegistry } protected XmlRegistryAnnotation getAnnotation() { - return (XmlRegistryAnnotation) getJavaResourceType().getNonNullAnnotation(XmlRegistryAnnotation.ANNOTATION_NAME); + return (XmlRegistryAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_REGISTRY); } @@ -94,7 +94,7 @@ public class GenericJavaRegistry } protected static boolean methodHasXmlElementDeclAnnotation(JavaResourceMethod method) { - return method.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME) != null; + return method.getAnnotation(JAXB.XML_ELEMENT_DECL) != null; } protected static boolean methodStartsWithCreate(JavaResourceMethod method) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java index 80e3f80428..c856822c59 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaTransientClass.java @@ -22,6 +22,7 @@ import org.eclipse.jpt.jaxb.core.context.JaxbContextRoot; import org.eclipse.jpt.jaxb.core.context.JaxbTransientClass; import org.eclipse.jpt.jaxb.core.context.XmlAccessOrder; import org.eclipse.jpt.jaxb.core.context.XmlAccessType; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; @@ -74,7 +75,7 @@ public class GenericJavaTransientClass // ********** xml transient annotation ********** protected XmlTransientAnnotation getXmlTransientAnnotation() { - return (XmlTransientAnnotation) this.getJavaResourceType().getNonNullAnnotation(XmlTransientAnnotation.ANNOTATION_NAME); + return (XmlTransientAnnotation) this.getJavaResourceType().getNonNullAnnotation(JAXB.XML_TRANSIENT); } @@ -190,7 +191,7 @@ public class GenericJavaTransientClass } protected XmlAccessorTypeAnnotation getAccessorTypeAnnotation() { - return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME); + return (XmlAccessorTypeAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_TYPE); } @@ -224,7 +225,7 @@ public class GenericJavaTransientClass } protected XmlAccessorOrderAnnotation getAccessorOrderAnnotation() { - return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME); + return (XmlAccessorOrderAnnotation) getJavaResourceType().getNonNullAnnotation(JAXB.XML_ACCESSOR_ORDER); } // **************** validation ******************************************** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdaptable.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdaptable.java index 07fc46a605..09eb40ac12 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdaptable.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAdaptable.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jaxb.core.JaxbNode; import org.eclipse.jpt.jaxb.core.context.XmlAdaptable; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.wst.validation.internal.provisional.core.IMessage; import org.eclipse.wst.validation.internal.provisional.core.IReporter; @@ -59,7 +60,7 @@ class GenericJavaXmlAdaptable if (this.xmlJavaTypeAdapter != null) { throw new IllegalStateException(); } - XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.owner.getResource().addAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation annotation = (XmlJavaTypeAdapterAnnotation) this.owner.getResource().addAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); XmlJavaTypeAdapter xmlJavaTypeAdapter = this.buildXmlJavaTypeAdapter(annotation); this.setXmlJavaTypeAdapter_(xmlJavaTypeAdapter); @@ -74,7 +75,7 @@ class GenericJavaXmlAdaptable if (this.xmlJavaTypeAdapter == null) { throw new IllegalStateException(); } - this.owner.getResource().removeAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + this.owner.getResource().removeAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); this.setXmlJavaTypeAdapter_(null); } @@ -86,7 +87,7 @@ class GenericJavaXmlAdaptable } protected XmlJavaTypeAdapterAnnotation getXmlJavaTypeAdapterAnnotation() { - return (XmlJavaTypeAdapterAnnotation) this.owner.getResource().getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + return (XmlJavaTypeAdapterAnnotation) this.owner.getResource().getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); } protected void syncXmlJavaTypeAdapter() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java index 4a4033e33d..25c633dcc1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyAttributeMapping.java @@ -20,6 +20,7 @@ import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -56,7 +57,7 @@ public class GenericJavaXmlAnyAttributeMapping @Override protected String getAnnotationName() { - return XmlAnyAttributeAnnotation.ANNOTATION_NAME; + return JAXB.XML_ANY_ATTRIBUTE; } //****************** XmlJavaTypeAdapter ********************* diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java index 09ee290a22..2a967a07e1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlAnyElementMapping.java @@ -65,7 +65,7 @@ public class GenericJavaXmlAnyElementMapping @Override protected String getAnnotationName() { - return XmlAnyElementAnnotation.ANNOTATION_NAME; + return JAXB.XML_ANY_ELEMENT; } 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 0c838bcc24..e9dbdf9a92 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 @@ -24,6 +24,7 @@ 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.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.QNameAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; import org.eclipse.jpt.jaxb.core.xsd.XsdSchema; @@ -65,7 +66,7 @@ public class GenericJavaXmlAttributeMapping @Override protected String getAnnotationName() { - return XmlAttributeAnnotation.ANNOTATION_NAME; + return JAXB.XML_ATTRIBUTE; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java index 6b030586ac..c7cdd5b9fa 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlElementMapping.java @@ -107,7 +107,7 @@ public class GenericJavaXmlElementMapping if (this.xmlElementWrapper == null) { throw new IllegalStateException(); } - this.getJavaResourceAttribute().removeAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + this.getJavaResourceAttribute().removeAnnotation(JAXB.XML_ELEMENT_WRAPPER); this.setXmlElementWrapper_(null); } @@ -119,7 +119,7 @@ public class GenericJavaXmlElementMapping } protected XmlElementWrapperAnnotation getXmlElementWrapperAnnotation() { - return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + return (XmlElementWrapperAnnotation) this.getJavaResourceAttribute().getAnnotation(JAXB.XML_ELEMENT_WRAPPER); } protected void syncXmlElementWrapper() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java index 2a063ffb52..afa3940dd5 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlID.java @@ -12,8 +12,8 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; -import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.JaxbBasicMapping; +import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlID; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java index 1a21297339..c05012c2c5 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlList.java @@ -12,8 +12,8 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.utility.TextRange; -import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.JaxbBasicMapping; +import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlList; import org.eclipse.jpt.jaxb.core.internal.validation.DefaultValidationMessages; import org.eclipse.jpt.jaxb.core.internal.validation.JaxbValidationMessages; diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java index 73c73ac914..89af2ec802 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlSchema.java @@ -24,6 +24,7 @@ import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo; import org.eclipse.jpt.jaxb.core.context.XmlNs; import org.eclipse.jpt.jaxb.core.context.XmlNsForm; import org.eclipse.jpt.jaxb.core.context.XmlSchema; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -90,7 +91,7 @@ public class GenericJavaXmlSchema // ********** xml schema annotation ********** protected XmlSchemaAnnotation getXmlSchemaAnnotation() { - return (XmlSchemaAnnotation) this.getResourcePackage().getNonNullAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + return (XmlSchemaAnnotation) this.getResourcePackage().getNonNullAnnotation(JAXB.XML_SCHEMA); } // ********** namespace ********** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java index 048075a41d..b47485d6dc 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlTransientMapping.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.context.java; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; public class GenericJavaXmlTransientMapping @@ -27,7 +28,7 @@ public class GenericJavaXmlTransientMapping @Override protected String getAnnotationName() { - return XmlTransientAnnotation.ANNOTATION_NAME; + return JAXB.XML_TRANSIENT; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java index ca814e05da..c80f55db77 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/GenericJavaXmlValueMapping.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.XmlAdaptable; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; import org.eclipse.jpt.jaxb.core.context.XmlValueMapping; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation; @@ -48,7 +49,7 @@ public class GenericJavaXmlValueMapping @Override protected String getAnnotationName() { - return XmlValueAnnotation.ANNOTATION_NAME; + return JAXB.XML_VALUE; } //****************** XmlJavaTypeAdapter ********************* diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java index e7b3e43b54..043df34f37 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyAttributeMappingDefinition.java @@ -15,8 +15,7 @@ import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; public class JavaXmlAnyAttributeMappingDefinition @@ -34,8 +33,8 @@ public class JavaXmlAnyAttributeMappingDefinition return INSTANCE; } - private static final String[] SUPPORTING_ANNOTATION_NAMES = - {XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME}; + private static final String[] SUPPORTING_ANNOTATION_NAMES = { + JAXB.XML_JAVA_TYPE_ADAPTER }; /** * Enforce singleton usage @@ -50,7 +49,7 @@ public class JavaXmlAnyAttributeMappingDefinition } public String getAnnotationName() { - return XmlAnyAttributeAnnotation.ANNOTATION_NAME; + return JAXB.XML_ANY_ATTRIBUTE; } public Iterable getSupportingAnnotationNames() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java index a447555cbd..b771d98a66 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAnyElementMappingDefinition.java @@ -15,9 +15,7 @@ import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; public class JavaXmlAnyElementMappingDefinition @@ -27,10 +25,9 @@ public class JavaXmlAnyElementMappingDefinition private static final JavaXmlAnyElementMappingDefinition INSTANCE = new JavaXmlAnyElementMappingDefinition(); - private static final String[] SUPPORTING_ANNOTATION_NAMES = - { - XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME, - XmlMixedAnnotation.ANNOTATION_NAME }; + private static final String[] SUPPORTING_ANNOTATION_NAMES = { + JAXB.XML_JAVA_TYPE_ADAPTER, + JAXB.XML_MIXED }; /** @@ -54,7 +51,7 @@ public class JavaXmlAnyElementMappingDefinition } public String getAnnotationName() { - return XmlAnyElementAnnotation.ANNOTATION_NAME; + return JAXB.XML_ANY_ELEMENT; } public Iterable getSupportingAnnotationNames() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java index 2a7e2d8c98..13a7ee3d69 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlAttributeMappingDefinition.java @@ -15,15 +15,7 @@ import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; public class JavaXmlAttributeMappingDefinition @@ -41,15 +33,15 @@ public class JavaXmlAttributeMappingDefinition return INSTANCE; } - private static final String[] SUPPORTING_ANNOTATION_NAMES = - {XmlIDAnnotation.ANNOTATION_NAME, - XmlIDREFAnnotation.ANNOTATION_NAME, - XmlListAnnotation.ANNOTATION_NAME, - XmlSchemaTypeAnnotation.ANNOTATION_NAME, - XmlAttachmentRefAnnotation.ANNOTATION_NAME, - XmlMimeTypeAnnotation.ANNOTATION_NAME, - XmlInlineBinaryDataAnnotation.ANNOTATION_NAME, - XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME}; + private static final String[] SUPPORTING_ANNOTATION_NAMES = { + JAXB.XML_ATTACHMENT_REF, + JAXB.XML_ID, + JAXB.XML_IDREF, + JAXB.XML_INLINE_BINARY_DATA, + JAXB.XML_JAVA_TYPE_ADAPTER, + JAXB.XML_LIST, + JAXB.XML_MIME_TYPE, + JAXB.XML_SCHEMA_TYPE }; /** * Enforce singleton usage @@ -64,7 +56,7 @@ public class JavaXmlAttributeMappingDefinition } public String getAnnotationName() { - return XmlAttributeAnnotation.ANNOTATION_NAME; + return JAXB.XML_ATTRIBUTE; } public Iterable getSupportingAnnotationNames() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java index de1049e956..67e2c10523 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlTransientMappingDefinition.java @@ -15,7 +15,7 @@ import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition; -import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; public class JavaXmlTransientMappingDefinition @@ -47,7 +47,7 @@ public class JavaXmlTransientMappingDefinition } public String getAnnotationName() { - return XmlTransientAnnotation.ANNOTATION_NAME; + return JAXB.XML_TRANSIENT; } public Iterable getSupportingAnnotationNames() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java index 2b01af0865..4fbc899a2a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/context/java/JavaXmlValueMappingDefinition.java @@ -15,9 +15,7 @@ import org.eclipse.jpt.jaxb.core.MappingKeys; import org.eclipse.jpt.jaxb.core.context.JaxbAttributeMapping; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; import org.eclipse.jpt.jaxb.core.context.java.JavaAttributeMappingDefinition; -import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; public class JavaXmlValueMappingDefinition @@ -27,9 +25,9 @@ public class JavaXmlValueMappingDefinition private static final JavaXmlValueMappingDefinition INSTANCE = new JavaXmlValueMappingDefinition(); - private static final String[] SUPPORTING_ANNOTATION_NAMES = - {XmlListAnnotation.ANNOTATION_NAME, - XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME}; + private static final String[] SUPPORTING_ANNOTATION_NAMES = { + JAXB.XML_LIST, + JAXB.XML_JAVA_TYPE_ADAPTER }; /** * Return the singleton. @@ -52,7 +50,7 @@ public class JavaXmlValueMappingDefinition } public String getAnnotationName() { - return XmlValueAnnotation.ANNOTATION_NAME; + return JAXB.XML_VALUE; } public Iterable getSupportingAnnotationNames() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java index 0ea7e00a85..84d2402975 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorOrderAnnotation.java @@ -13,6 +13,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; @@ -28,7 +29,7 @@ public final class NullXmlAccessorOrderAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ACCESSOR_ORDER; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java index 97cd3f9c8b..18248a0e9b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlAccessorTypeAnnotation.java @@ -13,6 +13,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation; @@ -28,7 +29,7 @@ public final class NullXmlAccessorTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ACCESSOR_TYPE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java index 777146a9d7..03ccd49f23 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlElementDeclAnnotation.java @@ -13,6 +13,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation; /** @@ -27,7 +28,7 @@ public final class NullXmlElementDeclAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_DECL; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java index 695e1761e1..5f22fae013 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumAnnotation.java @@ -13,6 +13,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation; /** @@ -27,7 +28,7 @@ public final class NullXmlEnumAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ENUM; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java index 24923742da..61f33b2bd3 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlEnumValueAnnotation.java @@ -13,6 +13,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation; /** @@ -27,7 +28,7 @@ public final class NullXmlEnumValueAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ENUM_VALUE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java index 2facf80d99..7c2cc3bacf 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlSchemaAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable; import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm; import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation; @@ -31,7 +32,7 @@ public final class NullXmlSchemaAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_SCHEMA; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java index f7cc653f20..26477a84af 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/NullXmlTypeAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable; import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation; /** @@ -29,7 +30,7 @@ public final class NullXmlTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_TYPE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java index ee79a2ebeb..f686d90601 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java @@ -34,7 +34,7 @@ public final class BinaryXmlAccessorOrderAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ACCESSOR_ORDER; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java index a2c7d033f6..363b4a4fad 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java @@ -34,7 +34,7 @@ public final class BinaryXmlAccessorTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ACCESSOR_TYPE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java index 3aeb49401b..06a7961529 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlAnyAttributeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ANY_ATTRIBUTE; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java index e9e8b6bdeb..0410afb97e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java @@ -35,7 +35,7 @@ public final class BinaryXmlAnyElementAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ANY_ELEMENT; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java index 5e0b39f6fb..610dce8c81 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlAttachmentRefAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ATTACHMENT_REF; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java index ae797df9a4..520efc7917 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java @@ -37,7 +37,7 @@ public final class BinaryXmlAttributeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ATTRIBUTE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java index 766100f286..72721b7d45 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java @@ -43,7 +43,7 @@ public final class BinaryXmlElementAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java index 4e728741be..7c827ddef6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java @@ -43,7 +43,7 @@ public final class BinaryXmlElementDeclAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_DECL; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java index 0acdc0d616..2a07f8ce03 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java @@ -39,7 +39,7 @@ public final class BinaryXmlElementRefAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_REF; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java index 423bfa5f14..7f6ab4b505 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java @@ -43,7 +43,7 @@ public class BinaryXmlElementRefsAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_REFS; } public ListIterable getXmlElementRefs() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java index 951e383cfd..344734465c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java @@ -39,7 +39,7 @@ public final class BinaryXmlElementWrapperAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_WRAPPER; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java index d217e58253..47d6f1d24c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java @@ -44,7 +44,7 @@ public final class BinaryXmlElementsAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENTS; } public ListIterable getXmlElements() { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java index 52f987c847..eaaff3cf5a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java @@ -33,7 +33,7 @@ public final class BinaryXmlEnumAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ENUM; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java index ab448a8c16..f9860c071d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java @@ -33,7 +33,7 @@ public final class BinaryXmlEnumValueAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ENUM_VALUE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java index 72eafd8dbb..e40dfa1388 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlIDAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ID; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java index a60be53e24..f98361154f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlIDREFAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_IDREF; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java index 2e162d1685..02a5486214 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java @@ -12,21 +12,21 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation; /** * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation */ public final class BinaryXmlInlineBinaryDataAnnotation - extends BinaryAnnotation - implements XmlInlineBinaryDataAnnotation -{ - + extends BinaryAnnotation + implements XmlInlineBinaryDataAnnotation { + public BinaryXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { super(parent, jdtAnnotation); } - + public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_INLINE_BINARY_DATA; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java index f56aa70629..70bdd6bec8 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java @@ -36,7 +36,7 @@ public final class BinaryXmlJavaTypeAdapterAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_JAVA_TYPE_ADAPTER; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java index 704dedff9d..1b3f952590 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java @@ -12,21 +12,21 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation; /** * javax.xml.bind.annotation.XmlList */ public final class BinaryXmlListAnnotation - extends BinaryAnnotation - implements XmlListAnnotation -{ - + extends BinaryAnnotation + implements XmlListAnnotation { + public BinaryXmlListAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { super(parent, jdtAnnotation); } - + public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_LIST; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java index 5b12f11e01..a925f2d5b6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java @@ -33,7 +33,7 @@ public final class BinaryXmlMimeTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_MIME_TYPE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java index 814168b21c..618d56348b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java @@ -12,21 +12,21 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation; /** * javax.xml.bind.annotation.XmlMixed */ public final class BinaryXmlMixedAnnotation - extends BinaryAnnotation - implements XmlMixedAnnotation -{ - + extends BinaryAnnotation + implements XmlMixedAnnotation { + public BinaryXmlMixedAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { super(parent, jdtAnnotation); } - + public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_MIXED; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java index ef03a05cf8..30c963fa17 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlRegistryAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_REGISTRY; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java index 34e281919b..ac2e6159fd 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java @@ -35,7 +35,7 @@ public final class BinaryXmlRootElementAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ROOT_ELEMENT; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java index 0ed13c090c..ce0b09154e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java @@ -34,7 +34,7 @@ public final class BinaryXmlSeeAlsoAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_SEE_ALSO; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java index f60051ff3f..57371ddb14 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlTransientAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_TRANSIENT; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java index e632e21e03..673d826194 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java @@ -44,7 +44,7 @@ public final class BinaryXmlTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_TYPE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java index e54e1aa0c7..d619f38f2d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java @@ -12,6 +12,7 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation; /** @@ -27,6 +28,6 @@ public final class BinaryXmlValueAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_VALUE; } } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java index 01a9a1887b..5ae3119058 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java @@ -31,7 +31,7 @@ public final class SourceXmlAccessorOrderAnnotation extends SourceAnnotation implements XmlAccessorOrderAnnotation { - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_ORDER); private static final DeclarationAnnotationElementAdapter VALUE_ADAPTER = buildValueAdapter(); private final AnnotationElementAdapter valueAdapter; @@ -44,7 +44,7 @@ public final class SourceXmlAccessorOrderAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ACCESSOR_ORDER; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java index 68aa349ce6..1c3b0bbd08 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java @@ -31,7 +31,7 @@ public final class SourceXmlAccessorTypeAnnotation extends SourceAnnotation implements XmlAccessorTypeAnnotation { - private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ACCESSOR_TYPE); private static final DeclarationAnnotationElementAdapter VALUE_ADAPTER = buildValueAdapter(); private final AnnotationElementAdapter valueAdapter; @@ -44,7 +44,7 @@ public final class SourceXmlAccessorTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ACCESSOR_TYPE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java index 5ad1c60bcd..0a70fa9786 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlAnyAttributeAnnotation extends SourceAnnotation implements XmlAnyAttributeAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ATTRIBUTE); public SourceXmlAnyAttributeAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ANY_ATTRIBUTE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java index 189c30d32e..43e13bcd7d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java @@ -35,7 +35,7 @@ public final class SourceXmlAnyElementAnnotation extends SourceAnnotation implements XmlAnyElementAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ANY_ELEMENT); private final DeclarationAnnotationElementAdapter laxDeclarationAdapter; private final AnnotationElementAdapter laxAdapter; @@ -81,7 +81,7 @@ public final class SourceXmlAnyElementAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ANY_ELEMENT; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java index 77fdd4bcce..aeaddd91d3 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlAttachmentRefAnnotation extends SourceAnnotation implements XmlAttachmentRefAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTACHMENT_REF); public SourceXmlAttachmentRefAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ATTACHMENT_REF; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java index fa62e3b652..43d942ec92 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java @@ -32,7 +32,7 @@ public final class SourceXmlAttributeAnnotation extends SourceAnnotation implements XmlAttributeAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ATTRIBUTE); private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; private final AnnotationElementAdapter nameAdapter; @@ -83,7 +83,7 @@ public final class SourceXmlAttributeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ATTRIBUTE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java index 984ed4ac06..5cb7f6007b 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java @@ -39,7 +39,7 @@ public final class SourceXmlElementAnnotation extends SourceAnnotation implements XmlElementAnnotation { - private static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + private static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT); private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; @@ -151,7 +151,7 @@ public final class SourceXmlElementAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java index 238c0a1491..a3c388150d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java @@ -34,7 +34,7 @@ public final class SourceXmlElementDeclAnnotation extends SourceAnnotation implements XmlElementDeclAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_DECL); private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = buildNameAdapter(); private final AnnotationElementAdapter nameAdapter; @@ -79,7 +79,7 @@ public final class SourceXmlElementDeclAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_DECL; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java index 4ea7f4572d..ac108d4d6a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java @@ -39,7 +39,7 @@ public final class SourceXmlElementRefAnnotation extends SourceAnnotation implements XmlElementRefAnnotation { - public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REF); private String fullyQualifiedTypeName; @@ -140,7 +140,7 @@ public final class SourceXmlElementRefAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_REF; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java index dae2f49a3e..7b92a4aa16 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java @@ -30,7 +30,7 @@ public class SourceXmlElementRefsAnnotation implements XmlElementRefsAnnotation { public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER - = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_REFS); private final XmlElementRefsAnnotationContainer xmlElementRefsContainer @@ -47,7 +47,7 @@ public class SourceXmlElementRefsAnnotation public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_REFS; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java index f4a8d0d268..8f02178031 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java @@ -32,7 +32,7 @@ public final class SourceXmlElementWrapperAnnotation extends SourceAnnotation implements XmlElementWrapperAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENT_WRAPPER); private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; private final AnnotationElementAdapter nameAdapter; @@ -93,7 +93,7 @@ public final class SourceXmlElementWrapperAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENT_WRAPPER; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java index eb078f59ae..78773f5016 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java @@ -30,7 +30,7 @@ public class SourceXmlElementsAnnotation implements XmlElementsAnnotation { public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER - = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ELEMENTS); private final XmlElementsAnnotationContainer xmlElementsContainer = new XmlElementsAnnotationContainer(); @@ -44,7 +44,7 @@ public class SourceXmlElementsAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ELEMENTS; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java index f8d5f734f4..f2dcbaf5d5 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java @@ -33,7 +33,7 @@ public final class SourceXmlEnumAnnotation extends SourceAnnotation implements XmlEnumAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM); private static final DeclarationAnnotationElementAdapter VALUE_ADAPTER = buildValueAdapter(); private final AnnotationElementAdapter valueAdapter; @@ -51,7 +51,7 @@ public final class SourceXmlEnumAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ENUM; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java index 5102609a1f..e783539a03 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java @@ -30,7 +30,7 @@ public final class SourceXmlEnumValueAnnotation extends SourceAnnotation implements XmlEnumValueAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ENUM_VALUE); private static final DeclarationAnnotationElementAdapter VALUE_ADAPTER = buildValueAdapter(); private final AnnotationElementAdapter valueAdapter; @@ -46,7 +46,7 @@ public final class SourceXmlEnumValueAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ENUM_VALUE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java index 79af99a515..dd54b7d5bc 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlIDAnnotation extends SourceAnnotation implements XmlIDAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ID); public SourceXmlIDAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ID; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java index 819e5a18cb..e2632aab22 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlIDREFAnnotation extends SourceAnnotation implements XmlIDREFAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_IDREF); public SourceXmlIDREFAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_IDREF; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java index 824748820d..0c9f6b99ae 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java @@ -15,29 +15,32 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation; /** * javax.xml.bind.annotation.XmlInlineBinaryDataAnnotation */ public final class SourceXmlInlineBinaryDataAnnotation - extends SourceAnnotation - implements XmlInlineBinaryDataAnnotation -{ - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - + extends SourceAnnotation + implements XmlInlineBinaryDataAnnotation { + + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_INLINE_BINARY_DATA); + + public SourceXmlInlineBinaryDataAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } - + + public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_INLINE_BINARY_DATA; } - + public void initialize(CompilationUnit astRoot) { //no-op } - + public void synchronizeWith(CompilationUnit astRoot) { //no-op } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java index d55037921c..e80dd85dfe 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java @@ -38,7 +38,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation extends SourceAnnotation implements XmlJavaTypeAdapterAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTER); public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_JAVA_TYPE_ADAPTERS); private final DeclarationAnnotationElementAdapter valueDeclarationAdapter; @@ -98,7 +98,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_JAVA_TYPE_ADAPTER; } public void initialize(CompilationUnit astRoot) { @@ -220,6 +220,7 @@ public final class SourceXmlJavaTypeAdapterAnnotation * convenience implementation of method from NestableAnnotation interface * for subclasses */ + @Override public void moveAnnotation(int newIndex) { this.getIndexedAnnotationAdapter().moveAnnotation(newIndex); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java index 32a5d28e1c..db44733f1d 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlListAnnotation extends SourceAnnotation implements XmlListAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_LIST); public SourceXmlListAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_LIST; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java index 62719fa681..5bcdba75b4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java @@ -30,7 +30,7 @@ public final class SourceXmlMimeTypeAnnotation extends SourceAnnotation implements XmlMimeTypeAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIME_TYPE); private static final DeclarationAnnotationElementAdapter VALUE_ADAPTER = buildValueAdapter(); private final AnnotationElementAdapter valueAdapter; @@ -46,7 +46,7 @@ public final class SourceXmlMimeTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_MIME_TYPE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java index 63108ff78d..9d469b2db2 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlMixedAnnotation extends SourceAnnotation implements XmlMixedAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_MIXED); public SourceXmlMixedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_MIXED; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java index 8bd1722028..aec42f8b62 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java @@ -65,7 +65,7 @@ public class SourceXmlNsAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_NS; } public void initialize(CompilationUnit astRoot) { @@ -142,6 +142,7 @@ public class SourceXmlNsAnnotation // **************** NestableAnnotation impl ******************************* + @Override public void moveAnnotation(int newIndex) { this.getIndexedAnnotationAdapter().moveAnnotation(newIndex); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java index 7c9dfd1005..a450bba3ec 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlRegistryAnnotation extends SourceAnnotation implements XmlRegistryAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_REGISTRY); public SourceXmlRegistryAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_REGISTRY; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java index 41ec5501c9..c6dd697b8c 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java @@ -30,7 +30,7 @@ public final class SourceXmlRootElementAnnotation extends SourceAnnotation implements XmlRootElementAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_ROOT_ELEMENT); private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = buildNameAdapter(); private final AnnotationElementAdapter nameAdapter; @@ -51,7 +51,7 @@ public final class SourceXmlRootElementAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_ROOT_ELEMENT; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java index de9f1913b7..d0293962ab 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java @@ -35,7 +35,7 @@ public class SourceXmlSchemaAnnotation implements XmlSchemaAnnotation { public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER - = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA); private static final DeclarationAnnotationElementAdapter ATTRIBUTE_FORM_DEFAULT_ADAPTER = buildAttributeFormDefaultAdapter(); @@ -101,7 +101,7 @@ public class SourceXmlSchemaAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_SCHEMA; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java index 5384fd34d1..9ad6a7c39a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java @@ -37,7 +37,7 @@ public class SourceXmlSchemaTypeAnnotation extends SourceAnnotation implements XmlSchemaTypeAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPE); public static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SCHEMA_TYPES); private final DeclarationAnnotationElementAdapter nameDeclarationAdapter; @@ -114,7 +114,7 @@ public class SourceXmlSchemaTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_SCHEMA_TYPE; } public void initialize(CompilationUnit astRoot) { @@ -246,6 +246,7 @@ public class SourceXmlSchemaTypeAnnotation * convenience implementation of method from NestableAnnotation interface * for subclasses */ + @Override public void moveAnnotation(int newIndex) { this.getIndexedAnnotationAdapter().moveAnnotation(newIndex); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java index 3923136fb5..348e508f5e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java @@ -41,7 +41,7 @@ public final class SourceXmlSeeAlsoAnnotation extends SourceAnnotation implements XmlSeeAlsoAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_SEE_ALSO); private final DeclarationAnnotationElementAdapter valueDeclarationAdapter; @@ -72,7 +72,7 @@ public final class SourceXmlSeeAlsoAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_SEE_ALSO; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java index 73ffd60eb9..dc17b833e6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlTransientAnnotation extends SourceAnnotation implements XmlTransientAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TRANSIENT); public SourceXmlTransientAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_TRANSIENT; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java index fc4d1eb218..1630a98a72 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java @@ -39,7 +39,7 @@ public final class SourceXmlTypeAnnotation extends SourceAnnotation implements XmlTypeAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_TYPE); private static final DeclarationAnnotationElementAdapter FACTORY_CLASS_ADAPTER = buildFactoryClassAdapter(); private final AnnotationElementAdapter factoryClassAdapter; @@ -90,7 +90,7 @@ public final class SourceXmlTypeAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_TYPE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java index a0f57f596f..a6f5d45501 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java @@ -15,6 +15,7 @@ import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotat import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation; /** @@ -24,14 +25,14 @@ public final class SourceXmlValueAnnotation extends SourceAnnotation implements XmlValueAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JAXB.XML_VALUE); public SourceXmlValueAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { super(parent, annotatedElement, DECLARATION_ANNOTATION_ADAPTER); } public String getAnnotationName() { - return ANNOTATION_NAME; + return JAXB.XML_VALUE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java index 817c73b2de..5eb213ca01 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java @@ -27,10 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlAccessorOrderAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ACCESSOR_ORDER; - + extends Annotation { + /** * Corresponds to the 'value' element of the XmlAccessorOrder annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java index c8e442d130..b10dbac4b7 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java @@ -27,10 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlAccessorTypeAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ACCESSOR_TYPE; - + extends Annotation { + /** * Corresponds to the 'value' element of the XmlAccessorType annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java index fdf10087b3..627356b2dc 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlAnyAttributeAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ANY_ATTRIBUTE; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java index dacace6537..caf679c903 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java @@ -27,10 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlAnyElementAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ANY_ELEMENT; - + extends Annotation { + /** * Corresponds to the 'lax' element of the XmlAnyElement annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java index ce04c4711f..356c771be3 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlAttachmentRefAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ATTACHMENT_REF; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java index d81c1101f6..5fd86552fb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java @@ -23,7 +23,6 @@ package org.eclipse.jpt.jaxb.core.resource.java; * @since 3.0 */ public interface XmlAttributeAnnotation - extends JaxbBasicSchemaComponentAnnotation { + extends JaxbBasicSchemaComponentAnnotation { - String ANNOTATION_NAME = JAXB.XML_ATTRIBUTE; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java index 19affb2d32..c57b458d6a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java @@ -29,8 +29,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlElementAnnotation extends JaxbBasicSchemaComponentAnnotation, NestableAnnotation { - String ANNOTATION_NAME = JAXB.XML_ELEMENT; - /** * Corresponds to the 'defaultValue' element of the XmlElement annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java index a7acb0cba7..a9450c8436 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java @@ -27,10 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlElementDeclAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ELEMENT_DECL; - + extends Annotation { + /** * Corresponds to the 'name' element of the XmlElementDecl annotation. * Return null if the element does not exist in Java. 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 403d4dbd24..6b6d9b873c 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 @@ -29,9 +29,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlElementRefAnnotation extends QNameAnnotation, NestableAnnotation { - String ANNOTATION_NAME = JAXB.XML_ELEMENT_REF; - - // ***** required ***** /** diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java index 0edacaf409..3b10f27f39 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java @@ -28,9 +28,6 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; public interface XmlElementRefsAnnotation extends Annotation { - String ANNOTATION_NAME = JAXB.XML_ELEMENT_REFS; - - /** * Corresponds to the 'value' element of the XmlElementRefs annotation. * Return an empty iterator if the element does not exist in Java. 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 2b7e419a5d..aaacd081a6 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 @@ -28,8 +28,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlElementWrapperAnnotation extends QNameAnnotation { - String ANNOTATION_NAME = JAXB.XML_ELEMENT_WRAPPER; - /** * Corresponds to the 'nillable' element of the XmlElementWrapper annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java index 999e3d7962..016d1806b4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java @@ -28,9 +28,6 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; public interface XmlElementsAnnotation extends Annotation { - String ANNOTATION_NAME = JAXB.XML_ELEMENTS; - - /** * Corresponds to the 'value' element of the XmlElements annotation. * Return an empty iterator if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java index 586189a234..1afc8ca88e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java @@ -27,10 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlEnumAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ENUM; - + extends Annotation { + /** * Corresponds to the 'value' element of the XmlEnum annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java index 6b5705610d..16a67aa9a6 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java @@ -27,11 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlEnumValueAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ENUM_VALUE; - - + extends Annotation { + /** * Corresponds to the 'value' element of the XmlEnumValue annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java index 483f457ea3..e783bd107a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlIDAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_ID; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java index 7500974445..c6cfad2def 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlIDREFAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_IDREF; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java index 66cac8de54..c299919dbf 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlInlineBinaryDataAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_INLINE_BINARY_DATA; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java index cfa230633d..3abc2cdead 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java @@ -29,8 +29,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlJavaTypeAdapterAnnotation extends NestableAnnotation { - String ANNOTATION_NAME = JAXB.XML_JAVA_TYPE_ADAPTER; - /** * Corresponds to the 'value' element of the XmlJavaTypeAdapter annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java index 88b37a4e69..5446e4681f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlListAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_LIST; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java index 04bec94b99..773ade4495 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java @@ -27,10 +27,8 @@ import org.eclipse.jpt.common.core.utility.TextRange; * @since 3.0 */ public interface XmlMimeTypeAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_MIME_TYPE; - + extends Annotation { + /** * Corresponds to the 'value' element of the XmlMimeType annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java index d9370409c9..a792c4215f 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java @@ -28,5 +28,4 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; public interface XmlMixedAnnotation extends Annotation { - String ANNOTATION_NAME = JAXB.XML_MIXED; } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java index 05157b697b..dffd0ffe49 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java @@ -29,8 +29,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlNsAnnotation extends NestableAnnotation { - String ANNOTATION_NAME = JAXB.XML_NS; - /** * Corresponds to the 'namespaceURI' element of the XmlNs annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java index 57b85a6a10..07e6aef4d2 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlRegistryAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_REGISTRY; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java index e2b6e77992..e18fc961e2 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 @@ -26,5 +26,4 @@ package org.eclipse.jpt.jaxb.core.resource.java; public interface XmlRootElementAnnotation 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/XmlSchemaAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java index 1480865cfe..0908506c0a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java @@ -30,8 +30,6 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; public interface XmlSchemaAnnotation extends Annotation { - String ANNOTATION_NAME = JAXB.XML_SCHEMA; - /** * Corresponds to the 'attributeFormDefault' element of the XmlSchema annotation. * Return null if the element does not exist in Java. 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 b395b0608b..f899506f36 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 @@ -29,7 +29,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlSchemaTypeAnnotation extends QNameAnnotation, NestableAnnotation { - String ANNOTATION_NAME = JAXB.XML_SCHEMA_TYPE; /** * Corresponds to the 'type' element of the XmlSchemaType annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java index 32d2050e0a..102f86401e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java @@ -28,8 +28,6 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; public interface XmlSeeAlsoAnnotation extends Annotation { - String ANNOTATION_NAME = JAXB.XML_SEE_ALSO; - /** * Change notification constant associated with the value element */ diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java index 793ad70a3d..f2d67206d3 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlTransientAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_TRANSIENT; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java index 944e93c9ed..3a8c03b7cd 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 @@ -29,8 +29,6 @@ import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; public interface XmlTypeAnnotation extends QNameAnnotation { - String ANNOTATION_NAME = JAXB.XML_TYPE; - /** * Corresponds to the 'factoryClass' element of the XmlType annotation. * Return null if the element does not exist in Java. diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java index c169790568..b1936550e1 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java @@ -26,8 +26,6 @@ import org.eclipse.jpt.common.core.resource.java.Annotation; * @since 3.0 */ public interface XmlValueAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JAXB.XML_VALUE; - + extends Annotation { + } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java index 2a99fae13a..b92cc05254 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlInverseReferenceAnnotation.java @@ -32,7 +32,7 @@ public class BinaryXmlInverseReferenceAnnotation public String getAnnotationName() { - return ANNOTATION_NAME; + return ELJaxb.XML_INVERSE_REFERENCE; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java index 2877dd2d4a..7b9d0e60f4 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/binary/BinaryXmlTransformationAnnotation.java @@ -32,7 +32,7 @@ public class BinaryXmlTransformationAnnotation public String getAnnotationName() { - return ANNOTATION_NAME; + return ELJaxb.XML_TRANSFORMATION; } @Override diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java index 1cfe3a8e27..35f34eaacb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlInverseReferenceAnnotation.java @@ -31,7 +31,7 @@ public class SourceXmlInverseReferenceAnnotation extends SourceAnnotation implements XmlInverseReferenceAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_INVERSE_REFERENCE); private final DeclarationAnnotationElementAdapter mappedByDeclarationAdapter; private final AnnotationElementAdapter mappedByAdapter; @@ -58,7 +58,7 @@ public class SourceXmlInverseReferenceAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return ELJaxb.XML_INVERSE_REFERENCE; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java index 3df3be266c..3cdb791d02 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/internal/resource/java/source/SourceXmlTransformationAnnotation.java @@ -30,7 +30,7 @@ public class SourceXmlTransformationAnnotation extends SourceAnnotation implements XmlTransformationAnnotation { - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ELJaxb.XML_TRANSFORMATION); private final DeclarationAnnotationElementAdapter optionalDeclarationAdapter; private final AnnotationElementAdapter optionalAdapter; @@ -57,7 +57,7 @@ public class SourceXmlTransformationAnnotation } public String getAnnotationName() { - return ANNOTATION_NAME; + return ELJaxb.XML_TRANSFORMATION; } public void initialize(CompilationUnit astRoot) { diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java index 5e7b11d7bb..a53de2e2cb 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlInverseReferenceAnnotation.java @@ -15,9 +15,7 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlInverseReferenceAnnotation - extends Annotation { - - String ANNOTATION_NAME = ELJaxb.XML_INVERSE_REFERENCE; + extends Annotation { /** * String associated with change events to the 'mappedBy' property diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java index e964d1c726..df7071765e 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.core/src/org/eclipse/jpt/jaxb/eclipselink/core/resource/java/XmlTransformationAnnotation.java @@ -29,8 +29,6 @@ import org.eclipse.jpt.common.core.utility.TextRange; public interface XmlTransformationAnnotation extends Annotation { - String ANNOTATION_NAME = ELJaxb.XML_TRANSFORMATION; - /** * String associated with change events to the 'optional' property */ diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java index 2432b98e93..221e8855a9 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaAttributeXmlJavaTypeAdapterTests.java @@ -61,13 +61,13 @@ public class GenericJavaAttributeXmlJavaTypeAdapterTests extends JaxbContextMode assertNull(contextXmlJavaTypeAdapter.getValue()); contextXmlJavaTypeAdapter.setValue("foo"); - XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertEquals("foo", javaTypeAdapterAnnotation.getValue()); assertEquals("foo", contextXmlJavaTypeAdapter.getValue()); //verify the xml schema type annotation is not removed when the value is set to null contextXmlJavaTypeAdapter.setValue(null); - javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(javaTypeAdapterAnnotation.getValue()); assertNull(contextXmlJavaTypeAdapter.getValue()); } @@ -108,13 +108,13 @@ public class GenericJavaAttributeXmlJavaTypeAdapterTests extends JaxbContextMode assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType()); contextXmlJavaTypeAdapter.setSpecifiedType("foo"); - XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertEquals("foo", javaTypeAdapterAnnotation.getType()); assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType()); assertEquals("int", contextXmlJavaTypeAdapter.getDefaultType()); contextXmlJavaTypeAdapter.setSpecifiedType(null); - javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(javaTypeAdapterAnnotation.getType()); assertEquals("int", contextXmlJavaTypeAdapter.getType()); assertNull(contextXmlJavaTypeAdapter.getSpecifiedType()); @@ -162,10 +162,10 @@ public class GenericJavaAttributeXmlJavaTypeAdapterTests extends JaxbContextMode } protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) { - this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER); } } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java index 526fbbf35b..7ebd9faf88 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaElementFactoryMethodTests.java @@ -82,13 +82,13 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa assertNull(elementFactoryMethod.getElementName()); elementFactoryMethod.setElementName("bar"); - XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertEquals("bar", elementDeclAnnotation.getName()); assertEquals("bar", elementFactoryMethod.getElementName()); //verify the xml element decl annotation is not removed when the element name is set to null elementFactoryMethod.setElementName(null); - elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertNull(elementDeclAnnotation.getName()); assertNull(elementFactoryMethod.getElementName()); } @@ -134,13 +134,13 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa assertNull(elementFactoryMethod.getDefaultValue()); elementFactoryMethod.setDefaultValue("bar"); - XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertEquals("bar", elementDeclAnnotation.getDefaultValue()); assertEquals("bar", elementFactoryMethod.getDefaultValue()); //verify the xml element decl annotation is not removed when the element name is set to null elementFactoryMethod.setDefaultValue(null); - elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertNull(elementDeclAnnotation.getDefaultValue()); assertNull(elementFactoryMethod.getDefaultValue()); } @@ -186,13 +186,13 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa assertNull(elementFactoryMethod.getScope()); elementFactoryMethod.setScope("Bar"); - XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertEquals("Bar", elementDeclAnnotation.getScope()); assertEquals("Bar", elementFactoryMethod.getScope()); //verify the xml element decl annotation is not removed when the element name is set to null elementFactoryMethod.setScope(null); - elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertNull(elementDeclAnnotation.getScope()); assertNull(elementFactoryMethod.getScope()); } @@ -238,13 +238,13 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa assertNull(elementFactoryMethod.getSubstitutionHeadName()); elementFactoryMethod.setSubstitutionHeadName("bar"); - XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertEquals("bar", elementDeclAnnotation.getSubstitutionHeadName()); assertEquals("bar", elementFactoryMethod.getSubstitutionHeadName()); //verify the xml element decl annotation is not removed when the element name is set to null elementFactoryMethod.setSubstitutionHeadName(null); - elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertNull(elementDeclAnnotation.getSubstitutionHeadName()); assertNull(elementFactoryMethod.getSubstitutionHeadName()); } @@ -290,13 +290,13 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa assertNull(elementFactoryMethod.getSubstitutionHeadNamespace()); elementFactoryMethod.setSubstitutionHeadNamespace("bar"); - XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertEquals("bar", elementDeclAnnotation.getSubstitutionHeadNamespace()); assertEquals("bar", elementFactoryMethod.getSubstitutionHeadNamespace()); //verify the xml element decl annotation is not removed when the element name is set to null elementFactoryMethod.setSubstitutionHeadNamespace(null); - elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertNull(elementDeclAnnotation.getSubstitutionHeadNamespace()); assertNull(elementFactoryMethod.getSubstitutionHeadNamespace()); } @@ -342,13 +342,13 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa assertNull(elementFactoryMethod.getNamespace()); elementFactoryMethod.setNamespace("bar"); - XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + XmlElementDeclAnnotation elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertEquals("bar", elementDeclAnnotation.getNamespace()); assertEquals("bar", elementFactoryMethod.getNamespace()); //verify the xml element decl annotation is not removed when the element name is set to null elementFactoryMethod.setNamespace(null); - elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(XmlElementDeclAnnotation.ANNOTATION_NAME); + elementDeclAnnotation = (XmlElementDeclAnnotation) resourceMethod.getAnnotation(JAXB.XML_ELEMENT_DECL); assertNull(elementDeclAnnotation.getNamespace()); assertNull(elementFactoryMethod.getNamespace()); } @@ -387,11 +387,11 @@ public class GenericJavaElementFactoryMethodTests extends JaxbContextModelTestCa } protected Annotation getXmlElementDeclAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlElementDeclAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_DECL); } protected void removeXmlElementDeclAnnotation(ModifiedDeclaration declaration) { - this.removeAnnotation(declaration, XmlElementDeclAnnotation.ANNOTATION_NAME); + this.removeAnnotation(declaration, JAXB.XML_ELEMENT_DECL); } protected void addXmlElementDeclTypeMemberValuePair(ModifiedDeclaration declaration, String name, String typeName) { diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java index 1d93c8c7dd..e9c3d9a693 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaEnumConstantTests.java @@ -83,14 +83,14 @@ public class GenericJavaEnumConstantTests extends JaxbContextModelTestCase assertNull(contextEnumConstant.getSpecifiedValue()); contextEnumConstant.setSpecifiedValue("foo"); - XmlEnumValueAnnotation enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(XmlEnumValueAnnotation.ANNOTATION_NAME); + XmlEnumValueAnnotation enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(JAXB.XML_ENUM_VALUE); assertEquals("foo", enumValueAnnotation.getValue()); assertEquals("MONDAY", contextEnumConstant.getDefaultValue()); assertEquals("foo", contextEnumConstant.getValue()); assertEquals("foo", contextEnumConstant.getSpecifiedValue()); contextEnumConstant.setSpecifiedValue(null); - enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(XmlEnumValueAnnotation.ANNOTATION_NAME); + enumValueAnnotation = (XmlEnumValueAnnotation) resourceEnumConstant.getAnnotation(JAXB.XML_ENUM_VALUE); assertNull(enumValueAnnotation.getValue()); assertEquals("MONDAY", contextEnumConstant.getDefaultValue()); assertEquals("MONDAY", contextEnumConstant.getValue()); 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 7e6634b112..410125c98f 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 @@ -32,7 +32,6 @@ import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -67,7 +66,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getDefaultAccessType()); contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD); - XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME); + XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD, accessorTypeAnnotation.getValue()); assertEquals(XmlAccessType.FIELD, contextPackageInfo.getAccessType()); @@ -80,7 +79,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase assertEquals(XmlAccessType.NONE, contextPackageInfo.getAccessType()); contextPackageInfo.setSpecifiedAccessType(null); - accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME); + accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE); assertNull(accessorTypeAnnotation.getValue()); assertNull(contextPackageInfo.getSpecifiedAccessType()); assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType()); @@ -100,7 +99,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_TYPE__FIELD); + GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__FIELD); } }); assertEquals(XmlAccessType.FIELD, contextPackageInfo.getAccessType()); @@ -108,7 +107,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase //set the accesser type value to PUBLIC_MEMBER annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER); + GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER); } }); assertEquals(XmlAccessType.PUBLIC_MEMBER, contextPackageInfo.getAccessType()); @@ -116,7 +115,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase //set the accesser type value to NONE annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_TYPE__NONE); + GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__NONE); } }); assertEquals(XmlAccessType.NONE, contextPackageInfo.getAccessType()); @@ -141,12 +140,12 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getDefaultAccessOrder()); contextPackageInfo.setSpecifiedAccessOrder(XmlAccessOrder.UNDEFINED); - XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME); + XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED, accessorOrderAnnotation.getValue()); assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder()); contextPackageInfo.setSpecifiedAccessOrder(null); - accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME); + accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER); assertNull(accessorOrderAnnotation.getValue()); assertNull(contextPackageInfo.getSpecifiedAccessOrder()); assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder()); @@ -166,7 +165,7 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourcePackage); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, XmlAccessorOrderAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_ORDER__UNDEFINED); + GenericJavaPackageInfoTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER__UNDEFINED); } }); assertEquals(XmlAccessOrder.UNDEFINED, contextPackageInfo.getAccessOrder()); @@ -184,15 +183,15 @@ public class GenericJavaPackageInfoTests extends JaxbContextModelTestCase //add another package annotation so that the context model object doesn't get removed when //removing the XmlAccessorType annotation. Only "annotated" packages are added to the context model protected void removeXmlAccessorTypeAnnotation(ModifiedDeclaration declaration) { - this.addMarkerAnnotation(declaration.getDeclaration(), XmlSchemaAnnotation.ANNOTATION_NAME); - this.removeAnnotation(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME); + this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA); + this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE); } //add another package annotation so that the context model object doesn't get removed when //removing the XmlAccessorOrder annotation. Only "annotated" packages are added to the context model protected void removeXmlAccessorOrderAnnotation(ModifiedDeclaration declaration) { - this.addMarkerAnnotation(declaration.getDeclaration(), XmlSchemaAnnotation.ANNOTATION_NAME); - this.removeAnnotation(declaration, XmlAccessorOrderAnnotation.ANNOTATION_NAME); + this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA); + this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_ORDER); } public void testGetXmlSchemaTypes() throws Exception { diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java index 0cd9a9acbd..0d45116955 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPackageXmlJavaTypeAdapterTests.java @@ -21,7 +21,6 @@ import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -50,13 +49,13 @@ public class GenericJavaPackageXmlJavaTypeAdapterTests extends JaxbContextModelT assertNull(contextXmlJavaTypeAdapter.getValue()); contextXmlJavaTypeAdapter.setValue("foo"); - XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertEquals("foo", javaTypeAdapterAnnotation.getValue()); assertEquals("foo", contextXmlJavaTypeAdapter.getValue()); //verify the xml schema type annotation is not removed when the value is set to null contextXmlJavaTypeAdapter.setValue(null); - javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(javaTypeAdapterAnnotation.getValue()); assertNull(contextXmlJavaTypeAdapter.getValue()); } @@ -97,13 +96,13 @@ public class GenericJavaPackageXmlJavaTypeAdapterTests extends JaxbContextModelT assertNull(contextXmlJavaTypeAdapter.getDefaultType()); contextXmlJavaTypeAdapter.setSpecifiedType("foo"); - XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertEquals("foo", javaTypeAdapterAnnotation.getType()); assertEquals("foo", contextXmlJavaTypeAdapter.getType()); //verify the xml schema type annotation is not removed when the type is set to null contextXmlJavaTypeAdapter.setSpecifiedType(null); - javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(javaTypeAdapterAnnotation.getType()); assertNull(contextXmlJavaTypeAdapter.getType()); assertNull(contextXmlJavaTypeAdapter.getSpecifiedType()); @@ -151,11 +150,11 @@ public class GenericJavaPackageXmlJavaTypeAdapterTests extends JaxbContextModelT //add another package annotation so that the context model object doesn't get removed when //removing the XmlJavaTypeAdapter annotation. Only "annotated" packages are added to the context model protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) { - this.addMarkerAnnotation(declaration.getDeclaration(), XmlAccessorOrderAnnotation.ANNOTATION_NAME); - this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER); + this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER); } } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentClassTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaPersistentClassTests.java index 73bb001a97..29bad05e04 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 @@ -43,11 +43,9 @@ import org.eclipse.jpt.jaxb.core.internal.context.java.PropertyAccessor; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -271,22 +269,22 @@ public class GenericJavaPersistentClassTests assertNull(persistentClass.getFactoryClass()); persistentClass.setFactoryClass("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryClass()); assertEquals("foo", persistentClass.getFactoryClass()); persistentClass.setFactoryClass(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.getFactoryClass()); assertNull(persistentClass.getFactoryClass()); //add another annotation so that the context model does not get blown away persistentClass.setSpecifiedAccessType(XmlAccessType.FIELD); - resourceType.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + resourceType.removeAnnotation(JAXB.XML_TYPE); //set factoryClass again, this time starting with no XmlType annotation persistentClass.setFactoryClass("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryClass()); assertEquals("foo", persistentClass.getFactoryClass()); } @@ -328,22 +326,22 @@ public class GenericJavaPersistentClassTests assertNull(persistentClass.getFactoryMethod()); persistentClass.setFactoryMethod("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryMethod()); assertEquals("foo", persistentClass.getFactoryMethod()); persistentClass.setFactoryMethod(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.getFactoryMethod()); assertNull(persistentClass.getFactoryMethod()); //add another annotation so that the context model does not get blown away persistentClass.setSpecifiedAccessType(XmlAccessType.FIELD); - resourceType.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + resourceType.removeAnnotation(JAXB.XML_TYPE); //set factoryMethod again, this time starting with no XmlType annotation persistentClass.setFactoryMethod("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryMethod()); assertEquals("foo", persistentClass.getFactoryMethod()); } @@ -388,24 +386,24 @@ public class GenericJavaPersistentClassTests assertEquals(defaultXmlTypeName, persistentClass.getQName().getName()); persistentClass.getQName().setSpecifiedName("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getName()); assertEquals("foo", persistentClass.getQName().getSpecifiedName()); assertEquals("foo", persistentClass.getQName().getName()); persistentClass.getQName().setSpecifiedName(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.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); + resourceType.removeAnnotation(JAXB.XML_TYPE); //set name again, this time starting with no XmlType annotation persistentClass.getQName().setSpecifiedName("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getName()); assertEquals("foo", persistentClass.getQName().getSpecifiedName()); assertEquals("foo", persistentClass.getQName().getName()); @@ -454,24 +452,24 @@ public class GenericJavaPersistentClassTests assertEquals("", persistentClass.getQName().getNamespace()); persistentClass.getQName().setSpecifiedNamespace("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getNamespace()); assertEquals("foo", persistentClass.getQName().getSpecifiedNamespace()); assertEquals("foo", persistentClass.getQName().getNamespace()); persistentClass.getQName().setSpecifiedNamespace(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.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); + resourceType.removeAnnotation(JAXB.XML_TYPE); //set namespace again, this time starting with no XmlType annotation persistentClass.getQName().setSpecifiedNamespace("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getNamespace()); assertEquals("foo", persistentClass.getQName().getSpecifiedNamespace()); assertEquals("foo", persistentClass.getQName().getNamespace()); @@ -519,7 +517,7 @@ public class GenericJavaPersistentClassTests assertEquals(XmlAccessType.PUBLIC_MEMBER, persistentClass.getDefaultAccessType()); persistentClass.setSpecifiedAccessType(XmlAccessType.FIELD); - XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME); + XmlAccessorTypeAnnotation accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType.FIELD, accessorTypeAnnotation.getValue()); assertEquals(XmlAccessType.FIELD, persistentClass.getAccessType()); @@ -532,7 +530,7 @@ public class GenericJavaPersistentClassTests assertEquals(XmlAccessType.NONE, persistentClass.getAccessType()); persistentClass.setSpecifiedAccessType(null); - accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME); + accessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE); assertNull(accessorTypeAnnotation.getValue()); assertNull(persistentClass.getSpecifiedAccessType()); assertEquals(XmlAccessType.PUBLIC_MEMBER, persistentClass.getAccessType()); @@ -553,7 +551,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceType); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_TYPE__FIELD); + GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__FIELD); } }); assertEquals(XmlAccessType.FIELD, persistentClass.getAccessType()); @@ -561,7 +559,7 @@ public class GenericJavaPersistentClassTests //set the accesser type value to PUBLIC_MEMBER annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER); + GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__PUBLIC_MEMBER); } }); assertEquals(XmlAccessType.PUBLIC_MEMBER, persistentClass.getAccessType()); @@ -569,14 +567,14 @@ public class GenericJavaPersistentClassTests //set the accesser type value to NONE annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_TYPE__NONE); + GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, JAXB.XML_ACCESS_TYPE__NONE); } }); assertEquals(XmlAccessType.NONE, persistentClass.getAccessType()); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_TYPE); } }); assertNull(persistentClass.getSpecifiedAccessType()); @@ -628,7 +626,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(persistentClass.getJavaResourceType()); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlTypeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_TYPE); } }); assertEquals(persistentClass, childPersistentClass.getSuperClass()); @@ -644,12 +642,12 @@ public class GenericJavaPersistentClassTests assertEquals(XmlAccessOrder.UNDEFINED, persistentClass.getDefaultAccessOrder()); persistentClass.setSpecifiedAccessOrder(XmlAccessOrder.UNDEFINED); - XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME); + XmlAccessorOrderAnnotation accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder.UNDEFINED, accessorOrderAnnotation.getValue()); assertEquals(XmlAccessOrder.UNDEFINED, persistentClass.getAccessOrder()); persistentClass.setSpecifiedAccessOrder(null); - accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(XmlAccessorOrderAnnotation.ANNOTATION_NAME); + accessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER); assertNull(accessorOrderAnnotation.getValue()); assertNull(persistentClass.getSpecifiedAccessOrder()); assertEquals(XmlAccessOrder.UNDEFINED, persistentClass.getAccessOrder()); @@ -669,14 +667,14 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceType); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, XmlAccessorOrderAnnotation.ANNOTATION_NAME, JAXB.XML_ACCESS_ORDER__UNDEFINED); + GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_ORDER, JAXB.XML_ACCESS_ORDER__UNDEFINED); } }); assertEquals(XmlAccessOrder.UNDEFINED, persistentClass.getAccessOrder()); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAccessorOrderAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ACCESSOR_ORDER); } }); assertNull(persistentClass.getSpecifiedAccessOrder()); @@ -738,7 +736,7 @@ public class GenericJavaPersistentClassTests persistentClass.addProp(0, "foo"); persistentClass.addProp(0, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); ListIterator props = xmlTypeAnnotation.getPropOrder().iterator(); assertEquals("baz", props.next()); @@ -756,7 +754,7 @@ public class GenericJavaPersistentClassTests persistentClass.addProp(1, "foo"); persistentClass.addProp(0, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); ListIterator props = xmlTypeAnnotation.getPropOrder().iterator(); assertEquals("baz", props.next()); @@ -774,7 +772,7 @@ public class GenericJavaPersistentClassTests persistentClass.addProp(1, "foo"); persistentClass.addProp(2, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); persistentClass.removeProp(1); @@ -802,7 +800,7 @@ public class GenericJavaPersistentClassTests persistentClass.addProp(1, "foo"); persistentClass.addProp(2, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE); assertEquals(3, xmlTypeAnnotation.getPropOrderSize()); @@ -933,7 +931,7 @@ public class GenericJavaPersistentClassTests } protected Annotation getXmlTypeAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlTypeAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_TYPE); } protected void moveProp(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) { @@ -954,13 +952,13 @@ public class GenericJavaPersistentClassTests assertFalse(persistentClass.isRootElement()); persistentClass.setRootElement("foo"); - XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertEquals("foo", xmlRootElementAnnotation.getName()); assertEquals("foo", persistentClass.getRootElement().getQName().getName()); assertTrue(persistentClass.isRootElement()); persistentClass.setRootElement(null); - xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertNull(xmlRootElementAnnotation); assertNull(persistentClass.getRootElement()); assertFalse(persistentClass.isRootElement()); @@ -1068,7 +1066,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceField); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlTransientAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_TRANSIENT); } }); //@XmlTransient @@ -1105,7 +1103,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlTransientAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_TRANSIENT); } }); } @@ -1260,7 +1258,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceField); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1297,7 +1295,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD); @@ -1334,7 +1332,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceField); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1371,7 +1369,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.TRANSIENT_KEYWORD); @@ -1408,7 +1406,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceField); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1445,7 +1443,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); removeModifiers(resourceField, ModifierKeyword.PRIVATE_KEYWORD, ModifierKeyword.STATIC_KEYWORD); @@ -1482,7 +1480,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceField); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1519,7 +1517,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); } @@ -1569,7 +1567,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1606,7 +1604,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); } @@ -1641,7 +1639,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1678,7 +1676,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); } @@ -1722,7 +1720,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1759,7 +1757,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); } @@ -1799,7 +1797,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceMethod); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1836,7 +1834,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); } @@ -1874,7 +1872,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceGetter); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1911,7 +1909,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); this.removeModifiers(resourceGetter, ModifierKeyword.STATIC_KEYWORD); @@ -1956,7 +1954,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceGetter); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTRIBUTE); } }); //@XmlAttribute @@ -1993,7 +1991,7 @@ public class GenericJavaPersistentClassTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlAttributeAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_ATTRIBUTE); } }); this.removeModifiers(resourceGetter, ModifierKeyword.PRIVATE_KEYWORD); @@ -2008,17 +2006,17 @@ public class GenericJavaPersistentClassTests JaxbPersistentClass persistentClass = CollectionTools.get(getContextRoot().getPersistentClasses(), 0); JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(persistentClass.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); persistentClass.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(persistentClass.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); persistentClass.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); } public void testUpdateXmlJavaTypeAdapter() throws Exception { @@ -2027,7 +2025,7 @@ public class GenericJavaPersistentClassTests JaxbPersistentClass persistentClass = CollectionTools.get(getContextRoot().getPersistentClasses(), 0); JavaResourceAbstractType resourceType = persistentClass.getJavaResourceType(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(persistentClass.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -2036,20 +2034,20 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceType); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(persistentClass.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaPersistentClassTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(persistentClass.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -2156,7 +2154,7 @@ public class GenericJavaPersistentClassTests AnnotatedElement annotatedElement = this.annotatedElement(resourceClass); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, XmlAccessorTypeAnnotation.ANNOTATION_NAME, accessType); + GenericJavaPersistentClassTests.this.setEnumMemberValuePair(declaration, JAXB.XML_ACCESSOR_TYPE, accessType); } }); } 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 618fafe311..80a161f521 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 @@ -62,16 +62,16 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase assertNull(contextEnum.getFactoryClass()); contextEnum.setFactoryClass("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryClass()); assertEquals("foo", contextEnum.getFactoryClass()); contextEnum.setFactoryClass(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.getFactoryClass()); assertNull(contextEnum.getFactoryClass()); - resourceEnum.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + resourceEnum.removeAnnotation(JAXB.XML_TYPE); assertNull(contextEnum.getFactoryClass()); } @@ -113,20 +113,20 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase assertNull(contextEnum.getFactoryMethod()); contextEnum.setFactoryMethod("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryMethod()); assertEquals("foo", contextEnum.getFactoryMethod()); contextEnum.setFactoryMethod(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.getFactoryMethod()); assertNull(contextEnum.getFactoryMethod()); - resourceEnum.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + resourceEnum.removeAnnotation(JAXB.XML_TYPE); //set factoryMethod again, this time starting with no XmlType annotation contextEnum.setFactoryMethod("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getFactoryMethod()); assertEquals("foo", contextEnum.getFactoryMethod()); } @@ -172,22 +172,22 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase assertEquals(defaultXmlTypeName, contextEnum.getQName().getName()); contextEnum.getQName().setSpecifiedName("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getName()); assertEquals("foo", contextEnum.getQName().getSpecifiedName()); assertEquals("foo", contextEnum.getQName().getName()); contextEnum.getQName().setSpecifiedName(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.getName()); assertNull(contextEnum.getQName().getSpecifiedName()); assertEquals(defaultXmlTypeName, contextEnum.getQName().getName()); - resourceEnum.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + resourceEnum.removeAnnotation(JAXB.XML_TYPE); //set name again, this time starting with no XmlType annotation contextEnum.getQName().setSpecifiedName("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getName()); assertEquals("foo", contextEnum.getQName().getSpecifiedName()); assertEquals("foo", contextEnum.getQName().getName()); @@ -237,22 +237,22 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase assertEquals("", contextEnum.getQName().getNamespace()); contextEnum.getQName().setSpecifiedNamespace("foo"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getNamespace()); assertEquals("foo", contextEnum.getQName().getSpecifiedNamespace()); assertEquals("foo", contextEnum.getQName().getNamespace()); contextEnum.getQName().setSpecifiedNamespace(null); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertNull(xmlTypeAnnotation.getNamespace()); assertNull(contextEnum.getQName().getSpecifiedNamespace()); assertEquals("", contextEnum.getQName().getNamespace()); - resourceEnum.removeAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + resourceEnum.removeAnnotation(JAXB.XML_TYPE); //set namespace again, this time starting with no XmlType annotation contextEnum.getQName().setSpecifiedNamespace("foo"); - xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals("foo", xmlTypeAnnotation.getNamespace()); assertEquals("foo", contextEnum.getQName().getSpecifiedNamespace()); assertEquals("foo", contextEnum.getQName().getNamespace()); @@ -344,7 +344,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase contextEnum.addProp(0, "foo"); contextEnum.addProp(0, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); ListIterator props = xmlTypeAnnotation.getPropOrder().iterator(); assertEquals("baz", props.next()); @@ -362,7 +362,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase contextEnum.addProp(1, "foo"); contextEnum.addProp(0, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); ListIterator props = xmlTypeAnnotation.getPropOrder().iterator(); assertEquals("baz", props.next()); @@ -380,7 +380,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase contextEnum.addProp(1, "foo"); contextEnum.addProp(2, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); contextEnum.removeProp(1); @@ -408,7 +408,7 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase contextEnum.addProp(1, "foo"); contextEnum.addProp(2, "baz"); - XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); + XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceEnum.getAnnotation(JAXB.XML_TYPE); assertEquals(3, xmlTypeAnnotation.getPropOrderSize()); @@ -546,11 +546,11 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase } protected Annotation getXmlTypeAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlTypeAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_TYPE); } protected Annotation getXmlEnumAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlEnumAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ENUM); } protected void moveProp(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) { @@ -571,13 +571,13 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase assertFalse(contextEnum.isRootElement()); contextEnum.setRootElement("foo"); - XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertEquals("foo", xmlRootElementAnnotation.getName()); assertEquals("foo", contextEnum.getRootElement().getQName().getName()); assertTrue(contextEnum.isRootElement()); contextEnum.setRootElement(null); - xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceEnum.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertNull(xmlRootElementAnnotation); assertNull(contextEnum.getRootElement()); assertFalse(contextEnum.isRootElement()); @@ -623,17 +623,17 @@ public class GenericJavaPersistentEnumTests extends JaxbContextModelTestCase assertNull(contextEnum.getEnumType()); contextEnum.setEnumType("Integer"); - XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(XmlEnumAnnotation.ANNOTATION_NAME); + XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM); assertEquals("Integer", xmlEnumAnnotation.getValue()); assertEquals("Integer", contextEnum.getEnumType()); contextEnum.setEnumType(null); - xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(XmlEnumAnnotation.ANNOTATION_NAME); + xmlEnumAnnotation = (XmlEnumAnnotation) resourceEnum.getAnnotation(JAXB.XML_ENUM); assertNull(xmlEnumAnnotation.getValue()); assertNull(contextEnum.getEnumType()); - resourceEnum.addAnnotation(XmlTypeAnnotation.ANNOTATION_NAME); - resourceEnum.removeAnnotation(XmlEnumAnnotation.ANNOTATION_NAME); + resourceEnum.addAnnotation(JAXB.XML_TYPE); + resourceEnum.removeAnnotation(JAXB.XML_ENUM); contextEnum = CollectionTools.get(getContextRoot().getPersistentEnums(), 0); assertNull(contextEnum.getEnumType()); } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java index 4819c1850c..5bf9d2f794 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaTypeXmlJavaTypeAdapterTests.java @@ -22,7 +22,6 @@ import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator; import org.eclipse.jpt.jaxb.core.context.JaxbPersistentClass; import org.eclipse.jpt.jaxb.core.context.XmlJavaTypeAdapter; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -58,13 +57,13 @@ public class GenericJavaTypeXmlJavaTypeAdapterTests extends JaxbContextModelTest assertNull(contextXmlJavaTypeAdapter.getValue()); contextXmlJavaTypeAdapter.setValue("foo"); - XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertEquals("foo", javaTypeAdapterAnnotation.getValue()); assertEquals("foo", contextXmlJavaTypeAdapter.getValue()); //verify the xml schema type annotation is not removed when the value is set to null contextXmlJavaTypeAdapter.setValue(null); - javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(javaTypeAdapterAnnotation.getValue()); assertNull(contextXmlJavaTypeAdapter.getValue()); } @@ -105,13 +104,13 @@ public class GenericJavaTypeXmlJavaTypeAdapterTests extends JaxbContextModelTest assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType()); contextXmlJavaTypeAdapter.setSpecifiedType("foo"); - XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertEquals("foo", javaTypeAdapterAnnotation.getType()); assertEquals("foo", contextXmlJavaTypeAdapter.getSpecifiedType()); assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getDefaultType()); contextXmlJavaTypeAdapter.setSpecifiedType(null); - javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + javaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(javaTypeAdapterAnnotation.getType()); assertEquals(FULLY_QUALIFIED_TYPE_NAME, contextXmlJavaTypeAdapter.getType()); assertNull(contextXmlJavaTypeAdapter.getSpecifiedType()); @@ -161,11 +160,11 @@ public class GenericJavaTypeXmlJavaTypeAdapterTests extends JaxbContextModelTest //add another package annotation so that the context model object doesn't get removed when //removing the XmlJavaTypeAdapter annotation. Only "annotated" packages are added to the context model protected void removeXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) { - this.addMarkerAnnotation(declaration.getDeclaration(), XmlAccessorOrderAnnotation.ANNOTATION_NAME); - this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER); + this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } protected Annotation getXmlJavaTypeAdapterAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_JAVA_TYPE_ADAPTER); } } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java index d6e21823e5..21d715cd0b 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyAttributeMappingTests.java @@ -24,9 +24,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlAnyAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlElementMapping; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -65,32 +62,32 @@ public class GenericJavaXmlAnyAttributeMappingTests extends JaxbContextModelTest JavaResourceAttribute resourceAttribute = xmlAnyAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); assertNotNull(xmlAnyAttributeMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAnyAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAttributeMapping); - assertNull(resourceAttribute.getAnnotation(XmlAnyAttributeAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); xmlAnyAttributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAnyAttributeMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAnyAttributeAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY); XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlElementMapping); - assertNull(resourceAttribute.getAnnotation(XmlAnyAttributeAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); xmlAnyAttributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAnyAttributeMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAnyAttributeAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); } public void testModifyXmlJavaTypeAdapter() throws Exception { @@ -101,17 +98,17 @@ public class GenericJavaXmlAnyAttributeMappingTests extends JaxbContextModelTest XmlAnyAttributeMapping xmlAnyAttributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAnyAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAnyAttributeMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); xmlAnyAttributeMapping.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlAnyAttributeMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); xmlAnyAttributeMapping.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); } public void testUpdateXmlJavaTypeAdapter() throws Exception { @@ -122,7 +119,7 @@ public class GenericJavaXmlAnyAttributeMappingTests extends JaxbContextModelTest XmlAnyAttributeMapping xmlAnyAttributeMapping = (XmlAnyAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAnyAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAnyAttributeMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -131,20 +128,20 @@ public class GenericJavaXmlAnyAttributeMappingTests extends JaxbContextModelTest AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAnyAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlAnyAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlAnyAttributeMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAnyAttributeMappingTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlAnyAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAnyAttributeMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java index 47d5c589b6..cc6a42c6cc 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlAnyElementMappingTests.java @@ -28,8 +28,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlElementMapping; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -69,32 +67,32 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa JavaResourceAttribute resourceAttribute = xmlAnyElementMapping.getPersistentAttribute().getJavaResourceAttribute(); assertNotNull(xmlAnyElementMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT)); persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAttributeMapping); - assertNull(resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY); xmlAnyElementMapping = (XmlAnyElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlAnyElementMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY); XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlElementMapping); - assertNull(resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); persistentAttribute.setMappingKey(MappingKeys.XML_ANY_ELEMENT_ATTRIBUTE_MAPPING_KEY); xmlAnyElementMapping = (XmlAnyElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlAnyElementMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); } public void testModifyXmlJavaTypeAdapter() throws Exception { @@ -105,17 +103,17 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa XmlAnyElementMapping xmlAnyElementMapping = (XmlAnyElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAnyElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAnyElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); xmlAnyElementMapping.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlAnyElementMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); xmlAnyElementMapping.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); } public void testUpdateXmlJavaTypeAdapter() throws Exception { @@ -126,7 +124,7 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa XmlAnyElementMapping xmlAnyElementMapping = (XmlAnyElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAnyElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAnyElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -135,20 +133,20 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlAnyElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlAnyElementMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlAnyElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAnyElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -165,14 +163,14 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa assertEquals(false, xmlAnyElementMapping.isLax()); xmlAnyElementMapping.setSpecifiedLax(Boolean.TRUE); - XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME); + XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT); assertEquals(Boolean.TRUE, xmlAnyElementAnnotation.getLax()); assertEquals(Boolean.TRUE, xmlAnyElementMapping.getSpecifiedLax()); assertEquals(false, xmlAnyElementMapping.isDefaultLax()); assertEquals(true, xmlAnyElementMapping.isLax()); xmlAnyElementMapping.setSpecifiedLax(null); - xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME); + xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT); assertNull(xmlAnyElementMapping.getSpecifiedLax()); assertEquals(false, xmlAnyElementMapping.isDefaultLax()); assertEquals(false, xmlAnyElementMapping.isLax()); @@ -223,12 +221,12 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa assertNull(xmlAnyElementMapping.getSpecifiedValue()); xmlAnyElementMapping.setSpecifiedValue("Foo"); - XmlAnyElementAnnotation xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME); + XmlAnyElementAnnotation xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT); assertEquals("Foo", xmlAnyElementMapping.getSpecifiedValue()); assertEquals("Foo", xmlAnyElementMapping.getValue()); xmlAnyElementMapping.setSpecifiedValue(null); - xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(XmlAnyElementAnnotation.ANNOTATION_NAME); + xmlElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT); assertNull(xmlElementAnnotation.getValue()); assertNull(xmlAnyElementMapping.getSpecifiedValue()); } @@ -274,7 +272,7 @@ public class GenericJavaXmlAnyElementMappingTests extends JaxbContextModelTestCa } protected Annotation getXmlAnyElementAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlAnyElementAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ANY_ELEMENT); } public void testModifyXmlMixed() throws Exception { 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 ec13d08334..a183b406fe 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 @@ -28,7 +28,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlElementMapping; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; @@ -74,14 +73,14 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas assertEquals("id", xmlAttributeMapping.getQName().getName()); xmlAttributeMapping.getQName().setSpecifiedName("foo"); - XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); + XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE); assertEquals("foo", xmlAttributeAnnotation.getName()); assertEquals("foo", xmlAttributeMapping.getQName().getSpecifiedName()); assertEquals("id", xmlAttributeMapping.getQName().getDefaultName()); assertEquals("foo", xmlAttributeMapping.getQName().getName()); xmlAttributeMapping.getQName().setSpecifiedName(null); - xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); + xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE); assertNull(xmlAttributeAnnotation.getName()); assertNull(xmlAttributeMapping.getQName().getSpecifiedName()); } @@ -125,12 +124,12 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace()); xmlAttributeMapping.getQName().setSpecifiedNamespace("foo"); - XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); + XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE); assertEquals("foo", xmlAttributeAnnotation.getNamespace()); assertEquals("foo", xmlAttributeMapping.getQName().getNamespace()); xmlAttributeMapping.getQName().setSpecifiedNamespace(null); - xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); + xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE); assertNull(xmlAttributeAnnotation.getNamespace()); assertNull(xmlAttributeMapping.getQName().getSpecifiedNamespace()); } @@ -176,14 +175,14 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas assertEquals(false, xmlAttributeMapping.isRequired()); xmlAttributeMapping.setSpecifiedRequired(Boolean.TRUE); - XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); + XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE); assertEquals(Boolean.TRUE, xmlAttributeAnnotation.getRequired()); assertEquals(Boolean.TRUE, xmlAttributeMapping.getSpecifiedRequired()); assertEquals(false, xmlAttributeMapping.isDefaultRequired()); assertEquals(true, xmlAttributeMapping.isRequired()); xmlAttributeMapping.setSpecifiedRequired(null); - xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME); + xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE); assertNull(xmlAttributeAnnotation.getName()); assertNull(xmlAttributeMapping.getSpecifiedRequired()); assertEquals(false, xmlAttributeMapping.isDefaultRequired()); @@ -234,20 +233,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); assertNotNull(xmlAttributeMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY); XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlElementMapping); - assertNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAttributeMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); } public void testModifyXmlJavaTypeAdapter() throws Exception { @@ -258,17 +257,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); xmlAttributeMapping.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlAttributeMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); xmlAttributeMapping.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); } public void testUpdateXmlJavaTypeAdapter() throws Exception { @@ -279,7 +278,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -288,20 +287,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlAttributeMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlAttributeMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -314,17 +313,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(xmlAttributeMapping.getXmlSchemaType()); assertNull(xmlSchemaTypeAnnotation); xmlAttributeMapping.addXmlSchemaType(); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNotNull(xmlAttributeMapping.getXmlSchemaType()); assertNotNull(xmlSchemaTypeAnnotation); xmlAttributeMapping.removeXmlSchemaType(); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); } public void testUpdateXmlSchemaType() throws Exception { @@ -335,7 +334,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(xmlAttributeMapping.getXmlSchemaType()); assertNull(xmlSchemaTypeAnnotation); @@ -344,20 +343,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlSchemaTypeAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA_TYPE); } }); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNotNull(xmlAttributeMapping.getXmlSchemaType()); assertNotNull(xmlSchemaTypeAnnotation); //remove the XmlSchemaType annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE); } }); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(xmlAttributeMapping.getXmlSchemaType()); assertNull(xmlSchemaTypeAnnotation); } @@ -378,7 +377,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas } protected Annotation getXmlAttributeAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlAttributeAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ATTRIBUTE); } public void testModifyXmlList() throws Exception { @@ -389,17 +388,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNull(xmlAttributeMapping.getXmlList()); assertNull(xmlListAnnotation); xmlAttributeMapping.addXmlList(); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNotNull(xmlAttributeMapping.getXmlList()); assertNotNull(xmlListAnnotation); xmlAttributeMapping.removeXmlList(); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); } public void testUpdateXmlList() throws Exception { @@ -410,7 +409,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNull(xmlAttributeMapping.getXmlList()); assertNull(xmlListAnnotation); @@ -419,20 +418,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlListAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST); } }); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNotNull(xmlAttributeMapping.getXmlList()); assertNotNull(xmlListAnnotation); //remove the XmlList annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, XmlListAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST); } }); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNull(xmlAttributeMapping.getXmlList()); assertNull(xmlListAnnotation); } @@ -445,17 +444,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNull(xmlAttributeMapping.getXmlID()); assertNull(xmlIDAnnotation); xmlAttributeMapping.addXmlID(); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNotNull(xmlAttributeMapping.getXmlID()); assertNotNull(xmlIDAnnotation); xmlAttributeMapping.removeXmlID(); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); } public void testUpdateXmlID() throws Exception { @@ -466,7 +465,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNull(xmlAttributeMapping.getXmlID()); assertNull(xmlIDAnnotation); @@ -475,20 +474,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlIDAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ID); } }); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNotNull(xmlAttributeMapping.getXmlID()); assertNotNull(xmlIDAnnotation); //remove the XmlID annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, XmlIDAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_ID); } }); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNull(xmlAttributeMapping.getXmlID()); assertNull(xmlIDAnnotation); } @@ -501,17 +500,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlAttributeMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); xmlAttributeMapping.addXmlIDREF(); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNotNull(xmlAttributeMapping.getXmlIDREF()); assertNotNull(xmlIDREFAnnotation); xmlAttributeMapping.removeXmlIDREF(); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); } public void testUpdateXmlIDREF() throws Exception { @@ -522,7 +521,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlAttributeMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); @@ -531,20 +530,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlIDREFAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF); } }); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNotNull(xmlAttributeMapping.getXmlIDREF()); assertNotNull(xmlIDREFAnnotation); //remove the XmlIDREF annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, XmlIDREFAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF); } }); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlAttributeMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); } @@ -557,17 +556,17 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNull(xmlAttributeMapping.getXmlAttachmentRef()); assertNull(xmlAttachmentRefAnnotation); xmlAttributeMapping.addXmlAttachmentRef(); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNotNull(xmlAttributeMapping.getXmlAttachmentRef()); assertNotNull(xmlAttachmentRefAnnotation); xmlAttributeMapping.removeXmlAttachmentRef(); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); } public void testUpdateXmlAttachmentRef() throws Exception { @@ -578,7 +577,7 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlAttributeMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNull(xmlAttributeMapping.getXmlAttachmentRef()); assertNull(xmlAttachmentRefAnnotation); @@ -587,20 +586,20 @@ public class GenericJavaXmlAttributeMappingTests extends JaxbContextModelTestCas AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttachmentRefAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTACHMENT_REF); } }); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNotNull(xmlAttributeMapping.getXmlAttachmentRef()); assertNotNull(xmlAttachmentRefAnnotation); //remove the XmlAttachmentRef annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, XmlAttachmentRefAnnotation.ANNOTATION_NAME); + GenericJavaXmlAttributeMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTACHMENT_REF); } }); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNull(xmlAttributeMapping.getXmlAttachmentRef()); assertNull(xmlAttachmentRefAnnotation); } 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 14248a1788..6a5f06509d 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 @@ -30,7 +30,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlElement; import org.eclipse.jpt.jaxb.core.context.XmlElementMapping; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation; @@ -97,14 +96,14 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase assertEquals("id", xmlElement.getQName().getName()); xmlElement.getQName().setSpecifiedName("foo"); - XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertEquals("foo", xmlElementAnnotation.getName()); assertEquals("foo", xmlElement.getQName().getSpecifiedName()); assertEquals("id", xmlElement.getQName().getDefaultName()); assertEquals("foo", xmlElement.getQName().getName()); xmlElement.getQName().setSpecifiedName(null); - xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertNull(xmlElementAnnotation.getName()); assertNull(xmlElement.getQName().getSpecifiedName()); } @@ -150,12 +149,12 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase assertNull(xmlElement.getQName().getSpecifiedNamespace()); xmlElement.getQName().setSpecifiedNamespace("foo"); - XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertEquals("foo", xmlElementAnnotation.getNamespace()); assertEquals("foo", xmlElement.getQName().getNamespace()); xmlElement.getQName().setSpecifiedNamespace(null); - xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertNull(xmlElementAnnotation.getNamespace()); assertNull(xmlElement.getQName().getSpecifiedNamespace()); } @@ -203,14 +202,14 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase assertEquals(false, xmlElement.isRequired()); xmlElement.setSpecifiedRequired(Boolean.TRUE); - XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired()); assertEquals(Boolean.TRUE, xmlElement.getSpecifiedRequired()); assertEquals(false, xmlElement.isDefaultRequired()); assertEquals(true, xmlElement.isRequired()); xmlElement.setSpecifiedRequired(null); - xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertNull(xmlElementAnnotation.getName()); assertNull(xmlElement.getSpecifiedRequired()); assertEquals(false, xmlElement.isDefaultRequired()); @@ -266,14 +265,14 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase assertEquals(false, xmlElement.isNillable()); xmlElement.setSpecifiedNillable(Boolean.TRUE); - XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable()); assertEquals(Boolean.TRUE, xmlElement.getSpecifiedNillable()); assertEquals(false, xmlElement.isDefaultNillable()); assertEquals(true, xmlElement.isNillable()); xmlElement.setSpecifiedNillable(null); - xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertNull(xmlElementAnnotation.getName()); assertNull(xmlElement.getSpecifiedNillable()); assertEquals(false, xmlElement.isDefaultNillable()); @@ -383,12 +382,12 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase assertNull(xmlElement.getDefaultValue()); xmlElement.setDefaultValue("foo"); - XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertEquals("foo", xmlElementAnnotation.getDefaultValue()); assertEquals("foo", xmlElement.getDefaultValue()); xmlElement.setDefaultValue(null); - xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME); + xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT); assertNull(xmlElementAnnotation.getDefaultValue()); assertNull(xmlElement.getDefaultValue()); } @@ -483,20 +482,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); assertNotNull(xmlElementMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAttributeMapping); - assertNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY); xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlElementMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); } public void testModifyXmlJavaTypeAdapter() throws Exception { @@ -507,17 +506,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); xmlElementMapping.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlElementMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); xmlElementMapping.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -530,7 +529,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -539,20 +538,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlElementMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -565,17 +564,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(xmlElementMapping.getXmlSchemaType()); assertNull(xmlSchemaTypeAnnotation); xmlElementMapping.addXmlSchemaType(); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNotNull(xmlElementMapping.getXmlSchemaType()); assertNotNull(xmlSchemaTypeAnnotation); xmlElementMapping.removeXmlSchemaType(); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); } public void testUpdateXmlSchemaType() throws Exception { @@ -586,7 +585,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(xmlElementMapping.getXmlSchemaType()); assertNull(xmlSchemaTypeAnnotation); @@ -595,20 +594,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlSchemaTypeAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_SCHEMA_TYPE); } }); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNotNull(xmlElementMapping.getXmlSchemaType()); assertNotNull(xmlSchemaTypeAnnotation); //remove the XmlSchemaType annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE); } }); - xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + xmlSchemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(xmlElementMapping.getXmlSchemaType()); assertNull(xmlSchemaTypeAnnotation); } @@ -629,7 +628,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase } protected Annotation getXmlElementAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlElementAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ELEMENT); } @@ -641,17 +640,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER); assertNull(xmlElementMapping.getXmlElementWrapper()); assertNull(xmlElementWrapperAnnotation); xmlElementMapping.addXmlElementWrapper(); - xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER); assertNotNull(xmlElementMapping.getXmlElementWrapper()); assertNotNull(xmlElementWrapperAnnotation); xmlElementMapping.removeXmlElementWrapper(); - xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER); } public void testUpdateXmlElementWrapper() throws Exception { @@ -662,7 +661,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER); assertNull(xmlElementMapping.getXmlElementWrapper()); assertNull(xmlElementWrapperAnnotation); @@ -671,20 +670,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlElementWrapperAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ELEMENT_WRAPPER); } }); - xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER); assertNotNull(xmlElementMapping.getXmlElementWrapper()); assertNotNull(xmlElementWrapperAnnotation); //remove the XmlElementWrapper annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlElementWrapperAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ELEMENT_WRAPPER); } }); - xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(XmlElementWrapperAnnotation.ANNOTATION_NAME); + xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER); assertNull(xmlElementMapping.getXmlElementWrapper()); assertNull(xmlElementWrapperAnnotation); } @@ -697,17 +696,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNull(xmlElementMapping.getXmlList()); assertNull(xmlListAnnotation); xmlElementMapping.addXmlList(); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNotNull(xmlElementMapping.getXmlList()); assertNotNull(xmlListAnnotation); xmlElementMapping.removeXmlList(); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); } public void testUpdateXmlList() throws Exception { @@ -718,7 +717,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNull(xmlElementMapping.getXmlList()); assertNull(xmlListAnnotation); @@ -727,20 +726,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlListAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_LIST); } }); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNotNull(xmlElementMapping.getXmlList()); assertNotNull(xmlListAnnotation); //remove the XmlList annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlListAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_LIST); } }); - xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(XmlListAnnotation.ANNOTATION_NAME); + xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST); assertNull(xmlElementMapping.getXmlList()); assertNull(xmlListAnnotation); } @@ -753,17 +752,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNull(xmlElementMapping.getXmlID()); assertNull(xmlIDAnnotation); xmlElementMapping.addXmlID(); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNotNull(xmlElementMapping.getXmlID()); assertNotNull(xmlIDAnnotation); xmlElementMapping.removeXmlID(); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); } public void testUpdateXmlID() throws Exception { @@ -774,7 +773,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNull(xmlElementMapping.getXmlID()); assertNull(xmlIDAnnotation); @@ -783,20 +782,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlIDAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ID); } }); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNotNull(xmlElementMapping.getXmlID()); assertNotNull(xmlIDAnnotation); //remove the XmlID annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlIDAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ID); } }); - xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(XmlIDAnnotation.ANNOTATION_NAME); + xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID); assertNull(xmlElementMapping.getXmlID()); assertNull(xmlIDAnnotation); } @@ -809,17 +808,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlElementMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); xmlElementMapping.addXmlIDREF(); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNotNull(xmlElementMapping.getXmlIDREF()); assertNotNull(xmlIDREFAnnotation); xmlElementMapping.removeXmlIDREF(); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlElementMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); } @@ -832,7 +831,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlElementMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); @@ -841,20 +840,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlIDREFAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_IDREF); } }); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNotNull(xmlElementMapping.getXmlIDREF()); assertNotNull(xmlIDREFAnnotation); //remove the XmlIDREF annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlIDREFAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_IDREF); } }); - xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(XmlIDREFAnnotation.ANNOTATION_NAME); + xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF); assertNull(xmlElementMapping.getXmlIDREF()); assertNull(xmlIDREFAnnotation); } @@ -867,17 +866,17 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNull(xmlElementMapping.getXmlAttachmentRef()); assertNull(xmlAttachmentRefAnnotation); xmlElementMapping.addXmlAttachmentRef(); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNotNull(xmlElementMapping.getXmlAttachmentRef()); assertNotNull(xmlAttachmentRefAnnotation); xmlElementMapping.removeXmlAttachmentRef(); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); } public void testUpdateXmlAttachmentRef() throws Exception { @@ -888,7 +887,7 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNull(xmlElementMapping.getXmlAttachmentRef()); assertNull(xmlAttachmentRefAnnotation); @@ -897,20 +896,20 @@ public class GenericJavaXmlElementMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlAttachmentRefAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ATTACHMENT_REF); } }); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNotNull(xmlElementMapping.getXmlAttachmentRef()); assertNotNull(xmlAttachmentRefAnnotation); //remove the XmlAttachmentRef annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, XmlAttachmentRefAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementMappingTests.this.removeAnnotation(declaration, JAXB.XML_ATTACHMENT_REF); } }); - xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(XmlAttachmentRefAnnotation.ANNOTATION_NAME); + xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF); assertNull(xmlElementMapping.getXmlAttachmentRef()); assertNull(xmlAttachmentRefAnnotation); } 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 535529a464..e6cbf507f5 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 @@ -27,7 +27,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlElementRef; import org.eclipse.jpt.jaxb.core.context.XmlElementRefMapping; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; @@ -150,13 +149,13 @@ public class GenericJavaXmlElementRefMappingTests assertEquals("", xmlElementRef.getQName().getName()); xmlElementRef.getQName().setSpecifiedName("foo"); - XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); + XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF); assertEquals("foo", xmlElementRefAnnotation.getName()); assertEquals("foo", xmlElementRef.getQName().getSpecifiedName()); assertEquals("foo", xmlElementRef.getQName().getName()); xmlElementRef.getQName().setSpecifiedName(null); - xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); + xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF); assertNull(xmlElementRefAnnotation.getName()); assertNull(xmlElementRef.getQName().getSpecifiedName()); } @@ -202,12 +201,12 @@ public class GenericJavaXmlElementRefMappingTests assertNull(xmlElementRef.getQName().getSpecifiedNamespace()); xmlElementRef.getQName().setSpecifiedNamespace("foo"); - XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); + XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF); assertEquals("foo", xmlElementRefAnnotation.getNamespace()); assertEquals("foo", xmlElementRef.getQName().getNamespace()); xmlElementRef.getQName().setSpecifiedNamespace(null); - xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); + xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF); assertNull(xmlElementRefAnnotation.getNamespace()); assertNull(xmlElementRef.getQName().getSpecifiedNamespace()); } @@ -255,14 +254,14 @@ public class GenericJavaXmlElementRefMappingTests assertEquals(false, xmlElementRef.isRequired()); xmlElementRef.setSpecifiedRequired(Boolean.TRUE); - XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); + XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF); assertEquals(Boolean.TRUE, xmlElementRefAnnotation.getRequired()); assertEquals(Boolean.TRUE, xmlElementRef.getSpecifiedRequired()); assertEquals(false, xmlElementRef.isDefaultRequired()); assertEquals(true, xmlElementRef.isRequired()); xmlElementRef.setSpecifiedRequired(null); - xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME); + xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF); assertNull(xmlElementRefAnnotation.getName()); assertNull(xmlElementRef.getSpecifiedRequired()); assertEquals(false, xmlElementRef.isDefaultRequired()); @@ -365,20 +364,20 @@ public class GenericJavaXmlElementRefMappingTests JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); assertNotNull(xmlElementRefMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF)); persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAttributeMapping); - assertNull(resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_REF_ATTRIBUTE_MAPPING_KEY); xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping(); assertNotNull(xmlElementRefMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlElementRefAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); } public void testModifyXmlJavaTypeAdapter() throws Exception { @@ -389,17 +388,17 @@ public class GenericJavaXmlElementRefMappingTests XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); xmlElementRefMapping.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlElementRefMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); xmlElementRefMapping.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -412,7 +411,7 @@ public class GenericJavaXmlElementRefMappingTests XmlElementRefMapping xmlElementRefMapping = (XmlElementRefMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlElementRefMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -421,20 +420,20 @@ public class GenericJavaXmlElementRefMappingTests AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementRefMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlElementRefMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlElementRefMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlElementRefMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } @@ -455,7 +454,7 @@ public class GenericJavaXmlElementRefMappingTests } protected Annotation getXmlElementRefAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlElementRefAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ELEMENT_REF); } 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 7241dfd5ac..eed8143249 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 @@ -61,13 +61,13 @@ public class GenericJavaXmlRootElementTests assertEquals("", contextRootElement.getQName().getNamespace()); contextRootElement.getQName().setSpecifiedNamespace("foo"); - XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertEquals("foo", rootElementAnnotation.getNamespace()); assertEquals("foo", contextRootElement.getQName().getSpecifiedNamespace()); assertEquals("foo", contextRootElement.getQName().getNamespace()); contextRootElement.getQName().setSpecifiedNamespace(null); - rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertNull(rootElementAnnotation.getNamespace()); assertNull(contextRootElement.getQName().getSpecifiedNamespace()); assertEquals("", contextRootElement.getQName().getNamespace()); @@ -95,7 +95,7 @@ public class GenericJavaXmlRootElementTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, XmlRootElementAnnotation.ANNOTATION_NAME); + GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT); } }); contextRootElement = persistentClass.getRootElement(); @@ -114,13 +114,13 @@ public class GenericJavaXmlRootElementTests assertEquals(defaultName, contextRootElement.getQName().getName()); contextRootElement.getQName().setSpecifiedName("foo"); - XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + XmlRootElementAnnotation rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertEquals("foo", rootElementAnnotation.getName()); assertEquals("foo", contextRootElement.getQName().getSpecifiedName()); assertEquals("foo", contextRootElement.getQName().getName()); contextRootElement.getQName().setSpecifiedName(null); - rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(XmlRootElementAnnotation.ANNOTATION_NAME); + rootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT); assertNull(rootElementAnnotation.getName()); assertNull(contextRootElement.getQName().getSpecifiedName()); assertEquals(defaultName, contextRootElement.getQName().getName()); @@ -149,7 +149,7 @@ public class GenericJavaXmlRootElementTests annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, XmlRootElementAnnotation.ANNOTATION_NAME); + GenericJavaXmlRootElementTests.this.removeAnnotation(declaration, JAXB.XML_ROOT_ELEMENT); } }); contextRootElement = persistentClass.getRootElement(); @@ -161,6 +161,6 @@ public class GenericJavaXmlRootElementTests } protected Annotation getXmlRootElementAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlRootElementAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_ROOT_ELEMENT); } } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java index 0fbc619f7f..05f0a4c3a3 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlSchemaTests.java @@ -28,7 +28,6 @@ import org.eclipse.jpt.jaxb.core.context.XmlNs; import org.eclipse.jpt.jaxb.core.context.XmlNsForm; import org.eclipse.jpt.jaxb.core.context.XmlSchema; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -64,7 +63,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase assertNull(contextXmlSchema.getSpecifiedNamespace()); contextXmlSchema.setSpecifiedNamespace("foo"); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals("foo", schemaAnnotation.getNamespace()); assertEquals("foo", contextXmlSchema.getNamespace()); assertEquals("foo", contextXmlSchema.getSpecifiedNamespace()); @@ -72,14 +71,14 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase //set another annotation so the context model is not blown away by removing the XmlSchema annotation contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD); contextXmlSchema.setSpecifiedNamespace(null); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertNull(schemaAnnotation.getNamespace()); assertEquals("", contextXmlSchema.getNamespace()); assertNull(contextXmlSchema.getSpecifiedNamespace()); //set namespace again, this time starting with no XmlSchema annotation contextXmlSchema.setSpecifiedNamespace("foo"); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals("foo", schemaAnnotation.getNamespace()); assertEquals("foo", contextXmlSchema.getSpecifiedNamespace()); assertEquals("foo", contextXmlSchema.getNamespace()); @@ -123,20 +122,20 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase assertNull(contextXmlSchema.getLocation()); contextXmlSchema.setLocation("foo"); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals("foo", schemaAnnotation.getLocation()); assertEquals("foo", contextXmlSchema.getLocation()); //set another annotation so the context model is not blown away by removing the XmlSchema annotation contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD); contextXmlSchema.setLocation(null); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertNull(schemaAnnotation.getLocation()); assertNull(contextXmlSchema.getLocation()); //set location again, this time starting with no XmlSchema annotation contextXmlSchema.setLocation("foo"); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals("foo", schemaAnnotation.getLocation()); assertEquals("foo", contextXmlSchema.getLocation()); } @@ -178,7 +177,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase assertEquals(XmlNsForm.UNSET, contextXmlSchema.getAttributeFormDefault()); contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault()); assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault()); @@ -189,13 +188,13 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase //set another annotation so the context model is not blown away by removing the XmlSchema annotation contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD); contextXmlSchema.setSpecifiedAttributeFormDefault(null); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertNull(schemaAnnotation.getAttributeFormDefault()); assertNull(contextXmlSchema.getSpecifiedAttributeFormDefault()); //set attribute form default again, this time starting with no XmlSchema annotation contextXmlSchema.setSpecifiedAttributeFormDefault(XmlNsForm.QUALIFIED); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault()); assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getAttributeFormDefault()); } @@ -257,7 +256,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase assertEquals(XmlNsForm.UNSET, contextXmlSchema.getElementFormDefault()); contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault()); assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault()); @@ -268,13 +267,13 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase //set another annotation so the context model is not blown away by removing the XmlSchema annotation contextPackageInfo.setSpecifiedAccessType(XmlAccessType.FIELD); contextXmlSchema.setSpecifiedElementFormDefault(null); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertNull(schemaAnnotation.getElementFormDefault()); assertNull(contextXmlSchema.getSpecifiedElementFormDefault()); //set element form default again, this time starting with no XmlSchema annotation contextXmlSchema.setSpecifiedElementFormDefault(XmlNsForm.QUALIFIED); - schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals(org.eclipse.jpt.jaxb.core.resource.java.XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault()); assertEquals(XmlNsForm.QUALIFIED, contextXmlSchema.getElementFormDefault()); } @@ -405,7 +404,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase xmlNsPrefix.setNamespaceURI("baz"); xmlNsPrefix.setPrefix("bazPrefix"); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); ListIterator xmlNsPrefixes = schemaAnnotation.getXmlns().iterator(); XmlNsAnnotation xmlNsAnnotation = xmlNsPrefixes.next(); @@ -436,7 +435,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase xmlNsPrefix.setNamespaceURI("baz"); xmlNsPrefix.setPrefix("bazPrefix"); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); ListIterator xmlNsPrefixes = schemaAnnotation.getXmlns().iterator(); XmlNsAnnotation xmlNsAnnotation = xmlNsPrefixes.next(); @@ -461,7 +460,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase contextXmlSchema.addXmlNsPrefix(1).setNamespaceURI("foo"); contextXmlSchema.addXmlNsPrefix(2).setNamespaceURI("baz"); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals(3, schemaAnnotation.getXmlnsSize()); contextXmlSchema.removeXmlNsPrefix(1); @@ -492,7 +491,7 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase contextXmlSchema.addXmlNsPrefix(2).setNamespaceURI("baz"); - XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + XmlSchemaAnnotation schemaAnnotation = (XmlSchemaAnnotation) resourcePackage.getAnnotation(JAXB.XML_SCHEMA); assertEquals(3, schemaAnnotation.getXmlnsSize()); @@ -652,12 +651,12 @@ public class GenericJavaXmlSchemaTests extends JaxbContextModelTestCase //add another package annotation so that the context model object doesn't get removed when //removing the XmlSchema annotation. Only "annotated" packages are added to the context model protected void removeXmlSchemaAnnotation(ModifiedDeclaration declaration) { - this.addMarkerAnnotation(declaration.getDeclaration(), XmlAccessorOrderAnnotation.ANNOTATION_NAME); - this.removeAnnotation(declaration, XmlSchemaAnnotation.ANNOTATION_NAME); + this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER); + this.removeAnnotation(declaration, JAXB.XML_SCHEMA); } protected Annotation getXmlSchemaAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlSchemaAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_SCHEMA); } protected void moveXmlNsPrefix(ModifiedDeclaration declaration, int targetIndex, int sourceIndex) { 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 c6f74abf93..412482cabb 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 @@ -21,7 +21,6 @@ import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.jaxb.core.context.JaxbPackageInfo; import org.eclipse.jpt.jaxb.core.context.XmlSchemaType; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; import org.eclipse.xsd.util.XSDUtil; @@ -50,13 +49,13 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase assertNull(contextXmlSchemaType.getQName().getName()); contextXmlSchemaType.getQName().setSpecifiedName("foo"); - XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertEquals("foo", schemaTypeAnnotation.getName()); assertEquals("foo", contextXmlSchemaType.getQName().getName()); //verify the xml schema type annotation is not removed when the name is set to null contextXmlSchemaType.getQName().setSpecifiedName(null); - schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(schemaTypeAnnotation.getName()); assertNull(contextXmlSchemaType.getQName().getName()); } @@ -97,14 +96,14 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace()); contextXmlSchemaType.getQName().setSpecifiedNamespace("foo"); - XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertEquals("foo", schemaTypeAnnotation.getNamespace()); assertEquals("foo", contextXmlSchemaType.getQName().getSpecifiedNamespace()); assertEquals("foo", contextXmlSchemaType.getQName().getNamespace()); //verify the xml schema type annotation is not removed when the namespace is set to null contextXmlSchemaType.getQName().setSpecifiedNamespace(null); - schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(schemaTypeAnnotation.getNamespace()); assertNull(contextXmlSchemaType.getQName().getSpecifiedNamespace()); assertEquals(XSDUtil.SCHEMA_FOR_SCHEMA_URI_2001, contextXmlSchemaType.getQName().getNamespace()); @@ -147,13 +146,13 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase assertNull(contextXmlSchemaType.getType()); contextXmlSchemaType.setType("foo"); - XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + XmlSchemaTypeAnnotation schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertEquals("foo", schemaTypeAnnotation.getType()); assertEquals("foo", contextXmlSchemaType.getType()); //verify the xml schema type annotation is not removed when the type is set to null contextXmlSchemaType.setType(null); - schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + schemaTypeAnnotation = (XmlSchemaTypeAnnotation) resourcePackage.getAnnotation(0, JAXB.XML_SCHEMA_TYPE); assertNull(schemaTypeAnnotation.getType()); assertNull(contextXmlSchemaType.getType()); } @@ -197,11 +196,11 @@ public class GenericJavaXmlSchemaTypeTests extends JaxbContextModelTestCase //add another package annotation so that the context model object doesn't get removed when //removing the XmlSchemaType annotation. Only "annotated" packages are added to the context model protected void removeXmlSchemaTypeAnnotation(ModifiedDeclaration declaration) { - this.addMarkerAnnotation(declaration.getDeclaration(), XmlAccessorOrderAnnotation.ANNOTATION_NAME); - this.removeAnnotation(declaration, XmlSchemaTypeAnnotation.ANNOTATION_NAME); + this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_ACCESSOR_ORDER); + this.removeAnnotation(declaration, JAXB.XML_SCHEMA_TYPE); } protected Annotation getXmlSchemaTypeAnnotation(ModifiedDeclaration declaration) { - return declaration.getAnnotationNamed(XmlSchemaTypeAnnotation.ANNOTATION_NAME); + return declaration.getAnnotationNamed(JAXB.XML_SCHEMA_TYPE); } } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java index 8f748f295d..439d54e059 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/context/java/GenericJavaXmlValueMappingTests.java @@ -24,10 +24,7 @@ import org.eclipse.jpt.jaxb.core.context.XmlAttributeMapping; import org.eclipse.jpt.jaxb.core.context.XmlElementMapping; import org.eclipse.jpt.jaxb.core.context.XmlValueMapping; import org.eclipse.jpt.jaxb.core.resource.java.JAXB; -import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation; import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation; -import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation; import org.eclipse.jpt.jaxb.core.tests.internal.context.JaxbContextModelTestCase; @@ -65,32 +62,32 @@ public class GenericJavaXmlValueMappingTests extends JaxbContextModelTestCase JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute(); assertNotNull(xmlValueMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlValueAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE)); persistentAttribute.setMappingKey(MappingKeys.XML_ATTRIBUTE_ATTRIBUTE_MAPPING_KEY); XmlAttributeMapping xmlAttributeMapping = (XmlAttributeMapping) persistentAttribute.getMapping(); assertNotNull(xmlAttributeMapping); - assertNull(resourceAttribute.getAnnotation(XmlValueAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY); xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping(); assertNotNull(xmlValueMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlValueAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlAttributeAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE)); persistentAttribute.setMappingKey(MappingKeys.XML_ELEMENT_ATTRIBUTE_MAPPING_KEY); XmlElementMapping xmlElementMapping = (XmlElementMapping) persistentAttribute.getMapping(); assertNotNull(xmlElementMapping); - assertNull(resourceAttribute.getAnnotation(XmlValueAnnotation.ANNOTATION_NAME)); - assertNotNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); persistentAttribute.setMappingKey(MappingKeys.XML_VALUE_ATTRIBUTE_MAPPING_KEY); xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping(); assertNotNull(xmlValueMapping); - assertNotNull(resourceAttribute.getAnnotation(XmlValueAnnotation.ANNOTATION_NAME)); - assertNull(resourceAttribute.getAnnotation(XmlElementAnnotation.ANNOTATION_NAME)); + assertNotNull(resourceAttribute.getAnnotation(JAXB.XML_VALUE)); + assertNull(resourceAttribute.getAnnotation(JAXB.XML_ELEMENT)); } public void testModifyXmlJavaTypeAdapter() throws Exception { @@ -101,17 +98,17 @@ public class GenericJavaXmlValueMappingTests extends JaxbContextModelTestCase XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlValueMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); xmlValueMapping.addXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlValueMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); xmlValueMapping.removeXmlJavaTypeAdapter(); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); } public void testUpdateXmlJavaTypeAdapter() throws Exception { @@ -122,7 +119,7 @@ public class GenericJavaXmlValueMappingTests extends JaxbContextModelTestCase XmlValueMapping xmlValueMapping = (XmlValueMapping) persistentAttribute.getMapping(); JavaResourceAttribute resourceAttribute = xmlValueMapping.getPersistentAttribute().getJavaResourceAttribute(); - XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlValueMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); @@ -131,20 +128,20 @@ public class GenericJavaXmlValueMappingTests extends JaxbContextModelTestCase AnnotatedElement annotatedElement = this.annotatedElement(resourceAttribute); annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlValueMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlValueMappingTests.this.addMarkerAnnotation(declaration.getDeclaration(), JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNotNull(xmlValueMapping.getXmlJavaTypeAdapter()); assertNotNull(xmlJavaTypeAdapterAnnotation); //remove the XmlJavaTypeAdapter annotation annotatedElement.edit(new Member.Editor() { public void edit(ModifiedDeclaration declaration) { - GenericJavaXmlValueMappingTests.this.removeAnnotation(declaration, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + GenericJavaXmlValueMappingTests.this.removeAnnotation(declaration, JAXB.XML_JAVA_TYPE_ADAPTER); } }); - xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, XmlJavaTypeAdapterAnnotation.ANNOTATION_NAME); + xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceAttribute.getAnnotation(0, JAXB.XML_JAVA_TYPE_ADAPTER); assertNull(xmlValueMapping.getXmlJavaTypeAdapter()); assertNull(xmlJavaTypeAdapterAnnotation); } diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java index 1128885d56..9a4bbd2ab3 100644 --- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java +++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java @@ -104,7 +104,7 @@ public class XmlSchemaAnnotationTests assertNull(schemaAnnotation.getAttributeFormDefault()); assertSourceDoesNotContain("@XmlSchema(", cu); - schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA); schemaAnnotation.setAttributeFormDefault(XmlNsForm.QUALIFIED); assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getAttributeFormDefault()); assertSourceContains("@XmlSchema(attributeFormDefault = QUALIFIED)", cu); @@ -134,7 +134,7 @@ public class XmlSchemaAnnotationTests assertNull(schemaAnnotation.getElementFormDefault()); assertSourceDoesNotContain("@XmlSchema(", cu); - schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA); schemaAnnotation.setElementFormDefault(XmlNsForm.QUALIFIED); assertEquals(XmlNsForm.QUALIFIED, schemaAnnotation.getElementFormDefault()); assertSourceContains("@XmlSchema(elementFormDefault = QUALIFIED)", cu); @@ -154,7 +154,7 @@ public class XmlSchemaAnnotationTests assertNull(schemaAnnotation.getLocation()); assertSourceDoesNotContain("@XmlSchema(", cu); - schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA); schemaAnnotation.setLocation(TEST_LOCATION); assertEquals(TEST_LOCATION, schemaAnnotation.getLocation()); assertSourceContains("@XmlSchema(location = \"" + TEST_LOCATION + "\")", cu); @@ -174,7 +174,7 @@ public class XmlSchemaAnnotationTests assertNull(schemaAnnotation.getNamespace()); assertSourceDoesNotContain("@XmlSchema(", cu); - schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(XmlSchemaAnnotation.ANNOTATION_NAME); + schemaAnnotation = (XmlSchemaAnnotation) packageResource.addAnnotation(JAXB.XML_SCHEMA); schemaAnnotation.setNamespace(TEST_NAMESPACE); assertEquals(TEST_NAMESPACE, schemaAnnotation.getNamespace()); assertSourceContains("@XmlSchema(namespace = \"" + TEST_NAMESPACE + "\")", cu); -- cgit v1.2.3