Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-10-27 12:39:16 -0400
committerkmoore2010-10-27 12:39:16 -0400
commit296e9cc0360bfdd81f935dc5bf5d2665c0f62a45 (patch)
treef98b2a4ffa81383b6a235177cea7c33d62d2b939
parent9c0606d1ba86e4a5ca782b82e351074c40d9ac82 (diff)
downloadwebtools.dali-296e9cc0360bfdd81f935dc5bf5d2665c0f62a45.tar.gz
webtools.dali-296e9cc0360bfdd81f935dc5bf5d2665c0f62a45.tar.xz
webtools.dali-296e9cc0360bfdd81f935dc5bf5d2665c0f62a45.zip
JAXB java resource model, copied from JPA and removed JPA specific code
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationDefinitionProvider.java50
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationProvider.java143
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractAnnotationDefintionProvider.java127
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java201
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbAnnotationDefinitionProvider.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformProvider.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java57
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java (renamed from jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JavaResourceModelProvider.java)8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxbPlatformDefinition.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java10
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java8
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java12
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java97
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryContainerAnnotation.java58
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java62
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorOrderAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAccessorTypeAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyAttributeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAnyElementAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttachmentRefAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlAttributeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementDeclAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementRefsAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementWrapperAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlElementsAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlEnumValueAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlIDREFAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlInlineBinaryDataAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlJavaTypeAdapterAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlListAnnotation.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMimeTypeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlMixedAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRegistryAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlRootElementAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlSeeAlsoAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTransientAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlTypeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryXmlValueAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java106
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AnnotationContainerTools.java271
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java435
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java146
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java398
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java176
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java138
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java31
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java116
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java119
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java683
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java166
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorOrderAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAccessorTypeAnnotation.java3
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyAttributeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAnyElementAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttachmentRefAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlAttributeAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementAnnotation.java11
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementDeclAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefAnnotation.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementRefsAnnotation.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementWrapperAnnotation.java9
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlElementsAnnotation.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlEnumValueAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlIDREFAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlInlineBinaryDataAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdapterAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlListAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMimeTypeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlMixedAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlNsAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRegistryAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlRootElementAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaAnnotation.java6
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypeAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypesAnnotation.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSeeAlsoAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTransientAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlTypeAnnotation.java7
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlValueAnnotation.java5
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java4
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/Annotation.java55
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationContainer.java90
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java64
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/ContainerAnnotation.java28
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java126
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java135
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java33
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java68
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java70
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java94
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java35
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java45
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java30
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java168
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java39
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorOrderAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAccessorTypeAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyAttributeAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAnyElementAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttachmentRefAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlAttributeAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementDeclAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementRefsAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementWrapperAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlElementsAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlEnumValueAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlIDREFAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlInlineBinaryDataAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdapterAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlListAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMimeTypeAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlMixedAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlNsAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRegistryAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlRootElementAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypeAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSeeAlsoAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTransientAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlTypeAnnotation.java1
-rw-r--r--jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlValueAnnotation.java1
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JavaResourceModelTestCase.java179
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java11
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java10
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java18
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java10
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java18
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java46
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java90
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java82
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java54
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java58
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java14
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java30
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAnnotationTests.java8
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java38
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java18
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java30
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java12
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java8
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java22
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaAnnotationTests.java2
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAnnotationTests.java4
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java34
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAnnotationTests.java8
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java66
-rw-r--r--jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java12
197 files changed, 5592 insertions, 808 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationDefinitionProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationDefinitionProvider.java
new file mode 100644
index 0000000000..c5dfb9b527
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationDefinitionProvider.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core;
+
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+
+/**
+ * Provides annotationDefinitions for types and attributes. AnnotationProvider
+ * then uses a collection of these to build annotations.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface AnnotationDefinitionProvider
+{
+ /**
+ * Return all annotation definitions which can appear on a type
+ */
+ Iterable<AnnotationDefinition> getTypeAnnotationDefinitions();
+
+ /**
+ * Return all annotation definitions which can appear on a type and are used to determine
+ * whether and how the type is persisted (how it is "mapped").
+ * This should be a subset of {@link #typeAnnotationDefinitions()}.
+ */
+ Iterable<AnnotationDefinition> getTypeMappingAnnotationDefinitions();
+
+ /**
+ * Return all annotation definitions which can appear on an attribute
+ */
+ Iterable<AnnotationDefinition> getAttributeAnnotationDefinitions();
+
+ /**
+ * Return all annotation definitions which can appear on a package.
+ */
+ Iterable<AnnotationDefinition> getPackageAnnotationDefinitions();
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationProvider.java
new file mode 100644
index 0000000000..6d4ec49d9a
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/AnnotationProvider.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
+import org.eclipse.jpt.core.utility.jdt.Attribute;
+import org.eclipse.jpt.core.utility.jdt.Type;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+
+/**
+ * This is used to provide type and attribute annotations.
+ * Also provides list of supported annotation names, check the appropriate list
+ * before trying to build an annotation with that name. An exception will
+ * be thrown on an attempt to build an annotation that does not exist.
+ *
+ * This interface is not intended to be implemented. Instead implement
+ * AnnotationDefinitionProvider to extend the list of supported annotation definitions.
+ *
+ * @see AnnotationDefinitionProvider
+ * @version 3.0
+ * @since 3.0
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface AnnotationProvider
+{
+ // ********** type annotations **********
+
+ /**
+ * Return the names of the annotations that can appear on a type.
+ */
+ Iterable<String> getTypeAnnotationNames();
+
+ /**
+ * Return the names of the annotations that can appear on a type and are used to
+ * determine whether and how the type is persisted (how it is "mapped").
+ * This should be a subset of {@link #typeAnnotationNames()}.
+ */
+ Iterable<String> getTypeMappingAnnotationNames();
+
+ /**
+ * Build a type annotation with the specified name.
+ * Throw an IllegalArgumentException if the specified name is unsupported.
+ * @see #typeAnnotationNames()
+ */
+ Annotation buildTypeAnnotation(
+ JavaResourceType parent, Type type, String annotationName);
+
+ /**
+ * Build a type annotation for the specified JDT annotation.
+ * Throw an IllegalArgumentException if the specified annotation is unsupported.
+ * @see #typeAnnotationNames()
+ */
+ Annotation buildTypeAnnotation(
+ JavaResourceType parent, IAnnotation jdtAnnotation);
+
+ /**
+ * Build a null type annotation with the specified name.
+ * Throw an IllegalArgumentException if the specified annotation is unsupported.
+ * @see #typeAnnotationNames()
+ */
+ Annotation buildNullTypeAnnotation(
+ JavaResourceType parent, String annotationName);
+
+
+ // ********** attribute annotations **********
+
+ /**
+ * Return the names of the annotations that can appear on an attribute.
+ */
+ Iterable<String> getAttributeAnnotationNames();
+
+ /**
+ * Build an attribute annotation with the specified name.
+ * Throw an IllegalArgumentException if the specified name is unsupported.
+ * @see #attributeAnnotationNames()
+ */
+ Annotation buildAttributeAnnotation(
+ JavaResourceAttribute parent, Attribute attribute, String annotationName);
+
+ /**
+ * Build an attribute annotation for the specified JDT annotation.
+ * Throw an IllegalArgumentException if the specified annotation is unsupported.
+ * @see #attributeAnnotationNames()
+ */
+ Annotation buildAttributeAnnotation(
+ JavaResourceAttribute parent, IAnnotation jdtAnnotation);
+
+ /**
+ * Build a null attribute annotation with the specified name.
+ * Throw an IllegalArgumentException if the specified annotation is unsupported.
+ * @see #attributeMappingAnnotationNames()
+ */
+ Annotation buildNullAttributeAnnotation(
+ JavaResourceAttribute parent, String annotationName);
+
+
+ // ********** package annotations **********
+
+ /**
+ * Return the names of the annotations that can appear on a package.
+ */
+ Iterable<String> getPackageAnnotationNames();
+
+ /**
+ * Build an package annotation with the specified name.
+ * Throw an IllegalArgumentException if the specified name is unsupported.
+ * @see #packageAnnotationNames()
+ */
+ Annotation buildPackageAnnotation(
+ JavaResourcePackage parent, AnnotatedPackage pack, String annotationName);
+
+ /**
+ * Build a package annotation for the specified JDT annotation.
+ * Throw an IllegalArgumentException if the specified name is unsupported.
+ * @see #packageAnnotationNames()
+ */
+ Annotation buildPackageAnnotation(
+ JavaResourcePackage parent, IAnnotation jdtAnnotation);
+
+ /**
+ * Build a null package annotation with the specified name.
+ * Throw an IllegalArgumentException if the specified annotation is unsupported.
+ * @see #packageAnnotationNames()
+ */
+ Annotation buildNullPackageAnnotation(
+ JavaResourcePackage parent, String annotationName);
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractAnnotationDefintionProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractAnnotationDefintionProvider.java
new file mode 100644
index 0000000000..3ffd2ad1eb
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/AbstractAnnotationDefintionProvider.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
+import org.eclipse.jpt.utility.internal.iterables.ArrayListIterable;
+import org.eclipse.jpt.utility.internal.iterables.ListIterable;
+
+public abstract class AbstractAnnotationDefintionProvider
+ implements AnnotationDefinitionProvider
+{
+ private AnnotationDefinition[] typeAnnotationDefinitions;
+
+ private AnnotationDefinition[] typeMappingAnnotationDefinitions;
+
+ private AnnotationDefinition[] attributeAnnotationDefinitions;
+
+ private AnnotationDefinition[] packageAnnotationDefinitions;
+
+
+ protected AbstractAnnotationDefintionProvider() {
+ super();
+ }
+
+ // ********** type annotation definitions **********
+
+ public synchronized Iterable<AnnotationDefinition> getTypeAnnotationDefinitions() {
+ if (this.typeAnnotationDefinitions == null) {
+ this.typeAnnotationDefinitions = this.buildTypeAnnotationDefinitions();
+ }
+ return new ArrayIterable<AnnotationDefinition>(this.typeAnnotationDefinitions);
+ }
+
+ protected AnnotationDefinition[] buildTypeAnnotationDefinitions() {
+ ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
+ this.addTypeAnnotationDefinitionsTo(definitions);
+ return definitions.toArray(new AnnotationDefinition[definitions.size()]);
+ }
+
+ /**
+ * Subclasses must override this to specify type annotation definitions.
+ */
+ protected void addTypeAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
+ // no op
+ }
+
+ // ********** type mapping annotation definitions **********
+
+ public synchronized Iterable<AnnotationDefinition> getTypeMappingAnnotationDefinitions() {
+ if (this.typeMappingAnnotationDefinitions == null) {
+ this.typeMappingAnnotationDefinitions = this.buildTypeMappingAnnotationDefinitions();
+ }
+ return new ArrayIterable<AnnotationDefinition>(this.typeMappingAnnotationDefinitions);
+ }
+
+ protected AnnotationDefinition[] buildTypeMappingAnnotationDefinitions() {
+ ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
+ this.addTypeMappingAnnotationDefinitionsTo(definitions);
+ return definitions.toArray(new AnnotationDefinition[definitions.size()]);
+ }
+
+ /**
+ * Subclasses must override this to specify type mapping annotation
+ * definitions.
+ */
+ protected void addTypeMappingAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
+ // no op
+ }
+
+ // ********** attribute annotation definitions **********
+
+ public synchronized Iterable<AnnotationDefinition> getAttributeAnnotationDefinitions() {
+ if (this.attributeAnnotationDefinitions == null) {
+ this.attributeAnnotationDefinitions = this.buildAttributeAnnotationDefinitions();
+ }
+ return new ArrayListIterable<AnnotationDefinition>(this.attributeAnnotationDefinitions);
+ }
+
+ protected AnnotationDefinition[] buildAttributeAnnotationDefinitions() {
+ ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
+ this.addAttributeAnnotationDefinitionsTo(definitions);
+ return definitions.toArray(new AnnotationDefinition[definitions.size()]);
+ }
+
+ /**
+ * Subclasses must override this to specify attribute annotation
+ * definitions.
+ */
+ protected void addAttributeAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
+ // no op
+ }
+
+
+ // ********** package annotation definitions **********
+
+ public synchronized ListIterable<AnnotationDefinition> getPackageAnnotationDefinitions() {
+ if (this.packageAnnotationDefinitions == null) {
+ this.packageAnnotationDefinitions = this.buildPackageAnnotationDefinitions();
+ }
+ return new ArrayListIterable<AnnotationDefinition>(this.packageAnnotationDefinitions);
+ }
+
+ protected AnnotationDefinition[] buildPackageAnnotationDefinitions() {
+ ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
+ this.addPackageAnnotationDefinitionsTo(definitions);
+ return definitions.toArray(new AnnotationDefinition[definitions.size()]);
+ }
+
+ /**
+ * Subclasses must override this to specify package annotation
+ * definitions. No package annotation definitions by default.
+ */
+ protected void addPackageAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
+ // no op
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java
new file mode 100644
index 0000000000..9a43349880
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericAnnotationProvider.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
+import org.eclipse.jpt.core.utility.jdt.Attribute;
+import org.eclipse.jpt.core.utility.jdt.Type;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.utility.internal.iterables.ArrayListIterable;
+import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
+import org.eclipse.jpt.utility.internal.iterables.ListIterable;
+import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
+
+/**
+ * Delegate to annotation definition providers.
+ * The platform factory will build an instance of this annotation provider,
+ * passing in the appropriate array of annotation definition providers necessary
+ * to build the annotations for the platform (vendor and/or version).
+ */
+public final class GenericAnnotationProvider
+ implements AnnotationProvider
+{
+ private final AnnotationDefinitionProvider[] annotationDefinitionProviders;
+
+ public GenericAnnotationProvider(AnnotationDefinitionProvider... annotationDefinitionProviders) {
+ super();
+ this.annotationDefinitionProviders = annotationDefinitionProviders;
+ }
+
+
+ // ********** convenience methods **********
+
+ protected Iterable<String> getAnnotationNames(Iterable<AnnotationDefinition> annotationDefinitions) {
+ return new TransformationIterable<AnnotationDefinition, String>(annotationDefinitions) {
+ @Override
+ protected String transform(AnnotationDefinition annotationDefinition) {
+ return annotationDefinition.getAnnotationName();
+ }
+ };
+ }
+
+ protected AnnotationDefinition selectAnnotationDefinition(Iterable<AnnotationDefinition> annotationDefinitions, String annotationName) {
+ for (AnnotationDefinition annotationDefinition : annotationDefinitions) {
+ if (annotationDefinition.getAnnotationName().equals(annotationName)) {
+ return annotationDefinition;
+ }
+ }
+ return null;
+ }
+
+
+ // ********** annotation definition providers **********
+
+ protected ListIterable<AnnotationDefinitionProvider> getAnnotationDefinitionProviders() {
+ return new ArrayListIterable<AnnotationDefinitionProvider>(this.annotationDefinitionProviders);
+ }
+
+
+ // ********** type annotations **********
+
+ public Iterable<String> getTypeAnnotationNames() {
+ return this.getAnnotationNames(this.getTypeAnnotationDefinitions());
+ }
+
+ protected Iterable<AnnotationDefinition> getTypeAnnotationDefinitions() {
+ return new CompositeIterable<AnnotationDefinition> (
+ new TransformationIterable<AnnotationDefinitionProvider, Iterable<AnnotationDefinition>>(this.getAnnotationDefinitionProviders()) {
+ @Override
+ protected Iterable<AnnotationDefinition> transform(AnnotationDefinitionProvider annotationDefinitionProvider) {
+ return annotationDefinitionProvider.getTypeAnnotationDefinitions();
+ }
+ }
+ );
+ }
+
+ public Iterable<String> getTypeMappingAnnotationNames() {
+ return this.getAnnotationNames(getTypeMappingAnnotationDefinitions());
+ }
+
+ protected Iterable<AnnotationDefinition> getTypeMappingAnnotationDefinitions() {
+ return new CompositeIterable<AnnotationDefinition> (
+ new TransformationIterable<AnnotationDefinitionProvider, Iterable<AnnotationDefinition>>(this.getAnnotationDefinitionProviders()) {
+ @Override
+ protected Iterable<AnnotationDefinition> transform(AnnotationDefinitionProvider annotationDefinitionProvider) {
+ return annotationDefinitionProvider.getTypeMappingAnnotationDefinitions();
+ }
+ }
+ );
+ }
+
+ public Annotation buildTypeAnnotation(JavaResourceType parent, Type type, String annotationName) {
+ return this.getTypeAnnotationDefinition(annotationName).buildAnnotation(parent, type);
+ }
+
+ public Annotation buildTypeAnnotation(JavaResourceType parent, IAnnotation jdtAnnotation) {
+ return this.getTypeAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
+ }
+
+ protected AnnotationDefinition getTypeAnnotationDefinition(String annotationName) {
+ AnnotationDefinition annotationDefinition = this.selectAnnotationDefinition(this.getTypeAnnotationDefinitions(), annotationName);
+ if (annotationDefinition == null) {
+ throw new IllegalArgumentException("unsupported type annotation: " + annotationName); //$NON-NLS-1$
+ }
+ return annotationDefinition;
+ }
+
+ public Annotation buildNullTypeAnnotation(JavaResourceType parent, String annotationName) {
+ return this.getTypeAnnotationDefinition(annotationName).buildNullAnnotation(parent);
+ }
+
+
+ // ********** attribute annotations **********
+
+ public Iterable<String> getAttributeAnnotationNames() {
+ return this.getAnnotationNames(getAttributeAnnotationDefinitions());
+ }
+
+ protected Iterable<AnnotationDefinition> getAttributeAnnotationDefinitions() {
+ return new CompositeIterable<AnnotationDefinition> (
+ new TransformationIterable<AnnotationDefinitionProvider, Iterable<AnnotationDefinition>>(this.getAnnotationDefinitionProviders()) {
+ @Override
+ protected Iterable<AnnotationDefinition> transform(AnnotationDefinitionProvider annotationDefinitionProvider) {
+ return annotationDefinitionProvider.getAttributeAnnotationDefinitions();
+ }
+ }
+ );
+ }
+
+ public Annotation buildAttributeAnnotation(JavaResourceAttribute parent, Attribute attribute, String annotationName) {
+ return this.getAttributeAnnotationDefinition(annotationName).buildAnnotation(parent, attribute);
+ }
+
+ public Annotation buildAttributeAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
+ return this.getAttributeAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
+ }
+
+ public Annotation buildNullAttributeAnnotation(JavaResourceAttribute parent, String annotationName) {
+ return this.getAttributeAnnotationDefinition(annotationName).buildNullAnnotation(parent);
+ }
+
+ protected AnnotationDefinition getAttributeAnnotationDefinition(String annotationName) {
+ AnnotationDefinition annotationDefinition = this.selectAnnotationDefinition(this.getAttributeAnnotationDefinitions(), annotationName);
+ if (annotationDefinition == null) {
+ throw new IllegalArgumentException("unsupported attribute annotation: " + annotationName); //$NON-NLS-1$
+ }
+ return annotationDefinition;
+ }
+
+
+ // ********** package annotations **********
+
+ public Iterable<String> getPackageAnnotationNames() {
+ return getAnnotationNames(getPackageAnnotationDefinitions());
+ }
+
+ protected Iterable<AnnotationDefinition> getPackageAnnotationDefinitions() {
+ return new CompositeIterable<AnnotationDefinition> (
+ new TransformationIterable<AnnotationDefinitionProvider, Iterable<AnnotationDefinition>>(this.getAnnotationDefinitionProviders()) {
+ @Override
+ protected Iterable<AnnotationDefinition> transform(AnnotationDefinitionProvider annotationDefinitionProvider) {
+ return annotationDefinitionProvider.getPackageAnnotationDefinitions();
+ }
+ }
+ );
+ }
+
+ public Annotation buildPackageAnnotation(JavaResourcePackage parent, AnnotatedPackage pack, String annotationName) {
+ return this.getPackageAnnotationDefinition(annotationName).buildAnnotation(parent, pack);
+ }
+
+ public Annotation buildPackageAnnotation(JavaResourcePackage parent, IAnnotation jdtAnnotation) {
+ return this.getPackageAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
+ }
+
+ public Annotation buildNullPackageAnnotation(JavaResourcePackage parent, String annotationName) {
+ return this.getPackageAnnotationDefinition(annotationName).buildNullAnnotation(parent);
+ }
+
+ protected AnnotationDefinition getPackageAnnotationDefinition(String annotationName) {
+ AnnotationDefinition annotationDefinition = this.selectAnnotationDefinition(this.getPackageAnnotationDefinitions(), annotationName);
+ if (annotationDefinition == null) {
+ throw new IllegalArgumentException("unsupported package mapping annotation: " + annotationName); //$NON-NLS-1$
+ }
+ return annotationDefinition;
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbAnnotationDefinitionProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbAnnotationDefinitionProvider.java
index eea010f6f0..935be8a573 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbAnnotationDefinitionProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbAnnotationDefinitionProvider.java
@@ -10,9 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal;
import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.AbstractJpaAnnotationDefintionProvider;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorOrderAnnotationDefinition;
import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAccessorTypeAnnotationDefinition;
import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlAnyAttributeAnnotationDefinition;
@@ -44,22 +42,23 @@ import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlSeeAlsoAnnotationDefi
import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTransientAnnotationDefinition;
import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTypeAnnotationDefinition;
import org.eclipse.jpt.jaxb.core.internal.resource.java.XmlValueAnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
/**
* Support for JAXB annotations
*/
public class GenericJaxbAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefintionProvider
+ extends AbstractAnnotationDefintionProvider
{
// singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE =
+ private static final AnnotationDefinitionProvider INSTANCE =
new GenericJaxbAnnotationDefinitionProvider();
/**
* Return the singleton
*/
- public static JpaAnnotationDefinitionProvider instance() {
+ public static AnnotationDefinitionProvider instance() {
return INSTANCE;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformProvider.java
index 01eb79a7c1..8cdde915c3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/GenericJaxbPlatformProvider.java
@@ -12,7 +12,6 @@ package org.eclipse.jpt.jaxb.core.internal;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.core.JpaResourceType;
import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.jaxb.core.JavaResourceModelProvider;
import org.eclipse.jpt.jaxb.core.JaxbPlatformProvider;
import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
@@ -50,6 +49,9 @@ public class GenericJaxbPlatformProvider
if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
}
+ else if (contentType.equals(JptCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE)) {
+ return JptCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
+ }
// else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
// return JptCorePlugin.JAR_RESOURCE_TYPE;
// }
@@ -66,7 +68,8 @@ public class GenericJaxbPlatformProvider
protected JaxbResourceModelProvider[] buildResourceModelProviders() {
// order should not be important here
return new JaxbResourceModelProvider[] {
- JavaResourceModelProvider.instance()};
+ JavaResourceModelProvider.instance(),
+ JavaPackageInfoResourceModelProvider.instance()};
}
//
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
new file mode 100644
index 0000000000..78efe5520f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaPackageInfoResourceModelProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.jaxb.core.JaxbProject;
+import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
+import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+
+/**
+ * Java package-info.java source code
+ */
+public class JavaPackageInfoResourceModelProvider
+ implements JaxbResourceModelProvider
+{
+ // singleton
+ private static final JaxbResourceModelProvider INSTANCE = new JavaPackageInfoResourceModelProvider();
+
+ /**
+ * Return the singleton.
+ */
+ public static JaxbResourceModelProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private JavaPackageInfoResourceModelProvider() {
+ super();
+ }
+
+ public IContentType getContentType() {
+ return JptCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE;
+ }
+
+ public JavaResourceCompilationUnit buildResourceModel(JaxbProject jaxbProject, IFile file) {
+ return new SourcePackageInfoCompilationUnit(
+ JavaCore.createCompilationUnitFrom(file),
+ jaxbProject.getJaxbPlatform().getAnnotationProvider(),
+ jaxbProject.getJaxbPlatform().getAnnotationEditFormatter(),
+ jaxbProject.getModifySharedDocumentCommandExecutor()
+ );
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JavaResourceModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
index 23aac7f797..73843ddca6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/JavaResourceModelProvider.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/JavaResourceModelProvider.java
@@ -7,14 +7,16 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.jaxb.core;
+package org.eclipse.jpt.jaxb.core.internal;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.JaxbProject;
+import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
+import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceTypeCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
/**
* Java source code
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxbPlatformDefinition.java
index e9f3d942c0..7b914d1ac5 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxbPlatformDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/jaxb21/GenericJaxbPlatformDefinition.java
@@ -9,7 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.internal.jaxb21;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
import org.eclipse.jpt.jaxb.core.JaxbFactory;
import org.eclipse.jpt.jaxb.core.JaxbPlatformProvider;
import org.eclipse.jpt.jaxb.core.internal.GenericJaxbAnnotationDefinitionProvider;
@@ -44,8 +44,8 @@ public class GenericJaxbPlatformDefinition
return GenericJaxbPlatformProvider.instance();
}
- public JpaAnnotationDefinitionProvider[] getAnnotationDefinitionProviders() {
- return new JpaAnnotationDefinitionProvider[] {GenericJaxbAnnotationDefinitionProvider.instance()};
+ public AnnotationDefinitionProvider[] getAnnotationDefinitionProviders() {
+ return new AnnotationDefinitionProvider[] {GenericJaxbAnnotationDefinitionProvider.instance()};
}
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
index bbdb52b1ef..9ecf68c2db 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/platform/JaxbPlatformImpl.java
@@ -11,17 +11,17 @@ package org.eclipse.jpt.jaxb.core.internal.platform;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
import org.eclipse.jpt.core.internal.utility.PlatformTools;
import org.eclipse.jpt.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
import org.eclipse.jpt.jaxb.core.JaxbFactory;
import org.eclipse.jpt.jaxb.core.JaxbFile;
import org.eclipse.jpt.jaxb.core.JaxbPlatformProvider;
import org.eclipse.jpt.jaxb.core.JaxbProject;
import org.eclipse.jpt.jaxb.core.JaxbResourceModelProvider;
+import org.eclipse.jpt.jaxb.core.internal.GenericAnnotationProvider;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatform;
import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
@@ -31,14 +31,14 @@ public final class JaxbPlatformImpl
private final JaxbFactory jaxbFactory;
- private final JpaAnnotationProvider annotationProvider;
+ private final AnnotationProvider annotationProvider;
private final JaxbPlatformProvider platformProvider;
public JaxbPlatformImpl(JaxbPlatformDefinition jaxbPlatformDefinition) {
super();
this.jaxbFactory = jaxbPlatformDefinition.buildFactory();
- this.annotationProvider = new GenericJpaAnnotationProvider(jaxbPlatformDefinition.getAnnotationDefinitionProviders());
+ this.annotationProvider = new GenericAnnotationProvider(jaxbPlatformDefinition.getAnnotationDefinitionProviders());
this.platformProvider = jaxbPlatformDefinition.buildPlatformProvider();
}
@@ -87,7 +87,7 @@ public final class JaxbPlatformImpl
// ********** Java annotations **********
- public JpaAnnotationProvider getAnnotationProvider() {
+ public AnnotationProvider getAnnotationProvider() {
return this.annotationProvider;
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
index 6e7011fe7c..cecc953311 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorOrderAnnotationDefinition.java
@@ -10,12 +10,12 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorOrderAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorOrderAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
index 937a9a883e..441c4e82f2 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAccessorTypeAnnotationDefinition.java
@@ -10,12 +10,12 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAccessorTypeAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAccessorTypeAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
index 1717bb5eee..3b0edcab75 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyAttributeAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyAttributeAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyAttributeAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlAnyAttributeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyAttributeAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlAnyAttributeAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlAnyAttributeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyAttributeAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlAnyAttributeAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
index 6fe5c1ef8e..8323681339 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAnyElementAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAnyElementAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAnyElementAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlAnyElementAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAnyElementAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlAnyElementAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlAnyElementAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAnyElementAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlAnyElementAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
index f0677a587d..4fe2377c03 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttachmentRefAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttachmentRefAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttachmentRefAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlAttachmentRefAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttachmentRefAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlAttachmentRefAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlAttachmentRefAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttachmentRefAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlAttachmentRefAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
index 1de2934b4c..8ee70fb258 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlAttributeAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlAttributeAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlAttributeAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlAttributeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlAttributeAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlAttributeAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlAttributeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlAttributeAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlAttributeAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
index f732855edd..8ca806b342 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlElementAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlElementAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
index 0e3910b9a7..a25fb6e44d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementDeclAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.MethodAttribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementDeclAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementDeclAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlElementDeclAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementDeclAnnotation((JavaResourcePersistentAttribute) parent, (MethodAttribute) annotatedElement);
+ return new SourceXmlElementDeclAnnotation((JavaResourceAttribute) parent, (MethodAttribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlElementDeclAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementDeclAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlElementDeclAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
index 29971b987a..a5a7b804ff 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlElementRefAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementRefAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlElementRefAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
index a0e6826285..9726905af0 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementRefsAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementRefsAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementRefsAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlElementRefsAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementRefsAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlElementRefsAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlElementRefsAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementRefsAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlElementRefsAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
index b01965bfd0..a51d93185b 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementWrapperAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementWrapperAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementWrapperAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlElementWrapperAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementWrapperAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlElementWrapperAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlElementWrapperAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementWrapperAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlElementWrapperAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
index 4bd0e95849..2440c8d03d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlElementsAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlElementsAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlElementsAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlElementsAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlElementsAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlElementsAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlElementsAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlElementsAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlElementsAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
index 564eaa9839..3da83c4337 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlEnumAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
+ return new SourceXmlEnumAnnotation((JavaResourceType) parent, (Type) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlEnumAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
+ return new BinaryXmlEnumAnnotation((JavaResourceType) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
index 0d71a3f39d..18fe1ebfa8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlEnumValueAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.FieldAttribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlEnumValueAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlEnumValueAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlEnumValueAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlEnumValueAnnotation((JavaResourcePersistentAttribute) parent, (FieldAttribute) annotatedElement);
+ return new SourceXmlEnumValueAnnotation((JavaResourceAttribute) parent, (FieldAttribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlEnumValueAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlEnumValueAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlEnumValueAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
index c02bfc1441..4001eb3cbf 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlIDAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlIDAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlIDAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlIDAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
index 657b38bb3c..25c4c73a33 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlIDREFAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlIDREFAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlIDREFAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlIDREFAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlIDREFAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlIDREFAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlIDREFAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlIDREFAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlIDREFAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
index c5a6d6d5da..6419456cae 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlInlineBinaryDataAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Member;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlInlineBinaryDataAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlInlineBinaryDataAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlInlineBinaryDataAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlInlineBinaryDataAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
+ return new SourceXmlInlineBinaryDataAnnotation((JavaResourceMember) parent, (Member) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlInlineBinaryDataAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlInlineBinaryDataAnnotation((JavaResourcePersistentMember) parent, jdtAnnotation);
+ return new BinaryXmlInlineBinaryDataAnnotation((JavaResourceMember) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
index c07f610c41..8578353b47 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdapterAnnotationDefinition.java
@@ -10,12 +10,12 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlJavaTypeAdapterAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
index 26f99f8b81..7e49a99e86 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlJavaTypeAdaptersAnnotationDefinition.java
@@ -10,13 +10,13 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlJavaTypeAdaptersAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdaptersAnnotation;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
index f7d5487d24..323b08788e 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlListAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlListAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlListAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlListAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlListAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlListAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlListAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlListAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlListAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
index b2069444e1..e663350a32 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMimeTypeAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMimeTypeAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMimeTypeAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlMimeTypeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMimeTypeAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlMimeTypeAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlMimeTypeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMimeTypeAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlMimeTypeAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
index 0b6474f1a8..19cc0d78e8 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlMixedAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlMixedAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlMixedAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlMixedAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlMixedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlMixedAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlMixedAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlMixedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlMixedAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
index 863a86388f..8cfef1ee76 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRegistryAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRegistryAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRegistryAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlRegistryAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRegistryAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
+ return new SourceXmlRegistryAnnotation((JavaResourceType) parent, (Type) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlRegistryAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRegistryAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
+ return new BinaryXmlRegistryAnnotation((JavaResourceType) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
index 2dafb7f5b9..ba03fb7c62 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlRootElementAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlRootElementAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlRootElementAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlRootElementAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlRootElementAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
+ return new SourceXmlRootElementAnnotation((JavaResourceType) parent, (Type) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlRootElementAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlRootElementAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
+ return new BinaryXmlRootElementAnnotation((JavaResourceType) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
index a9347607c4..ef45796533 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
public class XmlSchemaAnnotationDefinition
implements AnnotationDefinition {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
index 36f3006ac0..8a7e874403 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypeAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaTypeAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
public class XmlSchemaTypeAnnotationDefinition
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
index b98d000f9e..e583951315 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSchemaTypesAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSchemaTypesAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
public class XmlSchemaTypesAnnotationDefinition
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
index 115a05eb87..93f0c28fbb 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlSeeAlsoAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlSeeAlsoAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlSeeAlsoAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlSeeAlsoAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlSeeAlsoAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
+ return new SourceXmlSeeAlsoAnnotation((JavaResourceType) parent, (Type) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlSeeAlsoAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlSeeAlsoAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
+ return new BinaryXmlSeeAlsoAnnotation((JavaResourceType) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
index f8b9fc086a..3c1719e1fb 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTransientAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Member;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTransientAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTransientAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlTransientAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTransientAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement);
+ return new SourceXmlTransientAnnotation((JavaResourceMember) parent, (Member) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlTransientAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTransientAnnotation((JavaResourcePersistentMember) parent, jdtAnnotation);
+ return new BinaryXmlTransientAnnotation((JavaResourceMember) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
index 475b763c1c..039f23f6a4 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlTypeAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlTypeAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlTypeAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlTypeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlTypeAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement);
+ return new SourceXmlTypeAnnotation((JavaResourceType) parent, (Type) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlTypeAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlTypeAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
+ return new BinaryXmlTypeAnnotation((JavaResourceType) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
index d626a13fbc..643fc54f71 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/XmlValueAnnotationDefinition.java
@@ -10,14 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.jaxb.core.internal.resource.java.binary.BinaryXmlValueAnnotation;
import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceXmlValueAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationDefinition;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
/**
@@ -44,7 +44,7 @@ public final class XmlValueAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceXmlValueAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement);
+ return new SourceXmlValueAnnotation((JavaResourceAttribute) parent, (Attribute) annotatedElement);
}
public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
@@ -52,7 +52,7 @@ public final class XmlValueAnnotationDefinition
}
public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryXmlValueAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
+ return new BinaryXmlValueAnnotation((JavaResourceAttribute) parent, jdtAnnotation);
}
public String getAnnotationName() {
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java
new file mode 100644
index 0000000000..4d4d02a961
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryAnnotation.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IMemberValuePair;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
+
+/**
+ * JAR annotation
+ */
+public abstract class BinaryAnnotation
+ extends BinaryNode
+ implements Annotation
+{
+ final IAnnotation jdtAnnotation;
+
+ protected BinaryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
+ super(parent);
+ this.jdtAnnotation = jdtAnnotation;
+ }
+
+
+ // ********** convenience methods **********
+
+ /**
+ * Return the values of the JDT annotation's member with the specified name.
+ */
+ protected Object[] getJdtMemberValues(String memberName) {
+ Object[] values = (Object[]) this.getJdtMemberValue(memberName);
+ return (values != null) ? values : EMPTY_OBJECT_ARRAY;
+ }
+ private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
+
+ /**
+ * Return the value of the JDT annotation's member with the specified name.
+ */
+ protected Object getJdtMemberValue(String memberName) {
+ IMemberValuePair pair = this.getJdtMemberValuePair(memberName);
+ return (pair == null) ? null : pair.getValue();
+ }
+
+ /**
+ * Return the JDT annotation's member-value pair with the specified name.
+ */
+ private IMemberValuePair getJdtMemberValuePair(String memberName) {
+ for (IMemberValuePair pair : this.getJdtMemberValuePairs()) {
+ if (pair.getMemberName().equals(memberName)) {
+ return pair;
+ }
+ }
+ return null;
+ }
+
+ private IMemberValuePair[] getJdtMemberValuePairs() {
+ try {
+ return this.jdtAnnotation.getMemberValuePairs();
+ } catch (JavaModelException ex) {
+ JptJaxbCorePlugin.log(ex);
+ return EMPTY_MEMBER_VALUE_PAIR_ARRAY;
+ }
+ }
+ private static final IMemberValuePair[] EMPTY_MEMBER_VALUE_PAIR_ARRAY = new IMemberValuePair[0];
+
+
+ // ********** Annotation implementation **********
+ public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
+ throw new UnsupportedOperationException();
+ }
+ public void newAnnotation() {
+ throw new UnsupportedOperationException();
+ }
+ public void removeAnnotation() {
+ throw new UnsupportedOperationException();
+ }
+
+ // ********** NestableAnnotation implementation **********
+ public void moveAnnotation(@SuppressWarnings("unused") int index) {
+ throw new UnsupportedOperationException();
+ }
+ public void initializeFrom(@SuppressWarnings("unused") NestableAnnotation oldAnnotation) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryContainerAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryContainerAnnotation.java
new file mode 100644
index 0000000000..c90f6da7c9
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryContainerAnnotation.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.ContainerAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
+
+/**
+ * JAR annotations do not support most of the container annotation protocol.
+ */
+public abstract class BinaryContainerAnnotation<T extends NestableAnnotation>
+ extends BinaryAnnotation
+ implements ContainerAnnotation<T>
+{
+
+ protected BinaryContainerAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
+ super(parent, jdtAnnotation);
+ }
+
+ public String getElementName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getNestedAnnotationName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public T addNestedAnnotation() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void syncAddNestedAnnotation(Annotation astAnnotation) {
+ throw new UnsupportedOperationException();
+ }
+
+ public T moveNestedAnnotation(int targetIndex, int sourceIndex) {
+ throw new UnsupportedOperationException();
+ }
+
+ public T removeNestedAnnotation(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void syncRemoveNestedAnnotations(int index) {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java
new file mode 100644
index 0000000000..bd94eaf54d
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/binary/BinaryNode.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.jaxb.core.internal.resource.java.source.AbstractJavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+
+/**
+ * Binary convenience methods
+ */
+// TODO hopefully this class can go away with some sort of refactoring of the
+// source and binary hierarchies...
+public abstract class BinaryNode
+ extends AbstractJavaResourceNode
+{
+
+ // ********** construction **********
+
+ protected BinaryNode(JavaResourceNode parent) {
+ super(parent);
+ }
+
+
+ // ********** JavaResourceNode implementation **********
+
+ @Override
+ public IFile getFile() {
+ return null; // only BinaryPackageFragmentRoot has a file...
+ }
+
+ public void update() {
+ // nothing by default
+ }
+
+ public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
+ throw new UnsupportedOperationException();
+ }
+
+ public TextRange getTextRange(CompilationUnit astRoot) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void initialize(CompilationUnit astRoot) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void synchronizeWith(CompilationUnit astRoot) {
+ throw new UnsupportedOperationException();
+ }
+
+}
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 504239bb11..d478266abb 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
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 5bec974962..db579c7864 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
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 da18569ae9..55e8917e7f 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlAnyAttributeAnnotation
implements XmlAnyAttributeAnnotation
{
- public BinaryXmlAnyAttributeAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlAnyAttributeAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 30a2f8ed64..8021bb7894 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
/**
@@ -28,7 +27,7 @@ public final class BinaryXmlAnyElementAnnotation
private String value;
- public BinaryXmlAnyElementAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlAnyElementAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.lax = this.buildLax();
this.value = this.buildValue();
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 774abad3a6..65abfe1313 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlAttachmentRefAnnotation
implements XmlAttachmentRefAnnotation
{
- public BinaryXmlAttachmentRefAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlAttachmentRefAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 71caa958a9..a500865d5d 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
/**
@@ -29,7 +28,7 @@ public final class BinaryXmlAttributeAnnotation
private Boolean required;
- public BinaryXmlAttributeAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlAttributeAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.name = this.buildName();
this.namespace = this.buildNamespace();
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 1c1089f9bd..51c8b394d8 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
/**
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 c1ae24fcfd..5beccf9e07 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
/**
@@ -32,7 +31,7 @@ public final class BinaryXmlElementDeclAnnotation
private String substitutionHeadNamespace;
- public BinaryXmlElementDeclAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlElementDeclAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.name = this.buildName();
this.namespace = this.buildNamespace();
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 44b022928b..b92aca7850 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
/**
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 9760ab437e..92d74f006f 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
@@ -11,9 +11,8 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import java.util.Vector;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
@@ -28,7 +27,7 @@ public class BinaryXmlElementRefsAnnotation
private final Vector<XmlElementRefAnnotation> xmlElementRefs;
- public BinaryXmlElementRefsAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlElementRefsAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.xmlElementRefs = this.buildXmlElementRefs();
}
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 50de725392..3f893528a8 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
/**
@@ -30,7 +29,7 @@ public final class BinaryXmlElementWrapperAnnotation
private Boolean required;
- public BinaryXmlElementWrapperAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlElementWrapperAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.name = this.buildName();
this.namespace = this.buildNamespace();
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 0d382b3e85..380f0019df 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
@@ -11,9 +11,8 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import java.util.Vector;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
@@ -28,7 +27,7 @@ public class BinaryXmlElementsAnnotation
private final Vector<XmlElementAnnotation> xmlElements;
- public BinaryXmlElementsAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlElementsAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.xmlElements = this.buildXmlElements();
}
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 6acb10d1e1..bb476db2f7 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
/**
@@ -27,7 +26,7 @@ public final class BinaryXmlEnumAnnotation
private String value;
- public BinaryXmlEnumAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlEnumAnnotation(JavaResourceType parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.value = this.buildValue();
}
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 29f8dcda42..b84f70ba9d 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
/**
@@ -27,7 +26,7 @@ public final class BinaryXmlEnumValueAnnotation
private String value;
- public BinaryXmlEnumValueAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlEnumValueAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.value = this.buildValue();
}
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 72a679b0c5..2ac9413c44 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlIDAnnotation
implements XmlIDAnnotation
{
- public BinaryXmlIDAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlIDAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 85e45968d1..f901a8f546 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlIDREFAnnotation
implements XmlIDREFAnnotation
{
- public BinaryXmlIDREFAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlIDREFAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 cbae7f549c..c06a25dc4d 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlInlineBinaryDataAnnotation
implements XmlInlineBinaryDataAnnotation
{
- public BinaryXmlInlineBinaryDataAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlInlineBinaryDataAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 d916c401c9..a2aca1ef63 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
/**
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 b1909568ef..61703edf82 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
/**
@@ -22,7 +21,8 @@ public final class BinaryXmlListAnnotation
implements XmlListAnnotation
{
- public BinaryXmlListAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlListAnnotation(JavaResourceAttribute
+ parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 f6fd9cb54d..dba2959a62 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
/**
@@ -27,7 +26,7 @@ public final class BinaryXmlMimeTypeAnnotation
private String value;
- public BinaryXmlMimeTypeAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlMimeTypeAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.value = this.buildValue();
}
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 e77b1278d1..9129246c98 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlMixedAnnotation
implements XmlMixedAnnotation
{
- public BinaryXmlMixedAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlMixedAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 c1a77342af..9242814305 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlRegistryAnnotation
implements XmlRegistryAnnotation
{
- public BinaryXmlRegistryAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlRegistryAnnotation(JavaResourceType parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 66e0332f97..8738354218 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
@@ -11,10 +11,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
/**
@@ -28,7 +27,7 @@ public final class BinaryXmlRootElementAnnotation
private String namespace;
- public BinaryXmlRootElementAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlRootElementAnnotation(JavaResourceType parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.name = this.buildName();
this.namespace = this.buildNamespace();
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 23a18ebaa1..37e77ba7ba 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
@@ -11,9 +11,8 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import java.util.Vector;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
import org.eclipse.jpt.utility.internal.iterables.LiveCloneListIterable;
@@ -28,7 +27,7 @@ public final class BinaryXmlSeeAlsoAnnotation
private final Vector<String> classes;
- public BinaryXmlSeeAlsoAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlSeeAlsoAnnotation(JavaResourceType parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.classes = this.buildClasses();
}
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 309b13ef6a..81c43cbd10 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlTransientAnnotation
implements XmlTransientAnnotation
{
- public BinaryXmlTransientAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlTransientAnnotation(JavaResourceMember parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
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 2a6cd5fe35..dbecd43162 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
@@ -12,10 +12,9 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import java.util.Vector;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
import org.eclipse.jpt.utility.internal.iterables.LiveCloneListIterable;
@@ -34,7 +33,7 @@ public final class BinaryXmlTypeAnnotation
private final Vector<String> propOrder;
- public BinaryXmlTypeAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlTypeAnnotation(JavaResourceType parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
this.factoryClass = this.buildFactoryClass();
this.factoryMethod = this.buildFactoryMethod();
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 83e8064662..18be1b4f11 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
@@ -10,8 +10,7 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.binary;
import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
/**
@@ -22,7 +21,7 @@ public final class BinaryXmlValueAnnotation
implements XmlValueAnnotation
{
- public BinaryXmlValueAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
+ public BinaryXmlValueAnnotation(JavaResourceAttribute parent, IAnnotation jdtAnnotation) {
super(parent, jdtAnnotation);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java
new file mode 100644
index 0000000000..0a96698252
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AbstractJavaResourceNode.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.utility.internal.model.AbstractModel;
+import org.eclipse.jpt.utility.internal.model.CallbackChangeSupport;
+import org.eclipse.jpt.utility.internal.model.ChangeSupport;
+
+/**
+ * Java resource containment hierarchy
+ */
+public abstract class AbstractJavaResourceNode
+ extends AbstractModel
+ implements JavaResourceNode
+{
+ protected final JavaResourceNode parent;
+
+
+ // ********** constructor **********
+
+ protected AbstractJavaResourceNode(JavaResourceNode parent) {
+ super();
+ this.checkParent(parent);
+ this.parent = parent;
+ }
+
+
+ // ********** parent **********
+
+ protected void checkParent(JavaResourceNode p) {
+ if (p == null) {
+ if (this.requiresParent()) {
+ throw new IllegalArgumentException("'parent' cannot be null"); //$NON-NLS-1$
+ }
+ } else {
+ if (this.forbidsParent()) {
+ throw new IllegalArgumentException("'parent' must be null"); //$NON-NLS-1$
+ }
+ }
+ }
+
+ protected boolean requiresParent() {
+ return true;
+ }
+
+ protected boolean forbidsParent() {
+ return ! this.requiresParent(); // assume 'parent' is not optional
+ }
+
+
+ // ********** change support callback hook **********
+
+ @Override
+ protected final ChangeSupport buildChangeSupport() {
+ return new CallbackChangeSupport(this, this.buildChangeSupportListener());
+ }
+
+ private CallbackChangeSupport.Listener buildChangeSupportListener() {
+ return new CallbackChangeSupport.Listener() {
+ public void aspectChanged(String aspectName) {
+ AbstractJavaResourceNode.this.aspectChanged(aspectName);
+ }
+ };
+ }
+
+ /**
+ * ignore the aspect name, we notify listeners of *every* change
+ */
+ protected void aspectChanged(@SuppressWarnings("unused") String aspectName) {
+ this.getRoot().resourceModelChanged();
+ }
+
+
+ // ********** JavaResourceNode implementation **********
+
+ /**
+ * @see org.eclipse.jpt.core.internal.resource.java.source.SourceCompilationUnit#getRoot()
+ * @see org.eclipse.jpt.core.internal.resource.java.binary.BinaryPackageFragmentRoot#getRoot()
+ * @see org.eclipse.jpt.core.internal.resource.java.binary.BinaryPersistentTypeCache#getRoot()
+ */
+ public Root getRoot() {
+ return this.parent.getRoot();
+ }
+
+ public IFile getFile() {
+ return this.getRoot().getFile();
+ }
+
+
+ // ********** convenience methods **********
+
+ protected AnnotationProvider getAnnotationProvider() {
+ return this.getRoot().getAnnotationProvider();
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AnnotationContainerTools.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AnnotationContainerTools.java
new file mode 100644
index 0000000000..d00a9ea415
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/AnnotationContainerTools.java
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jdt.core.dom.ArrayInitializer;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MemberValuePair;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationContainer;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+
+/**
+ * Utility methods for manipulating annotation containers.
+ */
+public final class AnnotationContainerTools {
+
+ /**
+ * Add a nested annotation to the specified annotation container
+ * at the specified index.
+ * This method modifies both the resource model annotation container and the
+ * AST; with <em>no</em> change notification.
+ */
+ public static <T extends NestableAnnotation> NestableAnnotation addNestedAnnotation(int index, AnnotationContainer<T> annotationContainer) {
+ // add a new annotation to the end of the list...
+ int sourceIndex = annotationContainer.getNestedAnnotationsSize();
+ T nestedAnnotation = annotationContainer.addNestedAnnotation();
+ nestedAnnotation.newAnnotation();
+ // ...then move it to the specified index
+ moveNestedAnnotation(index, sourceIndex, annotationContainer);
+ return nestedAnnotation;
+ }
+
+ /**
+ * Move the nested annotation at the specified source index in the
+ * specified annotation container to the specified target index.
+ * This method modifies both the resource model annotation container and the
+ * AST; with <em>no</em> change notification.
+ */
+ public static <T extends NestableAnnotation> void moveNestedAnnotation(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer) {
+ if (targetIndex != sourceIndex) {
+ moveNestedAnnotation_(targetIndex, sourceIndex, annotationContainer);
+ }
+ }
+
+ private static <T extends NestableAnnotation> void moveNestedAnnotation_(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer) {
+ NestableAnnotation nestedAnnotation = annotationContainer.moveNestedAnnotation(targetIndex, sourceIndex);
+ syncAstAnnotationsAfterMove(targetIndex, sourceIndex, annotationContainer, nestedAnnotation);
+ }
+
+ /**
+ * An annotation was moved within the specified annotation container from
+ * the specified source index to the specified target index.
+ * Synchronize the AST annotations with the resource model annotation container,
+ * starting with the lower index to prevent overlap.
+ */
+ private static <T extends NestableAnnotation> void syncAstAnnotationsAfterMove(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer, NestableAnnotation nestedAnnotation) {
+ // move the Java annotation to the end of the list...
+ nestedAnnotation.moveAnnotation(annotationContainer.getNestedAnnotationsSize());
+ // ...then shift the other AST annotations over one slot...
+ List<T> nestableAnnotations = CollectionTools.list(annotationContainer.getNestedAnnotations());
+ if (sourceIndex < targetIndex) {
+ for (int i = sourceIndex; i < targetIndex; i++) {
+ nestableAnnotations.get(i).moveAnnotation(i);
+ }
+ } else {
+ for (int i = sourceIndex; i > targetIndex; i-- ) {
+ nestableAnnotations.get(i).moveAnnotation(i);
+ }
+ }
+ // ...then move the AST annotation to the now empty slot at the target index
+ nestedAnnotation.moveAnnotation(targetIndex);
+ }
+
+ /**
+ * Remove the nested annotation at the specified index in the
+ * specified annotation container.
+ * This method modifies both the resource model annotation container and the
+ * AST; with <em>no</em> change notification.
+ */
+ public static <T extends NestableAnnotation> void removeNestedAnnotation(int index, AnnotationContainer<T> annotationContainer) {
+ T nestedAnnotation = annotationContainer.removeNestedAnnotation(index);
+ nestedAnnotation.removeAnnotation();
+ syncAstAnnotationsAfterRemove(index, annotationContainer);
+ }
+
+ /**
+ * An annotation was removed from the specified annotation container at the
+ * specified index.
+ * Synchronize the AST annotations with the resource model annotation container,
+ * starting at the specified index to prevent overlap.
+ */
+ private static <T extends NestableAnnotation> void syncAstAnnotationsAfterRemove(int index, AnnotationContainer<T> annotationContainer) {
+ List<T> nestableAnnotations = CollectionTools.list(annotationContainer.getNestedAnnotations());
+ for (int i = index; i < nestableAnnotations.size(); i++) {
+ // the indices are the same because the model annotations are
+ // already in the proper locations - it's the AST annotations that
+ // need to be moved to the matching location
+ nestableAnnotations.get(i).moveAnnotation(i);
+ }
+ }
+
+ /**
+ * Initialize the specified resource model annotation container to be in
+ * sync with the specified AST. No change notification will occur.
+ */
+ public static <T extends NestableAnnotation> void initialize(AnnotationContainer<T> annotationContainer, CompilationUnit astRoot) {
+ // ignore the nested AST annotations themselves
+ // (maybe someday we can use them during initialization...)
+ int size = getNestedAstAnnotations(astRoot, annotationContainer).size();
+ for (int i = 0; i < size; i++) {
+ T nestedAnnotation = annotationContainer.addNestedAnnotation();
+ nestedAnnotation.initialize(astRoot);
+ }
+ }
+
+ /**
+ * Return a list of the nested AST annotations.
+ */
+ private static <T extends NestableAnnotation> ArrayList<Annotation> getNestedAstAnnotations(CompilationUnit astRoot, AnnotationContainer<T> annotationContainer) {
+ ArrayList<Annotation> result = new ArrayList<Annotation>();
+ Annotation astContainerAnnotation = annotationContainer.getAstAnnotation(astRoot);
+ if (astContainerAnnotation == null || astContainerAnnotation.isMarkerAnnotation()) {
+ // no nested annotations
+ }
+ else if (astContainerAnnotation.isSingleMemberAnnotation()) {
+ if (annotationContainer.getElementName().equals("value")) { //$NON-NLS-1$
+ Expression ex = ((SingleMemberAnnotation) astContainerAnnotation).getValue();
+ addAstAnnotationsTo(ex, annotationContainer.getNestedAnnotationName(), result);
+ } else {
+ // no nested annotations
+ }
+ }
+ else if (astContainerAnnotation.isNormalAnnotation()) {
+ MemberValuePair pair = getMemberValuePair((NormalAnnotation) astContainerAnnotation, annotationContainer.getElementName());
+ if (pair == null) {
+ // no nested annotations
+ } else {
+ addAstAnnotationsTo(pair.getValue(), annotationContainer.getNestedAnnotationName(), result);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Add whatever annotations are represented by the specified expression to
+ * the specified list. Do not add null to the list for any non-annotation expression.
+ */
+ private static void addAstAnnotationsTo(Expression expression, String annotationName, ArrayList<Annotation> astAnnotations) {
+ if (expression == null) {
+ //do not add null to the list, not sure how we would get here...
+ }
+ else if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
+ addAstAnnotationsTo((ArrayInitializer) expression, annotationName, astAnnotations);
+ }
+ else {
+ Annotation astAnnotation = getAstAnnotation_(expression, annotationName);
+ if (astAnnotation != null) {
+ astAnnotations.add(astAnnotation);
+ }
+ }
+ }
+
+ private static void addAstAnnotationsTo(ArrayInitializer arrayInitializer, String annotationName, ArrayList<Annotation> astAnnotations) {
+ @SuppressWarnings("unchecked")
+ List<Expression> expressions = arrayInitializer.expressions();
+ for (Expression expression : expressions) {
+ Annotation astAnnotation = getAstAnnotation(expression, annotationName);
+ if (astAnnotation != null) {
+ astAnnotations.add(astAnnotation);
+ }
+ }
+ }
+
+ /**
+ * If the specified expression is an annotation with the specified name, return it;
+ * otherwise return null.
+ */
+ private static Annotation getAstAnnotation(Expression expression, String annotationName) {
+ // not sure how the expression could be null...
+ return (expression == null) ? null : getAstAnnotation_(expression, annotationName);
+ }
+
+ /**
+ * pre-condition: expression is not null
+ */
+ private static Annotation getAstAnnotation_(Expression expression, String annotationName) {
+ switch (expression.getNodeType()) {
+ case ASTNode.NORMAL_ANNOTATION:
+ case ASTNode.SINGLE_MEMBER_ANNOTATION:
+ case ASTNode.MARKER_ANNOTATION:
+ Annotation astAnnotation = (Annotation) expression;
+ if (getQualifiedName(astAnnotation).equals(annotationName)) {
+ return astAnnotation;
+ }
+ return null;
+ default:
+ return null;
+ }
+ }
+
+ private static String getQualifiedName(Annotation astAnnotation) {
+ ITypeBinding typeBinding = astAnnotation.resolveTypeBinding();
+ if (typeBinding != null) {
+ String resolvedName = typeBinding.getQualifiedName();
+ if (resolvedName != null) {
+ return resolvedName;
+ }
+ }
+ return astAnnotation.getTypeName().getFullyQualifiedName();
+ }
+
+ private static MemberValuePair getMemberValuePair(NormalAnnotation annotation, String elementName) {
+ @SuppressWarnings("unchecked")
+ List<MemberValuePair> pairs = annotation.values();
+ for (MemberValuePair pair : pairs) {
+ if (pair.getName().getFullyQualifiedName().equals(elementName)) {
+ return pair;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Synchronize the resource model annotations in the specified annotation
+ * container with those in the specified AST. Trigger the appropriate change
+ * notification.
+ */
+ public static <T extends NestableAnnotation> void synchronize(AnnotationContainer<T> annotationContainer, CompilationUnit astRoot) {
+ ArrayList<Annotation> astAnnotations = getNestedAstAnnotations(astRoot, annotationContainer);
+ Iterator<Annotation> astAnnotationStream = astAnnotations.iterator();
+
+ for (T nestedAnnotation : annotationContainer.getNestedAnnotations()) {
+ if (astAnnotationStream.hasNext()) {
+ // matching AST annotation is present - synchronize the nested annotation
+ astAnnotationStream.next(); // maybe someday we can pass this to the update
+ nestedAnnotation.synchronizeWith(astRoot);
+ } else {
+ // no more AST annotations - remove the remaining nested annotations and exit
+ annotationContainer.syncRemoveNestedAnnotations(astAnnotations.size());
+ return;
+ }
+ }
+
+ // add nested annotations for any remaining AST annotations
+ while (astAnnotationStream.hasNext()) {
+ annotationContainer.syncAddNestedAnnotation(astAnnotationStream.next());
+ }
+ }
+
+ private AnnotationContainerTools() {
+ super();
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java
new file mode 100644
index 0000000000..b768998293
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotatedElement.java
@@ -0,0 +1,435 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Vector;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.MarkerAnnotation;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.eclipse.jpt.core.internal.utility.jdt.ASTNodeTextRange;
+import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.ContainerAnnotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
+import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
+import org.eclipse.jpt.utility.internal.iterables.SingleElementIterable;
+
+/**
+ * Java source annotated element (annotations)
+ */
+abstract class SourceAnnotatedElement<A extends AnnotatedElement>
+ extends SourceNode
+ implements JavaResourceAnnotatedElement
+{
+ final A annotatedElement;
+
+ /**
+ * annotations; no duplicates (java compiler has an error for duplicates)
+ */
+ final Vector<Annotation> annotations = new Vector<Annotation>();
+
+
+ // ********** construction/initialization **********
+
+ SourceAnnotatedElement(JavaResourceNode parent, A annotatedElement) {
+ super(parent);
+ this.annotatedElement = annotatedElement;
+ }
+
+ public void initialize(CompilationUnit astRoot) {
+ this.annotatedElement.getBodyDeclaration(astRoot).accept(this.buildInitialAnnotationVisitor(astRoot));
+ }
+
+ private ASTVisitor buildInitialAnnotationVisitor(CompilationUnit astRoot) {
+ return new InitialAnnotationVisitor(astRoot, this.annotatedElement.getBodyDeclaration(astRoot));
+ }
+
+ /**
+ * called from {@link InitialAnnotationVisitor}
+ */
+ /* private */ void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot) {
+ String jdtAnnotationName = ASTTools.resolveAnnotation(node);
+ if (jdtAnnotationName != null) {
+ this.addInitialAnnotation(jdtAnnotationName, astRoot);
+ }
+ }
+
+ /**
+ * pre-condition: jdtAnnotationName is not null
+ */
+ void addInitialAnnotation(String jdtAnnotationName, CompilationUnit astRoot) {
+ if (this.annotationIsValid(jdtAnnotationName)) {
+ if (this.selectAnnotationNamed(this.annotations, jdtAnnotationName) == null) { // ignore duplicates
+ Annotation annotation = this.buildAnnotation(jdtAnnotationName);
+ annotation.initialize(astRoot);
+ this.annotations.add(annotation);
+ }
+ }
+ }
+
+ public void synchronizeWith(CompilationUnit astRoot) {
+ this.syncAnnotations(astRoot);
+ }
+
+
+ // ********** annotations **********
+
+ public Iterable<Annotation> getAnnotations() {
+ return new LiveCloneIterable<Annotation>(this.annotations);
+ }
+
+ public int getAnnotationsSize() {
+ return this.annotations.size();
+ }
+
+ public Annotation getAnnotation(String annotationName) {
+ return this.selectAnnotationNamed(this.getAnnotations(), annotationName);
+ }
+
+ public Annotation getNonNullAnnotation(String annotationName) {
+ Annotation annotation = this.getAnnotation(annotationName);
+ return (annotation != null) ? annotation : this.buildNullAnnotation(annotationName);
+ }
+
+ public Iterable<NestableAnnotation> getAnnotations(String nestableAnnotationName, String containerAnnotationName) {
+ ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
+ if (containerAnnotation != null) {
+ return containerAnnotation.getNestedAnnotations();
+ }
+ NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName);
+ if (nestableAnnotation != null) {
+ return new SingleElementIterable<NestableAnnotation>(nestableAnnotation);
+ }
+ return EmptyIterable.instance();
+ }
+
+ // minimize scope of suppressed warnings
+ @SuppressWarnings("unchecked")
+ private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) {
+ return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName);
+ }
+
+ private NestableAnnotation getNestableAnnotation(String annotationName) {
+ return (NestableAnnotation) this.getAnnotation(annotationName);
+ }
+
+ public Annotation addAnnotation(String annotationName) {
+ Annotation annotation = this.buildAnnotation(annotationName);
+ this.annotations.add(annotation);
+ annotation.newAnnotation();
+ return annotation;
+ }
+
+ /**
+ * 1. check for a container annotation;
+ * if it is present, add a nested annotation to it
+ * 2. check for a stand-alone nested annotation;
+ * if it is missing, add a stand-alone nested annotation
+ * 3. if there is an existing stand-alone nested annotation,
+ * add a container annotation and move the stand-alone nested annotation to it
+ * and add a new nested annotation to it also
+ */
+ public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
+ ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
+ if (containerAnnotation != null) {
+ // ignore any stand-alone nestable annotations and just add to the container annotation
+ return AnnotationContainerTools.addNestedAnnotation(index, containerAnnotation);
+ }
+ NestableAnnotation standAloneAnnotation = this.getNestableAnnotation(nestableAnnotationName);
+ if (standAloneAnnotation == null) {
+ // add a stand-alone nestable annotation since neither the nestable nor the container exist
+ return (NestableAnnotation) this.addAnnotation(nestableAnnotationName);
+ }
+ // move the stand-alone nestable annotation to a container and add another nestable
+ return this.addSecondNestedAnnotation(index, containerAnnotationName, standAloneAnnotation);
+ }
+
+ /**
+ * "move" the existing nestable annotation to a new container annotation and
+ * add a new nestable annotation at the specified index (which should be 0 or 1)
+ */
+ private NestableAnnotation addSecondNestedAnnotation(int index, String containerAnnotationName, NestableAnnotation standAloneAnnotation) {
+ ContainerAnnotation<NestableAnnotation> containerAnnotation = this.buildContainerAnnotation(containerAnnotationName);
+ this.annotations.add(containerAnnotation);
+ containerAnnotation.newAnnotation();
+
+ NestableAnnotation nestedAnnotation0 = containerAnnotation.addNestedAnnotation();
+ nestedAnnotation0.newAnnotation();
+ NestableAnnotation nestedAnnotation1 = containerAnnotation.addNestedAnnotation();
+ nestedAnnotation1.newAnnotation();
+ this.removeAnnotation(standAloneAnnotation);
+
+ if (index == 0) {
+ // adding new annotation at 0, so stand-alone is "copied" to slot 1
+ nestedAnnotation1.initializeFrom(standAloneAnnotation);
+ } else {
+ // adding new annotation at 1, so stand-alone is "copied" to slot 0
+ nestedAnnotation0.initializeFrom(standAloneAnnotation);
+ }
+
+ return (index == 0) ? nestedAnnotation0 : nestedAnnotation1;
+ }
+
+ public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
+ this.moveAnnotation(targetIndex, sourceIndex, this.getContainerAnnotation(containerAnnotationName));
+ }
+
+ private void moveAnnotation(int targetIndex, int sourceIndex, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
+ AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, containerAnnotation);
+ }
+
+ public void removeAnnotation(String annotationName) {
+ Annotation annotation = this.getAnnotation(annotationName);
+ if (annotation != null) {
+ this.removeAnnotation(annotation);
+ }
+ }
+
+ private void removeAnnotation(Annotation annotation) {
+ this.annotations.remove(annotation);
+ annotation.removeAnnotation();
+ }
+
+ public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
+ ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
+ if (containerAnnotation == null) { // assume the index is 0
+ this.removeAnnotation(this.getAnnotation(nestableAnnotationName));
+ } else {
+ this.removeAnnotation(index, containerAnnotation);
+ }
+ }
+
+ /**
+ * after we remove the nested annotation, check to see whether we need to
+ * either remove the container (if it is empty) or convert the last nested
+ * annotation to a stand-alone annotation
+ */
+ private void removeAnnotation(int index, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
+ AnnotationContainerTools.removeNestedAnnotation(index, containerAnnotation);
+ switch (containerAnnotation.getNestedAnnotationsSize()) {
+ case 0:
+ this.removeAnnotation(containerAnnotation);
+ break;
+ case 1:
+ this.convertLastNestedAnnotation(containerAnnotation);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * convert the last nested annotation in the container to a stand-alone
+ * annotation
+ */
+ private void convertLastNestedAnnotation(ContainerAnnotation<NestableAnnotation> containerAnnotation) {
+ NestableAnnotation lastNestedAnnotation = containerAnnotation.getNestedAnnotations().iterator().next();
+ this.annotations.remove(containerAnnotation);
+ containerAnnotation.removeAnnotation();
+
+ NestableAnnotation standAloneAnnotation = this.buildNestableAnnotation(lastNestedAnnotation.getAnnotationName());
+ this.annotations.add(standAloneAnnotation);
+ standAloneAnnotation.newAnnotation();
+ standAloneAnnotation.initializeFrom(lastNestedAnnotation);
+ }
+
+ private boolean annotationIsValid(String annotationName) {
+ return CollectionTools.contains(this.getValidAnnotationNames(), annotationName);
+ }
+
+ abstract Iterable<String> getValidAnnotationNames();
+
+ abstract Annotation buildAnnotation(String annotationName);
+
+ abstract Annotation buildNullAnnotation(String annotationName);
+
+ // minimize scope of suppressed warnings
+ @SuppressWarnings("unchecked")
+ private ContainerAnnotation<NestableAnnotation> buildContainerAnnotation(String annotationName) {
+ return (ContainerAnnotation<NestableAnnotation>) this.buildAnnotation(annotationName);
+ }
+
+ private NestableAnnotation buildNestableAnnotation(String annotationName) {
+ return (NestableAnnotation) this.buildAnnotation(annotationName);
+ }
+
+ private void syncAnnotations(CompilationUnit astRoot) {
+ HashSet<Annotation> annotationsToRemove = new HashSet<Annotation>(this.annotations);
+
+ this.annotatedElement.getBodyDeclaration(astRoot).accept(this.buildSynchronizeAnnotationVisitor(astRoot, annotationsToRemove));
+
+ for (Annotation annotation : annotationsToRemove) {
+ this.removeItemFromCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
+ }
+ }
+
+ private ASTVisitor buildSynchronizeAnnotationVisitor(CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
+ return new SynchronizeAnnotationVisitor(astRoot, this.annotatedElement.getBodyDeclaration(astRoot), annotationsToRemove);
+ }
+
+ /**
+ * called from {@link SynchronizeAnnotationVisitor}
+ */
+ /* private */ void addOrSyncAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
+ String jdtAnnotationName = ASTTools.resolveAnnotation(node);
+ if (jdtAnnotationName != null) {
+ this.addOrSyncAnnotation(jdtAnnotationName, astRoot, annotationsToRemove);
+ }
+ }
+
+ /**
+ * pre-condition: jdtAnnotationName is not null
+ */
+ void addOrSyncAnnotation(String jdtAnnotationName, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
+ if (this.annotationIsValid(jdtAnnotationName)) {
+ this.addOrSyncAnnotation_(jdtAnnotationName, astRoot, annotationsToRemove);
+ }
+ }
+
+ /**
+ * pre-condition: jdtAnnotationName is valid
+ */
+ private void addOrSyncAnnotation_(String jdtAnnotationName, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
+ Annotation annotation = this.selectAnnotationNamed(annotationsToRemove, jdtAnnotationName);
+ if (annotation != null) {
+ annotation.synchronizeWith(astRoot);
+ annotationsToRemove.remove(annotation);
+ } else {
+ annotation = this.buildAnnotation(jdtAnnotationName);
+ annotation.initialize(astRoot);
+ this.addItemToCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
+ }
+ }
+
+
+ // ********** miscellaneous **********
+
+ public boolean isAnnotated() {
+ return ! this.annotations.isEmpty();
+ }
+
+ public TextRange getTextRange(CompilationUnit astRoot) {
+ return this.fullTextRange(astRoot);
+ }
+
+ private TextRange fullTextRange(CompilationUnit astRoot) {
+ return this.buildTextRange(this.annotatedElement.getBodyDeclaration(astRoot));
+ }
+
+ public TextRange getNameTextRange(CompilationUnit astRoot) {
+ return this.annotatedElement.getNameTextRange(astRoot);
+ }
+
+ private Annotation selectAnnotationNamed(Iterable<Annotation> list, String annotationName) {
+ for (Annotation annotation : list) {
+ if (annotation.getAnnotationName().equals(annotationName)) {
+ return annotation;
+ }
+ }
+ return null;
+ }
+
+ private TextRange buildTextRange(ASTNode astNode) {
+ return (astNode == null) ? null : new ASTNodeTextRange(astNode);
+ }
+
+
+ // ********** AST visitors **********
+
+ /**
+ * annotation visitor
+ */
+ protected static abstract class AnnotationVisitor
+ extends ASTVisitor
+ {
+ protected final CompilationUnit astRoot;
+ protected final ASTNode node;
+
+
+ protected AnnotationVisitor(CompilationUnit astRoot, ASTNode node) {
+ super();
+ this.astRoot = astRoot;
+ this.node = node;
+ }
+
+ @Override
+ public boolean visit(SingleMemberAnnotation node) {
+ return this.visit_(node);
+ }
+
+ @Override
+ public boolean visit(NormalAnnotation node) {
+ return this.visit_(node);
+ }
+
+ @Override
+ public boolean visit(MarkerAnnotation node) {
+ return this.visit_(node);
+ }
+
+ protected boolean visit_(org.eclipse.jdt.core.dom.Annotation node) {
+ // ignore annotations for child members, only this member
+ if (node.getParent() == this.node) {
+ this.visitChildAnnotation(node);
+ }
+ return false;
+ }
+
+ protected abstract void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node);
+ }
+
+
+ /**
+ * initial annotation visitor
+ */
+ protected class InitialAnnotationVisitor
+ extends AnnotationVisitor
+ {
+ protected InitialAnnotationVisitor(CompilationUnit astRoot, ASTNode node) {
+ super(astRoot, node);
+ }
+
+ @Override
+ protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
+ SourceAnnotatedElement.this.addInitialAnnotation(node, this.astRoot);
+ }
+ }
+
+
+ /**
+ * synchronize annotation visitor
+ */
+ protected class SynchronizeAnnotationVisitor
+ extends AnnotationVisitor
+ {
+ protected final Set<Annotation> annotationsToRemove;
+
+ protected SynchronizeAnnotationVisitor(CompilationUnit astRoot, ASTNode node, Set<Annotation> annotationsToRemove) {
+ super(astRoot, node);
+ this.annotationsToRemove = annotationsToRemove;
+ }
+
+ @Override
+ protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
+ SourceAnnotatedElement.this.addOrSyncAnnotation(node, this.astRoot, this.annotationsToRemove);
+ }
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java
new file mode 100644
index 0000000000..66c25f25d4
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAnnotation.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jpt.core.internal.utility.jdt.ASTNodeTextRange;
+import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
+import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+
+/**
+ * some common state and behavior for Java source annotations;
+ * and lots of convenience methods
+ */
+public abstract class SourceAnnotation<A extends AnnotatedElement>
+ extends SourceNode
+ implements Annotation
+{
+ protected final A annotatedElement;
+
+ protected final DeclarationAnnotationAdapter daa;
+
+ protected final AnnotationAdapter annotationAdapter;
+
+
+ /**
+ * constructor for straight member annotation
+ */
+ protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa) {
+ this(parent, annotatedElement, daa, new ElementAnnotationAdapter(annotatedElement, daa));
+ }
+
+ /**
+ * constructor for nested annotation (typically)
+ */
+ protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
+ super(parent);
+ this.annotatedElement = annotatedElement;
+ this.daa = daa;
+ this.annotationAdapter = annotationAdapter;
+ }
+
+
+ // ********** JavaResourceNode implementation **********
+
+ public TextRange getTextRange(CompilationUnit astRoot) {
+ return this.getAnnotationTextRange(astRoot);
+ }
+
+
+ // ********** Annotation implementation **********
+
+ public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
+ return this.annotationAdapter.getAnnotation(astRoot);
+ }
+
+ public void newAnnotation() {
+ this.annotationAdapter.newMarkerAnnotation();
+ }
+
+ public void removeAnnotation() {
+ this.annotationAdapter.removeAnnotation();
+ }
+
+
+ // ********** convenience methods **********
+
+ /**
+ * Return the text range corresponding to the annotation.
+ * If the annotation is missing, return null.
+ */
+ protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
+ return this.getTextRange(this.getAstAnnotation(astRoot));
+ }
+
+ /**
+ * Convenience method.
+ * Return the text range corresponding to the specified element.
+ * If the specified element is missing, return the annotation's text range instead.
+ */
+ protected TextRange getElementTextRange(DeclarationAnnotationElementAdapter<?> elementAdapter, CompilationUnit astRoot) {
+ return this.getElementTextRange(this.getAnnotationElementTextRange(elementAdapter, astRoot), astRoot);
+ }
+
+ /**
+ * Convenience method. If the specified element text range is null
+ * return the member's text range instead.
+ */
+ protected TextRange getElementTextRange(TextRange elementTextRange, CompilationUnit astRoot) {
+ return (elementTextRange != null) ? elementTextRange : this.getAnnotationTextRange(astRoot);
+ }
+
+ /**
+ * Convenience method. Return whether the specified position exists and
+ * touches the specified element.
+ */
+ protected boolean elementTouches(DeclarationAnnotationElementAdapter<?> elementAdapter, int pos, CompilationUnit astRoot) {
+ return this.textRangeTouches(this.getAnnotationElementTextRange(elementAdapter, astRoot), pos);
+ }
+
+ /**
+ * Convenience method. Return whether the specified text range is not
+ * null (meaning the corresponding AST node exists) and the specified position touches it.
+ */
+ protected boolean textRangeTouches(TextRange textRange, int pos) {
+ return (textRange != null) && textRange.touches(pos);
+ }
+
+ /**
+ * Return the text range corresponding to the specified element.
+ * If the element is missing, return null.
+ */
+ protected TextRange getAnnotationElementTextRange(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
+ return this.getTextRange(this.getAnnotationElementExpression(adapter, astRoot));
+ }
+
+ /**
+ * Return the specified AST DOM element.
+ */
+ protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
+ return adapter.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot));
+ }
+
+ /**
+ * Return the text range corresponding to the specified AST node.
+ * If the AST node is null, return null.
+ */
+ protected TextRange getTextRange(ASTNode astNode) {
+ return (astNode == null) ? null : new ASTNodeTextRange(astNode);
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java
new file mode 100644
index 0000000000..c1ea323d38
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceAttribute.java
@@ -0,0 +1,398 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Vector;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jpt.core.internal.utility.jdt.JDTFieldAttribute;
+import org.eclipse.jpt.core.internal.utility.jdt.JDTMethodAttribute;
+import org.eclipse.jpt.core.utility.jdt.Attribute;
+import org.eclipse.jpt.core.utility.jdt.MethodAttribute;
+import org.eclipse.jpt.core.utility.jdt.Type;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
+import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
+import org.eclipse.jpt.utility.MethodSignature;
+import org.eclipse.jpt.utility.internal.ClassName;
+import org.eclipse.jpt.utility.internal.iterables.ListIterable;
+import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
+import org.eclipse.jpt.utility.internal.iterables.LiveCloneListIterable;
+
+/**
+ * Java source persistent attribute (field or property)
+ */
+final class SourceAttribute
+ extends SourceMember<Attribute>
+ implements JavaResourceAttribute
+{
+ private int modifiers;
+
+ private String typeName;
+
+ private boolean typeIsInterface;
+
+ private boolean typeIsEnum;
+
+ private final Vector<String> typeSuperclassNames = new Vector<String>();
+
+ private final Vector<String> typeInterfaceNames = new Vector<String>();
+
+ private final Vector<String> typeTypeArgumentNames = new Vector<String>();
+
+
+ /**
+ * construct field attribute
+ */
+ static JavaResourceAttribute newInstance(
+ JavaResourceType parent,
+ Type declaringType,
+ String name,
+ int occurrence,
+ JavaResourceCompilationUnit javaResourceCompilationUnit,
+ CompilationUnit astRoot) {
+ Attribute attribute = new JDTFieldAttribute(
+ declaringType,
+ name,
+ occurrence,
+ javaResourceCompilationUnit.getCompilationUnit(),
+ javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
+ javaResourceCompilationUnit.getAnnotationEditFormatter());
+ JavaResourceAttribute jrpa = new SourceAttribute(parent, attribute);
+ jrpa.initialize(astRoot);
+ return jrpa;
+ }
+
+ /**
+ * construct property attribute
+ */
+ static JavaResourceAttribute newInstance(
+ JavaResourceType parent,
+ Type declaringType,
+ MethodSignature signature,
+ int occurrence,
+ JavaResourceCompilationUnit javaResourceCompilationUnit,
+ CompilationUnit astRoot) {
+ Attribute attribute = JDTMethodAttribute.newInstance(
+ declaringType,
+ signature,
+ occurrence,
+ javaResourceCompilationUnit.getCompilationUnit(),
+ javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
+ javaResourceCompilationUnit.getAnnotationEditFormatter());
+ JavaResourceAttribute jrpa = new SourceAttribute(parent, attribute);
+ jrpa.initialize(astRoot);
+ return jrpa;
+ }
+
+ private SourceAttribute(JavaResourceType parent, Attribute attribute){
+ super(parent, attribute);
+ }
+
+ @Override
+ public void initialize(CompilationUnit astRoot) {
+ super.initialize(astRoot);
+ ITypeBinding typeBinding = this.getTypeBinding(astRoot); //build once, minor performance tweak for major benefit
+ this.modifiers = this.buildModifiers(astRoot);
+ this.typeName = this.buildTypeName(typeBinding);
+ this.typeIsInterface = this.buildTypeIsInterface(typeBinding);
+ this.typeIsEnum = this.buildTypeIsEnum(typeBinding);
+ this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(typeBinding));
+ this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(typeBinding));
+ this.typeTypeArgumentNames.addAll(this.buildTypeTypeArgumentNames(typeBinding));
+ }
+
+
+ // ******** overrides ********
+
+ @Override
+ public void resolveTypes(CompilationUnit astRoot) {
+ super.resolveTypes(astRoot);
+ ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
+ this.syncTypeName(this.buildTypeName(typeBinding));
+ this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
+ this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
+ this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
+ }
+
+ @Override
+ public void synchronizeWith(CompilationUnit astRoot) {
+ super.synchronizeWith(astRoot);
+ ITypeBinding typeBinding = this.getTypeBinding(astRoot);//build once, minor performance tweak for major benefit
+ this.syncModifiers(this.buildModifiers(astRoot));
+ this.syncTypeName(this.buildTypeName(typeBinding));
+ this.syncTypeIsInterface(this.buildTypeIsInterface(typeBinding));
+ this.syncTypeIsEnum(this.buildTypeIsEnum(typeBinding));
+ this.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
+ this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
+ this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
+ }
+
+ @Override
+ public void toString(StringBuilder sb) {
+ sb.append(this.getName());
+ }
+
+
+ // ******** AbstractJavaResourcePersistentMember implementation ********
+
+ @Override
+ Iterable<String> getValidAnnotationNames() {
+ return this.getAnnotationProvider().getAttributeAnnotationNames();
+ }
+
+ @Override
+ Annotation buildAnnotation(String annotationName) {
+ return this.getAnnotationProvider().buildAttributeAnnotation(this, this.annotatedElement, annotationName);
+ }
+
+ Annotation buildNullAnnotation_(String annotationName) {
+ return this.getAnnotationProvider().buildNullAttributeAnnotation(this, annotationName);
+ }
+
+ public boolean isFor(MethodSignature signature, int occurrence) {
+ return ((MethodAttribute) this.annotatedElement).matches(signature, occurrence);
+ }
+
+
+ // ******** JavaResourcePersistentAttribute implementation ********
+
+ public String getName() {
+ return this.annotatedElement.getAttributeName();
+ }
+
+ @Override
+ public Annotation buildNullAnnotation(String annotationName) {
+ return (annotationName == null) ? null : this.buildNullAnnotation_(annotationName);
+ }
+
+ public boolean isField() {
+ return this.annotatedElement.isField();
+ }
+
+ public boolean isProperty() {
+ return ! this.isField();
+ }
+
+ public XmlAccessType getSpecifiedAccess() {
+ XmlAccessorTypeAnnotation accessAnnotation = this.getAccessAnnotation();
+ return (accessAnnotation == null) ? null : accessAnnotation.getValue();
+ }
+
+ private XmlAccessorTypeAnnotation getAccessAnnotation() {
+ return (XmlAccessorTypeAnnotation) this.getAnnotation(XmlAccessorTypeAnnotation.ANNOTATION_NAME);
+ }
+
+ public boolean typeIsSubTypeOf(String tn) {
+ if (this.typeName == null) {
+ return false;
+ }
+ return this.typeName.equals(tn)
+ || this.typeInterfaceNames.contains(tn)
+ || this.typeSuperclassNames.contains(tn);
+ }
+
+ public boolean typeIsVariablePrimitive() {
+ return (this.typeName != null) && ClassName.isVariablePrimitive(this.typeName);
+ }
+
+ private ITypeBinding getTypeBinding(CompilationUnit astRoot) {
+ return this.annotatedElement.getTypeBinding(astRoot);
+ }
+
+
+ // ***** modifiers
+ public int getModifiers() {
+ return this.modifiers;
+ }
+
+ private void syncModifiers(int astModifiers) {
+ int old = this.modifiers;
+ this.modifiers = astModifiers;
+ this.firePropertyChanged(MODIFIERS_PROPERTY, old, astModifiers);
+ }
+
+ /**
+ * zero seems like a reasonable default...
+ */
+ private int buildModifiers(CompilationUnit astRoot) {
+ IBinding binding = this.annotatedElement.getBinding(astRoot);
+ return (binding == null) ? 0 : binding.getModifiers();
+ }
+
+ // ***** type name
+ public String getTypeName() {
+ return this.typeName;
+ }
+
+ private void syncTypeName(String astTypeName) {
+ String old = this.typeName;
+ this.typeName = astTypeName;
+ this.firePropertyChanged(TYPE_NAME_PROPERTY, old, astTypeName);
+ }
+
+ /**
+ * this can be an array (e.g. "java.lang.String[]");
+ * but no generic type arguments
+ */
+ private String buildTypeName(ITypeBinding typeBinding) {
+ if (typeBinding == null) {
+ return null;
+ }
+ // a type variable is what is declared by a generic type;
+ // e.g. "E" is a type variable declared by the generic type "Collection" in
+ // public interface Collection<E>
+ if (typeBinding.isTypeVariable()) {
+ // e.g. "E extends Number" has an erasure of "Number"
+ typeBinding = typeBinding.getErasure();
+ }
+ String tbName = typeBinding.getTypeDeclaration().getQualifiedName();
+ return (tbName.length() == 0) ? null : tbName;
+ }
+
+ // ***** type is interface
+ public boolean typeIsInterface() {
+ return this.typeIsInterface;
+ }
+
+ private void syncTypeIsInterface(boolean astTypeIsInterface) {
+ boolean old = this.typeIsInterface;
+ this.typeIsInterface = astTypeIsInterface;
+ this.firePropertyChanged(TYPE_IS_INTERFACE_PROPERTY, old, astTypeIsInterface);
+ }
+
+ private boolean buildTypeIsInterface(ITypeBinding typeBinding) {
+ return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isInterface();
+ }
+
+ // ***** type is enum
+ public boolean typeIsEnum() {
+ return this.typeIsEnum;
+ }
+
+ private void syncTypeIsEnum(boolean astTypeIsEnum) {
+ boolean old = this.typeIsEnum;
+ this.typeIsEnum = astTypeIsEnum;
+ this.firePropertyChanged(TYPE_IS_ENUM_PROPERTY, old, astTypeIsEnum);
+ }
+
+ private boolean buildTypeIsEnum(ITypeBinding typeBinding) {
+ return (typeBinding != null) && ( ! typeBinding.isArray()) && typeBinding.isEnum();
+ }
+
+ // ***** type superclass hierarchy
+ public ListIterable<String> getTypeSuperclassNames() {
+ return new LiveCloneListIterable<String>(this.typeSuperclassNames);
+ }
+
+ private void syncTypeSuperclassNames(List<String> astTypeSuperclassNames) {
+ this.synchronizeList(astTypeSuperclassNames, this.typeSuperclassNames, TYPE_SUPERCLASS_NAMES_LIST);
+ }
+
+ private List<String> buildTypeSuperclassNames(ITypeBinding typeBinding) {
+ if (typeBinding == null) {
+ return Collections.emptyList();
+ }
+ ArrayList<String> names = new ArrayList<String>();
+ typeBinding = typeBinding.getSuperclass();
+ while (typeBinding != null) {
+ names.add(typeBinding.getQualifiedName());
+ typeBinding = typeBinding.getSuperclass();
+ }
+ return names;
+ }
+
+ // ***** type interface hierarchy
+ public Iterable<String> getTypeInterfaceNames() {
+ return new LiveCloneIterable<String>(this.typeInterfaceNames);
+ }
+
+// private boolean typeInterfaceNamesContains(String interfaceName) {
+// return this.typeInterfaceNames.contains(interfaceName);
+// }
+//
+ private void syncTypeInterfaceNames(Collection<String> astTypeInterfaceNames) {
+ this.synchronizeCollection(astTypeInterfaceNames, this.typeInterfaceNames, TYPE_INTERFACE_NAMES_COLLECTION);
+ }
+
+ private Collection<String> buildTypeInterfaceNames(ITypeBinding typeBinding) {
+ if (typeBinding == null) {
+ return Collections.emptySet();
+ }
+ HashSet<String> names = new HashSet<String>();
+ while (typeBinding != null) {
+ this.addInterfaceNamesTo(typeBinding, names);
+ typeBinding = typeBinding.getSuperclass();
+ }
+ return names;
+ }
+
+ private void addInterfaceNamesTo(ITypeBinding typeBinding, HashSet<String> names) {
+ for (ITypeBinding interfaceBinding : typeBinding.getInterfaces()) {
+ names.add(interfaceBinding.getTypeDeclaration().getQualifiedName());
+ this.addInterfaceNamesTo(interfaceBinding, names); // recurse
+ }
+ }
+
+ // ***** type type argument names
+ public ListIterable<String> getTypeTypeArgumentNames() {
+ return new LiveCloneListIterable<String>(this.typeTypeArgumentNames);
+ }
+
+ public int getTypeTypeArgumentNamesSize() {
+ return this.typeTypeArgumentNames.size();
+ }
+
+ public String getTypeTypeArgumentName(int index) {
+ return this.typeTypeArgumentNames.get(index);
+ }
+
+ private void syncTypeTypeArgumentNames(List<String> astTypeTypeArgumentNames) {
+ this.synchronizeList(astTypeTypeArgumentNames, this.typeTypeArgumentNames, TYPE_TYPE_ARGUMENT_NAMES_LIST);
+ }
+
+ /**
+ * these types can be arrays (e.g. "java.lang.String[]");
+ * but they won't have any further nested generic type arguments
+ * (e.g. "java.util.Collection<java.lang.String>")
+ */
+ private List<String> buildTypeTypeArgumentNames(ITypeBinding typeBinding) {
+ if (typeBinding == null) {
+ return Collections.emptyList();
+ }
+
+ ITypeBinding[] typeArguments = typeBinding.getTypeArguments();
+ if (typeArguments.length == 0) {
+ return Collections.emptyList();
+ }
+
+ ArrayList<String> names = new ArrayList<String>(typeArguments.length);
+ for (ITypeBinding typeArgument : typeArguments) {
+ if (typeArgument == null) {
+ names.add(null);
+ } else {
+ // e.g. "? extends Number" has an erasure of "Number"
+ ITypeBinding erasure = typeArgument.getErasure();
+ names.add(erasure.getTypeDeclaration().getQualifiedName());
+ }
+ }
+ return names;
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java
new file mode 100644
index 0000000000..d5a507618d
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceCompilationUnit.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.JpaResourceModelListener;
+import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.utility.CommandExecutor;
+import org.eclipse.jpt.utility.internal.ListenerList;
+
+/**
+ * Java compilation unit (source file)
+ */
+public abstract class SourceCompilationUnit
+ extends SourceNode
+ implements JavaResourceCompilationUnit
+{
+ /** JDT compilation unit */
+ final ICompilationUnit compilationUnit;
+
+ /** pluggable annotation provider */
+ private final AnnotationProvider annotationProvider;
+
+ /** improved annotation formatting */
+ private final AnnotationEditFormatter annotationEditFormatter;
+
+ /** pluggable executor that allows the document to be modified on another thread */
+ private final CommandExecutor modifySharedDocumentCommandExecutor;
+
+ /** listeners notified whenever the resource model changes */
+ private final ListenerList<JpaResourceModelListener> resourceModelListenerList;
+
+
+ // ********** construction **********
+
+ protected SourceCompilationUnit(
+ ICompilationUnit compilationUnit,
+ AnnotationProvider annotationProvider,
+ AnnotationEditFormatter annotationEditFormatter,
+ CommandExecutor modifySharedDocumentCommandExecutor) {
+ super(null); // the JPA compilation unit is the root of its sub-tree
+ this.compilationUnit = compilationUnit;
+ this.annotationProvider = annotationProvider;
+ this.annotationEditFormatter = annotationEditFormatter;
+ this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor;
+ this.resourceModelListenerList = new ListenerList<JpaResourceModelListener>(JpaResourceModelListener.class);
+ }
+
+ public void initialize(CompilationUnit astRoot) {
+ // never called?
+ }
+
+ void openCompilationUnit() {
+ try {
+ this.compilationUnit.open(null);
+ } catch (JavaModelException ex) {
+ // do nothing - we just won't have a primary type in this case
+ }
+ }
+
+ void closeCompilationUnit() {
+ try {
+ this.compilationUnit.close();
+ } catch (JavaModelException ex) {
+ // hmmm
+ }
+ }
+
+
+ // ********** AbstractJavaResourceNode overrides **********
+
+ @Override
+ protected boolean requiresParent() {
+ return false;
+ }
+
+ @Override
+ public JavaResourceCompilationUnit getRoot() {
+ return this;
+ }
+
+ @Override
+ public IFile getFile() {
+ return (IFile) this.compilationUnit.getResource();
+ }
+
+ @Override
+ public AnnotationProvider getAnnotationProvider() {
+ return this.annotationProvider;
+ }
+
+
+ // ********** JavaResourceNode implementation **********
+
+ public TextRange getTextRange(CompilationUnit astRoot) {
+ return null;
+ }
+
+
+ // ********** JavaResourceNode.Root implementation **********
+
+ public void resourceModelChanged() {
+ for (JpaResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
+ listener.resourceModelChanged(this);
+ }
+ }
+
+
+ // ********** JavaResourceCompilationUnit implementation **********
+
+ public ICompilationUnit getCompilationUnit() {
+ return this.compilationUnit;
+ }
+
+ public CommandExecutor getModifySharedDocumentCommandExecutor() {
+ return this.modifySharedDocumentCommandExecutor;
+ }
+
+ public AnnotationEditFormatter getAnnotationEditFormatter() {
+ return this.annotationEditFormatter;
+ }
+
+ public CompilationUnit buildASTRoot() {
+ return ASTTools.buildASTRoot(this.compilationUnit);
+ }
+
+
+ // ********** JpaResourceModel implementation **********
+
+ public void addResourceModelListener(JpaResourceModelListener listener) {
+ this.resourceModelListenerList.add(listener);
+ }
+
+ public void removeResourceModelListener(JpaResourceModelListener listener) {
+ this.resourceModelListenerList.remove(listener);
+ }
+
+
+ // ********** Java changes **********
+
+ public void synchronizeWithJavaSource() {
+ this.synchronizeWith(this.buildASTRoot());
+ }
+
+
+ // ********** internal **********
+
+ String getCompilationUnitName() {
+ return this.removeJavaExtension(this.compilationUnit.getElementName());
+ }
+
+ private String removeJavaExtension(String fileName) {
+ int index = fileName.lastIndexOf(".java"); //$NON-NLS-1$
+ return (index == -1) ? fileName : fileName.substring(0, index);
+ }
+
+ @Override
+ public void toString(StringBuilder sb) {
+ sb.append(this.getCompilationUnitName());
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java
new file mode 100644
index 0000000000..07a51e6316
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceMember.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import java.util.ArrayList;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IBinding;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jpt.core.utility.jdt.Member;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
+
+/**
+ * Java source persistent member (annotations, "persistable")
+ */
+abstract class SourceMember<M extends Member>
+ extends SourceAnnotatedElement<M>
+ implements JavaResourceMember
+{
+
+ boolean persistable;
+
+ boolean final_; // 'final' is a reserved word
+
+
+ // ********** construction/initialization **********
+
+ SourceMember(JavaResourceNode parent, M member) {
+ super(parent, member);
+ }
+
+ @Override
+ public void initialize(CompilationUnit astRoot) {
+ super.initialize(astRoot);
+ this.persistable = this.buildPersistable(astRoot);
+ IBinding binding = this.annotatedElement.getBinding(astRoot);
+ this.final_ = this.buildFinal(binding);
+ }
+
+ @Override
+ public void synchronizeWith(CompilationUnit astRoot) {
+ super.synchronizeWith(astRoot);
+ this.syncPersistable(this.buildPersistable(astRoot));
+ IBinding binding = this.annotatedElement.getBinding(astRoot);
+ this.syncFinal(this.buildFinal(binding));
+ }
+
+
+ // ********** annotations **********
+
+ public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
+ ArrayList<String> annotationNames = new ArrayList<String>();
+ CollectionTools.addAll(annotationNames, supportingAnnotationNames);
+ if (primaryAnnotationName != null) {
+ annotationNames.add(primaryAnnotationName);
+ }
+ for (Annotation annotation : this.getAnnotations()) {
+ if ( ! CollectionTools.contains(annotationNames, annotation.getAnnotationName())) {
+ this.annotations.remove(annotation);
+ annotation.removeAnnotation();
+ }
+ }
+ Annotation newPrimaryAnnotation = null;
+ if ((primaryAnnotationName != null) && (this.getAnnotation(primaryAnnotationName) == null)) {
+ newPrimaryAnnotation = this.buildAnnotation(primaryAnnotationName);
+ this.annotations.add(newPrimaryAnnotation);
+ newPrimaryAnnotation.newAnnotation();
+ }
+ // fire collection change event after all annotation changes are done
+ this.fireCollectionChanged(ANNOTATIONS_COLLECTION, this.annotations);
+ return newPrimaryAnnotation;
+ }
+
+
+ // ********** persistable **********
+
+ public boolean isPersistable() {
+ return this.persistable;
+ }
+
+ private void syncPersistable(boolean astPersistable) {
+ boolean old = this.persistable;
+ this.persistable = astPersistable;
+ this.firePropertyChanged(PERSISTABLE_PROPERTY, old, astPersistable);
+ }
+
+ private boolean buildPersistable(CompilationUnit astRoot) {
+ return this.annotatedElement.isPersistable(astRoot);
+ }
+
+ // ***** final
+ public boolean isFinal() {
+ return this.final_;
+ }
+
+ private void syncFinal(boolean astFinal) {
+ boolean old = this.final_;
+ this.final_ = astFinal;
+ this.firePropertyChanged(FINAL_PROPERTY, old, astFinal);
+ }
+
+ private boolean buildFinal(IBinding binding) {
+ return (binding == null) ? false : Modifier.isFinal(binding.getModifiers());
+ }
+
+
+ // ********** miscellaneous **********
+
+ public boolean isFor(String memberName, int occurrence) {
+ return this.annotatedElement.matches(memberName, occurrence);
+ }
+
+ public void resolveTypes(CompilationUnit astRoot) {
+ this.syncPersistable(this.buildPersistable(astRoot));
+ }
+
+ /**
+ * convenience method
+ */
+ <T extends JavaResourceMember> Iterable<T> getPersistableMembers(Iterable<T> members) {
+ return new FilteringIterable<T>(members) {
+ @Override
+ protected boolean accept(T m) {
+ return m.isPersistable();
+ }
+ };
+ }
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java
new file mode 100644
index 0000000000..7928586649
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceNode.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+
+
+/**
+ * Source convenience methods
+ */
+public abstract class SourceNode
+ extends AbstractJavaResourceNode
+{
+
+ public SourceNode(JavaResourceNode parent) {
+ super(parent);
+ }
+
+ public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
+ return (JavaResourceCompilationUnit) this.getRoot();
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java
new file mode 100644
index 0000000000..6fabc31343
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackage.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.IPackageBinding;
+import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.eclipse.jpt.core.internal.utility.jdt.JDTPackage;
+import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
+
+/**
+ * @author Dmitry Geraskov
+ * Source package-info.java
+ *
+ */
+public final class SourcePackage
+ extends SourceAnnotatedElement<AnnotatedPackage>
+ implements JavaResourcePackage {
+
+ private String name;
+
+ /**
+ * construct package info
+ */
+ public static JavaResourcePackage newInstance(
+ JavaResourceCompilationUnit parent,
+ PackageDeclaration declaringPackage,
+ CompilationUnit astRoot) {
+ AnnotatedPackage pack = new JDTPackage(
+ declaringPackage,
+ parent.getCompilationUnit(),
+ parent.getModifySharedDocumentCommandExecutor(),
+ parent.getAnnotationEditFormatter());
+ JavaResourcePackage jrpp = new SourcePackage(parent, pack);
+ jrpp.initialize(astRoot);
+ return jrpp;
+ }
+
+ private SourcePackage(
+ JavaResourceCompilationUnit parent,
+ AnnotatedPackage pack){
+ super(parent, pack);
+ }
+
+ @Override
+ public void initialize(CompilationUnit astRoot) {
+ super.initialize(astRoot);
+ this.name = this.buildName(astRoot);
+ }
+
+
+ // ********** JavaResourcePackageInfo implementation **********
+
+ // ***** name
+ public String getName() {
+ return this.name;
+ }
+
+ private void syncName(String astName) {
+ if (valuesAreDifferent(astName, this.name)){
+ String old = this.name;
+ this.name = astName;
+ this.firePropertyChanged(NAME_PROPERTY, old, astName);
+ }
+ }
+
+ private String buildName(CompilationUnit astRoot) {
+ IPackageBinding binding = this.annotatedElement.getBinding(astRoot);
+ return (binding == null) ? null : binding.getName();
+ }
+
+
+ // ********** Java changes **********
+
+ @Override
+ public void synchronizeWith(CompilationUnit astRoot) {
+ super.synchronizeWith(astRoot);
+ this.syncName(this.buildName(astRoot));
+ }
+
+ // ********** SourceAnnotatedElement implementation **********
+
+ @Override
+ Iterable<String> getValidAnnotationNames() {
+ return this.getAnnotationProvider().getPackageAnnotationNames();
+ }
+
+
+ @Override
+ Annotation buildAnnotation(String annotationName) {
+ return this.getAnnotationProvider().buildPackageAnnotation(this, this.annotatedElement, annotationName);
+ }
+
+ @Override
+ Annotation buildNullAnnotation(String annotationName) {
+ return this.getAnnotationProvider().buildNullPackageAnnotation(this, annotationName);
+ }
+
+
+ @Override
+ public void toString(StringBuilder sb) {
+ sb.append(this.name);
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
new file mode 100644
index 0000000000..a520a24a21
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourcePackageInfoCompilationUnit.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.eclipse.jpt.core.JpaResourceType;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.utility.CommandExecutor;
+import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
+
+/**
+ * @author Dmitry Geraskov
+ * Source package-info.java
+ *
+ */
+public final class SourcePackageInfoCompilationUnit
+ extends SourceCompilationUnit
+ implements JavaResourcePackageInfoCompilationUnit {
+
+ private JavaResourcePackage package_;
+
+ public SourcePackageInfoCompilationUnit(
+ ICompilationUnit compilationUnit,
+ AnnotationProvider annotationProvider,
+ AnnotationEditFormatter annotationEditFormatter,
+ CommandExecutor modifySharedDocumentCommandExecutor) {
+ super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the JPA compilation unit is the root of its sub-tree
+ this.package_ = this.buildPackage();
+ }
+
+
+ private JavaResourcePackage buildPackage() {
+ this.openCompilationUnit();
+ CompilationUnit astRoot = this.buildASTRoot();
+ this.closeCompilationUnit();
+ return this.buildPackage(astRoot);
+ }
+
+
+ // ********** JavaResourceNode.Root implementation **********
+
+ public Iterable<JavaResourceType> getTypes() {
+ return EmptyIterable.instance();
+ }
+
+
+ // ********** JpaResourceModel implementation **********
+
+ public JpaResourceType getResourceType() {
+ return JptCorePlugin.JAVA_SOURCE_PACKAGE_INFO_RESOURCE_TYPE;
+ }
+
+
+ // ********** Java changes **********
+
+ public void synchronizeWith(CompilationUnit astRoot) {
+ this.syncPackage(astRoot);
+ }
+
+
+ // ********** JavaResourceCompilationUnit implementation **********
+
+ public void resolveTypes() {
+ //no-op
+ }
+
+ // ********** package-info **********
+
+ public JavaResourcePackage getPackage() {
+ return this.package_;
+ }
+
+ private JavaResourcePackage buildPackage(CompilationUnit astRoot) {
+ return this.buildPackage(astRoot, this.getPackageDeclaration(astRoot));
+ }
+
+ private void syncPackage(CompilationUnit astRoot) {
+ PackageDeclaration pd = this.getPackageDeclaration(astRoot);
+ if (pd == null) {
+ this.syncPackage_(null);
+ } else {
+ if (this.package_ == null) {
+ this.syncPackage_(this.buildPackage(astRoot, pd));
+ } else {
+ this.package_.synchronizeWith(astRoot);
+ }
+ }
+ }
+
+ private PackageDeclaration getPackageDeclaration(CompilationUnit astRoot) {
+ return astRoot.getPackage();
+ }
+
+ private void syncPackage_(JavaResourcePackage astPackage) {
+ JavaResourcePackage old = this.package_;
+ this.package_ = astPackage;
+ this.firePropertyChanged(PACKAGE, old, astPackage);
+ }
+
+ private JavaResourcePackage buildPackage(CompilationUnit astRoot, PackageDeclaration packageDeclaration) {
+ return SourcePackage.newInstance(this, packageDeclaration, astRoot);
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java
new file mode 100644
index 0000000000..1ce0539318
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceType.java
@@ -0,0 +1,683 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.IMethodBinding;
+import org.eclipse.jdt.core.dom.ITypeBinding;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Modifier;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.core.internal.utility.jdt.JDTType;
+import org.eclipse.jpt.core.utility.jdt.Type;
+import org.eclipse.jpt.jaxb.core.resource.java.Annotation;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
+import org.eclipse.jpt.utility.MethodSignature;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.IntReference;
+import org.eclipse.jpt.utility.internal.StringTools;
+import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
+import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
+import org.eclipse.jpt.utility.internal.iterables.TreeIterable;
+
+/**
+ * Java source type
+ */
+final class SourceType
+ extends SourceMember<Type>
+ implements JavaResourceType
+{
+ private String name;
+
+ private String qualifiedName;
+
+ private String packageName;
+
+ private String superclassQualifiedName;
+
+ private String declaringTypeName;
+
+ private boolean abstract_; // 'abstract' is a reserved word
+
+ private boolean static_; // 'static' is a reserved word
+
+ private boolean memberType;
+
+ private boolean hasPrivateNoArgConstructor;
+
+ private boolean hasNoArgConstructor;
+
+ private final Vector<JavaResourceType> types;
+
+ private final Vector<JavaResourceAttribute> fields;
+
+ private final Vector<JavaResourceAttribute> methods;
+
+
+ // ********** construction/initialization **********
+
+ /**
+ * build top-level type
+ */
+ static JavaResourceType newInstance(
+ JavaResourceCompilationUnit javaResourceCompilationUnit,
+ TypeDeclaration typeDeclaration,
+ CompilationUnit astRoot) {
+ Type type = new JDTType(
+ typeDeclaration,
+ javaResourceCompilationUnit.getCompilationUnit(),
+ javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
+ javaResourceCompilationUnit.getAnnotationEditFormatter());
+ JavaResourceType jrpt = new SourceType(javaResourceCompilationUnit, type);
+ jrpt.initialize(astRoot);
+ return jrpt;
+ }
+
+ /**
+ * build nested type
+ */
+ private static JavaResourceType newInstance(
+ JavaResourceCompilationUnit javaResourceCompilationUnit,
+ Type declaringType,
+ TypeDeclaration typeDeclaration,
+ int occurrence,
+ CompilationUnit astRoot) {
+ Type type = new JDTType(
+ declaringType,
+ typeDeclaration,
+ occurrence,
+ javaResourceCompilationUnit.getCompilationUnit(),
+ javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
+ javaResourceCompilationUnit.getAnnotationEditFormatter());
+ JavaResourceType jrpt = new SourceType(javaResourceCompilationUnit, type);
+ jrpt.initialize(astRoot);
+ return jrpt;
+ }
+
+ private SourceType(JavaResourceCompilationUnit javaResourceCompilationUnit, Type type) {
+ super(javaResourceCompilationUnit, type);
+ this.types = new Vector<JavaResourceType>();
+ this.fields = new Vector<JavaResourceAttribute>();
+ this.methods = new Vector<JavaResourceAttribute>();
+ }
+
+ @Override
+ public void initialize(CompilationUnit astRoot) {
+ super.initialize(astRoot);
+ ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
+ this.name = this.buildName(binding);
+ this.qualifiedName = this.buildQualifiedName(binding);
+ this.packageName = this.buildPackageName(binding);
+ this.superclassQualifiedName = this.buildSuperclassQualifiedName(binding);
+ this.declaringTypeName = this.buildDeclaringTypeName(binding);
+ this.abstract_ = this.buildAbstract(binding);
+ this.static_ = this.buildStatic(binding);
+ this.memberType = this.buildMemberType(binding);
+ this.hasNoArgConstructor = this.buildHasNoArgConstructor(binding);
+ this.hasPrivateNoArgConstructor = this.buildHasPrivateNoArgConstructor(binding);
+ this.initializeTypes(astRoot);
+ this.initializeFields(astRoot);
+ this.initializeMethods(astRoot);
+ }
+
+
+ // ********** update **********
+
+ @Override
+ public void synchronizeWith(CompilationUnit astRoot) {
+ super.synchronizeWith(astRoot);
+ ITypeBinding binding = this.annotatedElement.getBinding(astRoot);
+ this.syncName(this.buildName(binding));
+ this.syncQualifiedName(this.buildQualifiedName(binding));
+ this.syncPackageName(this.buildPackageName(binding));
+ this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(binding));
+ this.syncDeclaringTypeName(this.buildDeclaringTypeName(binding));
+ this.syncAbstract(this.buildAbstract(binding));
+ this.syncStatic(this.buildStatic(binding));
+ this.syncMemberType(this.buildMemberType(binding));
+ this.syncHasNoArgConstructor(this.buildHasNoArgConstructor(binding));
+ this.syncHasPrivateNoArgConstructor(this.buildHasPrivateNoArgConstructor(binding));
+ this.syncTypes(astRoot);
+ this.syncFields(astRoot);
+ this.syncMethods(astRoot);
+ }
+
+
+ // ********** SourceAnnotatedElement implementation **********
+
+ @Override
+ Iterable<String> getValidAnnotationNames() {
+ return this.getAnnotationProvider().getTypeAnnotationNames();
+ }
+
+ @Override
+ Annotation buildAnnotation(String annotationName) {
+ return this.getAnnotationProvider().buildTypeAnnotation(this, this.annotatedElement, annotationName);
+ }
+
+ @Override
+ Annotation buildNullAnnotation(String annotationName) {
+ return this.getAnnotationProvider().buildNullTypeAnnotation(this, annotationName);
+ }
+
+ @Override
+ public void resolveTypes(CompilationUnit astRoot) {
+ super.resolveTypes(astRoot);
+
+ this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(this.annotatedElement.getBinding(astRoot)));
+
+ for (JavaResourceAttribute field : this.getFields()) {
+ field.resolveTypes(astRoot);
+ }
+
+ // a new type can trigger a method parameter type to be a resolved,
+ // fully-qualified name, so we need to rebuild our list of methods:
+ // "setFoo(Foo)" is not the same as "setFoo(com.bar.Foo)"
+ // and, vice-versa, a removed type can "unresolve" a parameter type
+ this.syncMethods(astRoot);
+
+ for (JavaResourceAttribute method : this.getMethods()) {
+ method.resolveTypes(astRoot);
+ }
+ for (JavaResourceType type : this.getTypes()) {
+ type.resolveTypes(astRoot);
+ }
+ }
+
+ @Override
+ public void toString(StringBuilder sb) {
+ sb.append(this.name);
+ }
+
+
+ // ******** JavaResourceType implementation ********
+
+ // ***** name
+ public String getName() {
+ return this.name;
+ }
+
+ private void syncName(String astName) {
+ String old = this.name;
+ this.name = astName;
+ this.firePropertyChanged(NAME_PROPERTY, old, astName);
+ }
+
+ private String buildName(ITypeBinding binding) {
+ return (binding == null) ? null : binding.getName();
+ }
+
+ // ***** qualified name
+ public String getQualifiedName() {
+ return this.qualifiedName;
+ }
+
+ private void syncQualifiedName(String astQualifiedName) {
+ String old = this.qualifiedName;
+ this.qualifiedName = astQualifiedName;
+ this.firePropertyChanged(QUALIFIED_NAME_PROPERTY, old, astQualifiedName);
+ }
+
+ private String buildQualifiedName(ITypeBinding binding) {
+ return (binding == null) ? null : binding.getQualifiedName();
+ }
+
+ // ***** package name
+ public String getPackageName() {
+ return this.packageName;
+ }
+
+ private void syncPackageName(String astPackageName) {
+ String old = this.packageName;
+ this.packageName = astPackageName;
+ this.firePropertyChanged(PACKAGE_NAME_PROPERTY, old, astPackageName);
+ }
+
+ private String buildPackageName(ITypeBinding binding) {
+ return (binding == null) ? null : binding.getPackage().getName();
+ }
+
+ // ***** superclass qualified name
+ public String getSuperclassQualifiedName() {
+ return this.superclassQualifiedName;
+ }
+
+ private void syncSuperclassQualifiedName(String astSuperclassQualifiedName) {
+ String old = this.superclassQualifiedName;
+ this.superclassQualifiedName = astSuperclassQualifiedName;
+ this.firePropertyChanged(SUPERCLASS_QUALIFIED_NAME_PROPERTY, old, astSuperclassQualifiedName);
+ }
+
+ private String buildSuperclassQualifiedName(ITypeBinding binding) {
+ if (binding == null) {
+ return null;
+ }
+ ITypeBinding superclass = binding.getSuperclass();
+ return (superclass == null) ? null : superclass.getTypeDeclaration().getQualifiedName();
+ }
+
+ // ***** package
+ public boolean isIn(IPackageFragment packageFragment) {
+ return StringTools.stringsAreEqual(packageFragment.getElementName(), this.packageName);
+ }
+
+ // ***** declaring type name
+ public String getDeclaringTypeName() {
+ return this.declaringTypeName;
+ }
+
+ private void syncDeclaringTypeName(String astDeclaringTypeName) {
+ String old = this.declaringTypeName;
+ this.declaringTypeName = astDeclaringTypeName;
+ this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, astDeclaringTypeName);
+ }
+
+ private String buildDeclaringTypeName(ITypeBinding binding) {
+ if (binding == null) {
+ return null;
+ }
+ ITypeBinding declaringClass = binding.getDeclaringClass();
+ return (declaringClass == null) ? null : declaringClass.getTypeDeclaration().getQualifiedName();
+ }
+
+ // ***** abstract
+ public boolean isAbstract() {
+ return this.abstract_;
+ }
+
+ private void syncAbstract(boolean astAbstract) {
+ boolean old = this.abstract_;
+ this.abstract_ = astAbstract;
+ this.firePropertyChanged(ABSTRACT_PROPERTY, old, astAbstract);
+ }
+
+ private boolean buildAbstract(ITypeBinding binding) {
+ return (binding == null) ? false : Modifier.isAbstract(binding.getModifiers());
+ }
+
+ // ***** static
+ public boolean isStatic() {
+ return this.static_;
+ }
+
+ private void syncStatic(boolean static_) {
+ boolean old = this.static_;
+ this.static_ = static_;
+ this.firePropertyChanged(STATIC_PROPERTY, old, static_);
+ }
+
+ private boolean buildStatic(ITypeBinding binding) {
+ return (binding == null) ? false : Modifier.isStatic(binding.getModifiers());
+ }
+
+ // ***** member type
+ public boolean isMemberType() {
+ return this.memberType;
+ }
+
+ private void syncMemberType(boolean memberType) {
+ boolean old = this.memberType;
+ this.memberType = memberType;
+ this.firePropertyChanged(MEMBER_TYPE_PROPERTY, old, memberType);
+ }
+
+ private boolean buildMemberType(ITypeBinding binding) {
+ return (binding == null) ? false : binding.isMember();
+ }
+
+ // ***** no-arg constructor
+ public boolean hasNoArgConstructor() {
+ return this.hasNoArgConstructor;
+ }
+
+ private void syncHasNoArgConstructor(boolean hasNoArgConstructor) {
+ boolean old = this.hasNoArgConstructor;
+ this.hasNoArgConstructor = hasNoArgConstructor;
+ this.firePropertyChanged(NO_ARG_CONSTRUCTOR_PROPERTY, old, hasNoArgConstructor);
+ }
+
+ private boolean buildHasNoArgConstructor(ITypeBinding binding) {
+ return (binding == null) ? false : typeHasNoArgConstructor(binding);
+ }
+
+ protected static boolean typeHasNoArgConstructor(ITypeBinding binding) {
+ return findNoArgConstructor(binding) != null;
+ }
+
+ protected static IMethodBinding findNoArgConstructor(ITypeBinding binding) {
+ for (IMethodBinding method : binding.getDeclaredMethods()) {
+ if (method.isConstructor()) {
+ if (method.getParameterTypes().length == 0) {
+ return method;
+ }
+ }
+ }
+ return null;
+ }
+
+ // ***** private no-arg constructor
+ public boolean hasPrivateNoArgConstructor() {
+ return this.hasPrivateNoArgConstructor;
+ }
+
+ private void syncHasPrivateNoArgConstructor(boolean hasPrivateNoArgConstructor) {
+ boolean old = this.hasPrivateNoArgConstructor;
+ this.hasPrivateNoArgConstructor = hasPrivateNoArgConstructor;
+ this.firePropertyChanged(PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY, old, hasPrivateNoArgConstructor);
+ }
+
+ private boolean buildHasPrivateNoArgConstructor(ITypeBinding binding) {
+ return (binding == null) ? false : typeHasPrivateNoArgConstructor(binding);
+ }
+
+ protected static boolean typeHasPrivateNoArgConstructor(ITypeBinding binding) {
+ IMethodBinding method = findNoArgConstructor(binding);
+ return method != null && Modifier.isPrivate(method.getModifiers());
+ }
+
+ public boolean isMapped() {
+ for (Annotation each : this.getAnnotations()) {
+ if (this.annotationIsMappingAnnotation(each)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean annotationIsMappingAnnotation(Annotation annotation) {
+ return CollectionTools.contains(this.getMappingAnnotationNames(), annotation.getAnnotationName());
+ }
+
+ private Iterable<String> getMappingAnnotationNames() {
+ return this.getAnnotationProvider().getTypeMappingAnnotationNames();
+ }
+
+ /**
+ * check only persistable attributes
+ */
+ public boolean hasAnyAnnotatedAttributes() {
+ for (JavaResourceAttribute attribute: this.getPersistableAttributes()) {
+ if (attribute.isAnnotated()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ // ********** types **********
+
+ public Iterable<JavaResourceType> getTypes() {
+ return new LiveCloneIterable<JavaResourceType>(this.types); // read-only
+ }
+
+ public Iterable<JavaResourceType> getAllTypes() {
+ return new TreeIterable<JavaResourceType>(this) {
+ @Override
+ protected Iterator<? extends JavaResourceType> children(JavaResourceType type) {
+ return type.getTypes().iterator();
+ }
+ };
+ }
+
+ public Iterable<JavaResourceType> getPersistableTypes() {
+ return this.getPersistableMembers(this.getTypes());
+ }
+
+ private JavaResourceType getType(String typeName, int occurrence) {
+ for (JavaResourceType type : this.getTypes()) {
+ if (type.isFor(typeName, occurrence)) {
+ return type;
+ }
+ }
+ return null;
+ }
+
+ private void addType(JavaResourceType type) {
+ this.addItemToCollection(type, this.types, TYPES_COLLECTION);
+ }
+
+ private void removeTypes(Collection<JavaResourceType> remove) {
+ this.removeItemsFromCollection(remove, this.types, TYPES_COLLECTION);
+ }
+
+ private void initializeTypes(CompilationUnit astRoot) {
+ TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
+ CounterMap counters = new CounterMap(typeDeclarations.length);
+ for (TypeDeclaration td : typeDeclarations) {
+ String tdName = td.getName().getFullyQualifiedName();
+ int occurrence = counters.increment(tdName);
+ this.types.add(this.buildType(td, occurrence, astRoot));
+ }
+ }
+
+ private void syncTypes(CompilationUnit astRoot) {
+ TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot);
+ CounterMap counters = new CounterMap(typeDeclarations.length);
+ HashSet<JavaResourceType> typesToRemove = new HashSet<JavaResourceType>(this.types);
+ for (TypeDeclaration typeDeclaration : typeDeclarations) {
+ String tdName = typeDeclaration.getName().getFullyQualifiedName();
+ int occurrence = counters.increment(tdName);
+
+ JavaResourceType type = this.getType(tdName, occurrence);
+ if (type == null) {
+ this.addType(this.buildType(typeDeclaration, occurrence, astRoot));
+ } else {
+ typesToRemove.remove(type);
+ type.synchronizeWith(astRoot);
+ }
+ }
+ this.removeTypes(typesToRemove);
+ }
+
+ private JavaResourceType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) {
+ return newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedTypeDeclaration, occurrence, astRoot);
+ }
+
+
+ // ********** fields **********
+
+ public Iterable<JavaResourceAttribute> getFields() {
+ return new LiveCloneIterable<JavaResourceAttribute>(this.fields);
+ }
+
+ public Iterable<JavaResourceAttribute> getPersistableFields() {
+ return this.getPersistableMembers(this.getFields());
+ }
+
+ private void addField(JavaResourceAttribute field) {
+ this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
+ }
+
+ private JavaResourceAttribute getField(String fieldName, int occurrence) {
+ for (JavaResourceAttribute field : this.getFields()) {
+ if (field.isFor(fieldName, occurrence)) {
+ return field;
+ }
+ }
+ return null;
+ }
+
+ private void removeFields(Collection<JavaResourceAttribute> remove) {
+ this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
+ }
+
+ private void initializeFields(CompilationUnit astRoot) {
+ FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
+ CounterMap counters = new CounterMap(fieldDeclarations.length);
+ for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
+ for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
+ String fieldName = fragment.getName().getFullyQualifiedName();
+ int occurrence = counters.increment(fieldName);
+ this.fields.add(this.buildField(fieldName, occurrence, astRoot));
+ }
+ }
+ }
+
+ private void syncFields(CompilationUnit astRoot) {
+ FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot);
+ CounterMap counters = new CounterMap(fieldDeclarations.length);
+ HashSet<JavaResourceAttribute> fieldsToRemove = new HashSet<JavaResourceAttribute>(this.fields);
+ for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
+ for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
+ String fieldName = fragment.getName().getFullyQualifiedName();
+ int occurrence = counters.increment(fieldName);
+
+ JavaResourceAttribute field = this.getField(fieldName, occurrence);
+ if (field == null) {
+ this.addField(this.buildField(fieldName, occurrence, astRoot));
+ } else {
+ fieldsToRemove.remove(field);
+ field.synchronizeWith(astRoot);
+ }
+ }
+ }
+ this.removeFields(fieldsToRemove);
+ }
+
+ private JavaResourceAttribute buildField(String fieldName, int occurrence, CompilationUnit astRoot) {
+ return SourceAttribute.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
+ }
+
+ // minimize scope of suppressed warnings
+ @SuppressWarnings("unchecked")
+ private static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
+ return fd.fragments();
+ }
+
+
+ // ********** methods **********
+
+ public Iterable<JavaResourceAttribute> getMethods() {
+ return new LiveCloneIterable<JavaResourceAttribute>(this.methods);
+ }
+
+ public Iterable<JavaResourceAttribute> getPersistableProperties() {
+ return this.getPersistableMembers(this.getMethods());
+ }
+
+ private JavaResourceAttribute getMethod(MethodSignature signature, int occurrence) {
+ for (JavaResourceAttribute method : this.getMethods()) {
+ if (method.isFor(signature, occurrence)) {
+ return method;
+ }
+ }
+ return null;
+ }
+
+ private void addMethod(JavaResourceAttribute method) {
+ this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
+ }
+
+ private void removeMethods(Collection<JavaResourceAttribute> remove) {
+ this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
+ }
+
+ private void initializeMethods(CompilationUnit astRoot) {
+ MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
+ CounterMap counters = new CounterMap(methodDeclarations.length);
+ for (MethodDeclaration methodDeclaration : methodDeclarations) {
+ MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
+ int occurrence = counters.increment(signature);
+ this.methods.add(this.buildMethod(signature, occurrence, astRoot));
+ }
+ }
+
+ private void syncMethods(CompilationUnit astRoot) {
+ MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot);
+ CounterMap counters = new CounterMap(methodDeclarations.length);
+ HashSet<JavaResourceAttribute> methodsToRemove = new HashSet<JavaResourceAttribute>(this.methods);
+ for (MethodDeclaration methodDeclaration : methodDeclarations) {
+ MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
+ int occurrence = counters.increment(signature);
+
+ JavaResourceAttribute method = this.getMethod(signature, occurrence);
+ if (method == null) {
+ this.addMethod(this.buildMethod(signature, occurrence, astRoot));
+ } else {
+ methodsToRemove.remove(method);
+ method.synchronizeWith(astRoot);
+ }
+ }
+ this.removeMethods(methodsToRemove);
+ }
+
+ private JavaResourceAttribute buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) {
+ return SourceAttribute.newInstance(this, this.annotatedElement, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
+ }
+
+
+ // ********** attributes **********
+
+ @SuppressWarnings("unchecked")
+ public Iterable<JavaResourceAttribute> getPersistableAttributes() {
+ return new CompositeIterable<JavaResourceAttribute>(
+ this.getPersistableFields(),
+ this.getPersistableProperties()
+ );
+ }
+
+ //TODO XmlAccessType.PUBLIC_MEMBER and XmlAccessType.NONE
+ public Iterable<JavaResourceAttribute> getPersistableAttributes(XmlAccessType specifiedAccess) {
+ if (specifiedAccess == null) {
+ throw new IllegalArgumentException("specified access is null"); //$NON-NLS-1$
+ }
+ return (specifiedAccess == XmlAccessType.FIELD) ?
+ this.getPersistableAttributesForFieldAccessType() :
+ this.getPersistableAttributesForPropertyAccessType();
+ }
+
+ private Iterable<JavaResourceAttribute> getPersistableAttributesForFieldAccessType() {
+ return this.getPersistableFields();
+ }
+
+ private Iterable<JavaResourceAttribute> getPersistableAttributesForPropertyAccessType() {
+ return this.getPersistableProperties();
+ }
+
+
+ // ********** CounterMap **********
+
+ private static class CounterMap {
+ private final HashMap<Object, IntReference> counters;
+
+ protected CounterMap(int initialCapacity) {
+ super();
+ this.counters = new HashMap<Object, IntReference>(initialCapacity);
+ }
+
+ /**
+ * Return the incremented count for the specified object.
+ */
+ int increment(Object o) {
+ IntReference counter = this.counters.get(o);
+ if (counter == null) {
+ counter = new IntReference();
+ this.counters.put(o, counter);
+ }
+ counter.increment();
+ return counter.getValue();
+ }
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java
new file mode 100644
index 0000000000..1ca345d79f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceTypeCompilationUnit.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
+
+import java.util.List;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jpt.core.JpaResourceType;
+import org.eclipse.jpt.core.JptCorePlugin;
+import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.utility.CommandExecutor;
+import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
+
+/**
+ * Java compilation unit (source file)
+ * non package-info.java file
+ */
+public final class SourceTypeCompilationUnit
+ extends SourceCompilationUnit
+{
+
+ /**
+ * The primary type of the AST compilation unit. We are not going to handle
+ * multiple types defined in a single compilation unit. Entities must have
+ * a public/protected no-arg constructor, and there is no way to access
+ * the constructor in a package class (which is what all top-level,
+ * non-primary classes must be).
+ */
+ private JavaResourceType type;
+
+
+ // ********** construction **********
+
+ public SourceTypeCompilationUnit(
+ ICompilationUnit compilationUnit,
+ AnnotationProvider annotationProvider,
+ AnnotationEditFormatter annotationEditFormatter,
+ CommandExecutor modifySharedDocumentCommandExecutor) {
+ super(compilationUnit, annotationProvider, annotationEditFormatter, modifySharedDocumentCommandExecutor); // the JPA compilation unit is the root of its sub-tree
+ this.type = this.buildType();
+ }
+
+ private JavaResourceType buildType() {
+ this.openCompilationUnit();
+ CompilationUnit astRoot = this.buildASTRoot();
+ this.closeCompilationUnit();
+ return this.buildPersistentType(astRoot);
+ }
+
+
+ // ********** JavaResourceNode implementation **********
+
+ public void synchronizeWith(CompilationUnit astRoot) {
+ this.syncType(astRoot);
+ }
+
+
+ // ********** JavaResourceNode.Root implementation **********
+
+ /**
+ * NB: return *all* the persistent types since we build them all
+ */
+ public Iterable<JavaResourceType> getTypes() {
+ return (this.type == null) ?
+ EmptyIterable.<JavaResourceType>instance() :
+ this.type.getAllTypes();
+ }
+
+
+ // ********** JpaResourceModel implementation **********
+
+ public JpaResourceType getResourceType() {
+ return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
+ }
+
+
+ // ********** JavaResourceCompilationUnit implementation **********
+
+ public void resolveTypes() {
+ if (this.type != null) {
+ this.type.resolveTypes(this.buildASTRoot());
+ }
+ }
+
+
+ // ********** persistent type **********
+
+ private JavaResourceType buildPersistentType(CompilationUnit astRoot) {
+ TypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
+ return (td == null) ? null : this.buildType(astRoot, td);
+ }
+
+
+ private void syncType(CompilationUnit astRoot) {
+ TypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
+ if (td == null) {
+ this.syncType_(null);
+ } else {
+ if (this.type == null) {
+ this.syncType_(this.buildType(astRoot, td));
+ } else {
+ this.type.synchronizeWith(astRoot);
+ }
+ }
+ }
+
+ private void syncType_(JavaResourceType astType) {
+ JavaResourceType old = this.type;
+ this.type = astType;
+ this.firePropertyChanged(TYPES_COLLECTION, old, astType);
+ }
+
+
+ // ********** internal **********
+
+ private JavaResourceType buildType(CompilationUnit astRoot, TypeDeclaration typeDeclaration) {
+ return SourceType.newInstance(this, typeDeclaration, astRoot);
+ }
+
+ /**
+ * i.e. the type with the same name as the compilation unit;
+ * return the first class or interface (ignore annotations and enums) with
+ * the same name as the compilation unit (file);
+ * NB: this type could be in error if there is an annotation or enum
+ * with the same name preceding it in the compilation unit
+ *
+ * Return null if the parser did not resolve the type declaration's binding.
+ * This can occur if the project JRE is removed (bug 225332).
+ */
+ private TypeDeclaration getPrimaryTypeDeclaration(CompilationUnit astRoot) {
+ String primaryTypeName = this.getPrimaryTypeName();
+ for (AbstractTypeDeclaration atd : this.types(astRoot)) {
+ if (this.nodeIsPrimaryTypeDeclaration(atd, primaryTypeName)) {
+ return (atd.resolveBinding() == null) ? null : (TypeDeclaration) atd;
+ }
+ }
+ return null;
+ }
+
+ private boolean nodeIsPrimaryTypeDeclaration(AbstractTypeDeclaration atd, String primaryTypeName) {
+ return (atd.getNodeType() == ASTNode.TYPE_DECLARATION) &&
+ atd.getName().getFullyQualifiedName().equals(primaryTypeName);
+ }
+
+ private String getPrimaryTypeName() {
+ return this.getCompilationUnitName();
+ }
+
+ // minimize scope of suppressed warnings
+ @SuppressWarnings("unchecked")
+ private List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
+ return astRoot.types();
+ }
+}
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 294a5bb635..4e9acf2039 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
@@ -10,17 +10,16 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
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 95e40c5401..5ec1fa237e 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
@@ -10,17 +10,16 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
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 5c0b1a54b0..23af94d083 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlAnyAttributeAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlAnyAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlAnyAttributeAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
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 799243bc5a..1a71eeb07a 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
@@ -10,14 +10,12 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
@@ -26,6 +24,7 @@ import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
/**
@@ -48,11 +47,11 @@ public final class SourceXmlAnyElementAnnotation
// ********** constructors **********
- public SourceXmlAnyElementAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlAnyElementAnnotation(JavaResourceAttribute parent, Attribute attribute) {
this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
}
- public SourceXmlAnyElementAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
+ public SourceXmlAnyElementAnnotation(JavaResourceAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
super(parent, attribute, daa, annotationAdapter);
this.laxDeclarationAdapter = this.buildLaxAdapter(daa);
this.laxAdapter = this.buildShortCircuitBooleanElementAdapter(this.laxDeclarationAdapter);
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 a120baed32..701a09b33e 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlAttachmentRefAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlAttachmentRefAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlAttachmentRefAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
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 87ada956c6..cc19c54143 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
@@ -10,12 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
@@ -23,6 +21,7 @@ import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
/**
@@ -48,11 +47,11 @@ public final class SourceXmlAttributeAnnotation
// ********** constructors **********
- public SourceXmlAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlAttributeAnnotation(JavaResourceAttribute parent, Attribute attribute) {
this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
}
- public SourceXmlAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
+ public SourceXmlAttributeAnnotation(JavaResourceAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
super(parent, attribute, daa, annotationAdapter);
this.nameDeclarationAdapter = this.buildNameAdapter(daa);
this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
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 c6577f2559..a226f88e5d 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
@@ -10,18 +10,14 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
@@ -32,6 +28,9 @@ import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
/**
@@ -70,7 +69,7 @@ public final class SourceXmlElementAnnotation
// ********** constructors **********
- public SourceXmlElementAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlElementAnnotation(JavaResourceAttribute parent, Attribute attribute) {
this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
}
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 c369c9a9e8..f7f5176314 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
@@ -10,14 +10,12 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
@@ -25,6 +23,7 @@ import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.MethodAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
/**
@@ -64,7 +63,7 @@ public final class SourceXmlElementDeclAnnotation
// ********** constructors **********
- public SourceXmlElementDeclAnnotation(JavaResourcePersistentAttribute parent, MethodAttribute method) {
+ public SourceXmlElementDeclAnnotation(JavaResourceAttribute parent, MethodAttribute method) {
super(parent, method, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(method, DECLARATION_ANNOTATION_ADAPTER));
this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
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 2c15711246..1e3b3d1497 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -19,9 +18,6 @@ import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter
import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
@@ -32,6 +28,9 @@ import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
/**
@@ -58,7 +57,7 @@ public final class SourceXmlElementRefAnnotation
private String type;
// ********** constructors **********
- public SourceXmlElementRefAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlElementRefAnnotation(JavaResourceAttribute parent, Attribute attribute) {
this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
}
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 2332593e39..af464afc4e 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
@@ -12,13 +12,11 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Vector;
import org.eclipse.jdt.core.dom.Annotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefsAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
@@ -36,7 +34,7 @@ public class SourceXmlElementRefsAnnotation
private final Vector<XmlElementRefAnnotation> elementRefs = new Vector<XmlElementRefAnnotation>();
- public SourceXmlElementRefsAnnotation(JavaResourcePersistentAttribute parent, Attribute attibute) {
+ public SourceXmlElementRefsAnnotation(JavaResourceAttribute parent, Attribute attibute) {
super(parent, attibute, DECLARATION_ANNOTATION_ADAPTER);
}
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 9c439c196f..fe1af2899d 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
@@ -10,12 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
@@ -23,6 +21,7 @@ import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
/**
@@ -52,11 +51,11 @@ public final class SourceXmlElementWrapperAnnotation
// ********** constructors **********
- public SourceXmlElementWrapperAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlElementWrapperAnnotation(JavaResourceAttribute parent, Attribute attribute) {
this(parent, attribute, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(attribute, DECLARATION_ANNOTATION_ADAPTER));
}
- public SourceXmlElementWrapperAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
+ public SourceXmlElementWrapperAnnotation(JavaResourceAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
super(parent, attribute, daa, annotationAdapter);
this.nameDeclarationAdapter = this.buildNameAdapter(daa);
this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
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 3d5ac6cf78..8394656124 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
@@ -12,13 +12,11 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Vector;
import org.eclipse.jdt.core.dom.Annotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementsAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
@@ -36,7 +34,7 @@ public class SourceXmlElementsAnnotation
private final Vector<XmlElementAnnotation> elements = new Vector<XmlElementAnnotation>();
- public SourceXmlElementsAnnotation(JavaResourcePersistentAttribute parent, Attribute attibute) {
+ public SourceXmlElementsAnnotation(JavaResourceAttribute parent, Attribute attibute) {
super(parent, attibute, DECLARATION_ANNOTATION_ADAPTER);
}
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 af24fcfce6..7ebfffa48c 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
@@ -10,13 +10,11 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
@@ -24,6 +22,7 @@ import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
/**
@@ -41,7 +40,7 @@ public final class SourceXmlEnumAnnotation
private String fullyQualifiedValueClassName;
- public SourceXmlEnumAnnotation(JavaResourcePersistentType parent, Type type) {
+ public SourceXmlEnumAnnotation(JavaResourceType parent, Type type) {
super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
}
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 81f5a85802..b51dd4f339 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
@@ -10,11 +10,9 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.Attribute;
@@ -22,6 +20,7 @@ import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.FieldAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
/**
@@ -37,7 +36,7 @@ public final class SourceXmlEnumValueAnnotation
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
- public SourceXmlEnumValueAnnotation(JavaResourcePersistentAttribute parent, FieldAttribute attribute) {
+ public SourceXmlEnumValueAnnotation(JavaResourceAttribute parent, FieldAttribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
}
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 e3113af74e..3a011aef29 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlIDAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlIDAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlIDAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
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 d793654828..8cb53ab75d 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlIDREFAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlIDREFAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlIDREFAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
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 a52074a301..be1d3c6021 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.Member;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlInlineBinaryDataAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlInlineBinaryDataAnnotation(JavaResourcePersistentMember parent, Member member) {
+ public SourceXmlInlineBinaryDataAnnotation(JavaResourceMember parent, Member member) {
super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
}
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 bf6a5cf32e..ebf7b4b5b3 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -19,9 +18,6 @@ import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter
import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
@@ -32,6 +28,9 @@ import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java
index 6f7ceb540b..36841fa76d 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlJavaTypeAdaptersAnnotation.java
@@ -12,13 +12,11 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Vector;
import org.eclipse.jdt.core.dom.Annotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdaptersAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
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 391dce952e..7ce894f74a 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlListAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlListAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlListAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
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 de71ad53da..744d6e7ccc 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
@@ -10,17 +10,16 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
/**
@@ -36,7 +35,7 @@ public final class SourceXmlMimeTypeAnnotation
private final AnnotationElementAdapter<String> valueAdapter;
private String value;
- public SourceXmlMimeTypeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlMimeTypeAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
}
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 d58ce4f1ad..3fd3ee1a82 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlMixedAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlMixedAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlMixedAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
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 dfa569b7c7..34534c24ec 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
@@ -10,12 +10,9 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
@@ -24,6 +21,8 @@ import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlNsAnnotation;
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 17abb6be80..ab56b35e80 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.Type;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlRegistryAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlRegistryAnnotation(JavaResourcePersistentType parent, Type type) {
+ public SourceXmlRegistryAnnotation(JavaResourceType parent, Type type) {
super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
}
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 5577c624dd..e2e807962e 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
@@ -10,17 +10,16 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
/**
@@ -40,7 +39,7 @@ public final class SourceXmlRootElementAnnotation
private final AnnotationElementAdapter<String> namespaceAdapter;
private String namespace;
- public SourceXmlRootElementAnnotation(JavaResourcePersistentType parent, Type type) {
+ public SourceXmlRootElementAnnotation(JavaResourceType parent, Type type) {
super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
this.nameAdapter = this.buildAnnotationElementAdapter(NAME_ADAPTER);
this.namespaceAdapter = this.buildAnnotationElementAdapter(NAMESPACE_ADAPTER);
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 2b82653cae..4e1eee1a8f 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
@@ -11,22 +11,20 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Vector;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.AnnotationContainer;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
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;
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 a13420eeff..f72817474e 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -19,8 +18,6 @@ import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter
import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
@@ -31,6 +28,8 @@ import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceNode;
+import org.eclipse.jpt.jaxb.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypesAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypesAnnotation.java
index cd8bfe0492..b89afcdefe 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypesAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/internal/resource/java/source/SourceXmlSchemaTypesAnnotation.java
@@ -12,13 +12,11 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Vector;
import org.eclipse.jdt.core.dom.Annotation;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.utility.jdt.AnnotatedPackage;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypesAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
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 002ba690f5..9e60e6cb9d 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
@@ -12,18 +12,17 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Arrays;
import java.util.Vector;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
@@ -42,7 +41,7 @@ public final class SourceXmlSeeAlsoAnnotation
private final AnnotationElementAdapter<String[]> valueAdapter;
private final Vector<String> classes = new Vector<String>();
- public SourceXmlSeeAlsoAnnotation(JavaResourcePersistentType parent, Type type) {
+ public SourceXmlSeeAlsoAnnotation(JavaResourceType parent, Type type) {
super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
this.valueDeclarationAdapter = buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JAXB.XML_SEE_ALSO__VALUE);
this.valueAdapter = this.buildArrayAnnotationElementAdapter(this.valueDeclarationAdapter);
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 e324982654..784052d89e 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.utility.jdt.Member;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlTransientAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlTransientAnnotation(JavaResourcePersistentMember parent, Member member) {
+ public SourceXmlTransientAnnotation(JavaResourceMember parent, Member member) {
super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
}
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 b69995b70b..aa63e59983 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
@@ -12,14 +12,12 @@ package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import java.util.Arrays;
import java.util.Vector;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
+import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
@@ -27,6 +25,7 @@ import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
import org.eclipse.jpt.core.utility.jdt.Type;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
import org.eclipse.jpt.utility.internal.CollectionTools;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
@@ -63,7 +62,7 @@ public final class SourceXmlTypeAnnotation
private final AnnotationElementAdapter<String[]> propOrderAdapter;
private final Vector<String> propOrder = new Vector<String>();
- public SourceXmlTypeAnnotation(JavaResourcePersistentType parent, Type type) {
+ public SourceXmlTypeAnnotation(JavaResourceType parent, Type type) {
super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
this.factoryClassAdapter = this.buildAnnotationElementAdapter(FACTORY_CLASS_ADAPTER);
this.factoryMethodAdapter = this.buildAnnotationElementAdapter(FACTORY_METHOD_ADAPTER);
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 c13456c2ec..4328906b2e 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
@@ -10,11 +10,10 @@
package org.eclipse.jpt.jaxb.core.internal.resource.java.source;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
import org.eclipse.jpt.core.utility.jdt.Attribute;
import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
/**
@@ -26,7 +25,7 @@ public final class SourceXmlValueAnnotation
{
public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- public SourceXmlValueAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
+ public SourceXmlValueAnnotation(JavaResourceAttribute parent, Attribute attribute) {
super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
index 8a3aa313c1..bd93d6b9cb 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatform.java
@@ -10,8 +10,8 @@
package org.eclipse.jpt.jaxb.core.platform;
import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
import org.eclipse.jpt.jaxb.core.JaxbFactory;
import org.eclipse.jpt.jaxb.core.JaxbFile;
import org.eclipse.jpt.jaxb.core.JaxbProject;
@@ -53,7 +53,7 @@ public interface JaxbPlatform {
* Return an annotation provider responsible for determining what Java
* annotations are supported and constructing java resource model objects.
*/
- JpaAnnotationProvider getAnnotationProvider();
+ AnnotationProvider getAnnotationProvider();
/**
* Return a formatter that can clean up the Java annotations added to source
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
index 55f6a68eca..b19e695254 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/platform/JaxbPlatformDefinition.java
@@ -9,7 +9,7 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.platform;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
import org.eclipse.jpt.jaxb.core.JaxbFactory;
import org.eclipse.jpt.jaxb.core.JaxbPlatformProvider;
@@ -27,7 +27,7 @@ public interface JaxbPlatformDefinition {
JaxbFactory buildFactory();
- JpaAnnotationDefinitionProvider[] getAnnotationDefinitionProviders();
+ AnnotationDefinitionProvider[] getAnnotationDefinitionProviders();
JaxbPlatformProvider buildPlatformProvider();
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/Annotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/Annotation.java
new file mode 100644
index 0000000000..af2a73bee3
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/Annotation.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+
+/**
+ * Common Java resource annotation behavior
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface Annotation
+ extends JavaResourceNode
+{
+ /**
+ * Return the annotation's fully qualified name, as opposed to the value of
+ * the annotation's 'name' element. For example:
+ * @com.foo.Bar(name="Thomas")
+ * #getAnnotationName() will return "com.foo.Bar".
+ * In typical subclasses, #getName() would return "Thomas".
+ * @see JAXB
+ */
+ String getAnnotationName();
+
+ /**
+ * Return the corresponding JDT DOM annotation from the specified
+ * AST compilation unit.
+ */
+ org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot);
+
+ /**
+ * Create and add the corresponding Java annotation to the JDT DOM.
+ */
+ void newAnnotation();
+
+ /**
+ * Remove the corresponding Java annotation from the JDT DOM.
+ */
+ void removeAnnotation();
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationContainer.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationContainer.java
new file mode 100644
index 0000000000..a981008e6e
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationContainer.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+
+/**
+ * Common behavior for all annotation "containers".
+ * This interface is used mainly in
+ * {@link org.eclipse.jpt.jaxb.core.internal.resource.java.source.AnnotationContainerTools}.
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface AnnotationContainer<T extends NestableAnnotation>
+{
+ /**
+ * Return the corresponding JDT DOM annotation from the specified
+ * AST compilation unit. Used as a starting point when traversing the AST.
+ */
+ org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot);
+
+ /**
+ * Return the name of the container annotation's element that is used
+ * to indicate the nested annotations (typically "value").
+ * Used when traversing the AST.
+ */
+ String getElementName();
+
+ /**
+ * Return the name of the nested annotations held by the container.
+ * Used when traversing the AST.
+ */
+ String getNestedAnnotationName();
+
+ /**
+ * Return the nested annotations held by the container.
+ */
+ Iterable<T> getNestedAnnotations();
+
+ /**
+ * Return the number of nested annotations held by the container.
+ */
+ int getNestedAnnotationsSize();
+
+ /**
+ * Add a nested annotation to the container
+ * without firing change notification.
+ */
+ T addNestedAnnotation();
+
+ /**
+ * The specified nested annotation was added to the container at the
+ * specified index; notify interested parties.
+ */
+ void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation);
+
+ /**
+ * Move the nested annotation at the specified source index in the
+ * container to the specified target index without firing change notification.
+ * Return the moved nested annotation.
+ */
+ T moveNestedAnnotation(int targetIndex, int sourceIndex);
+
+ /**
+ * Remove the nested annotation at the specified index from the
+ * container without firing change notification.
+ */
+ T removeNestedAnnotation(int index);
+
+ /**
+ * Remove the nested annotations starting at the specified index from the
+ * container; notify interested parties.
+ */
+ void syncRemoveNestedAnnotations(int index);
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java
new file mode 100644
index 0000000000..c33d6680c1
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/AnnotationDefinition.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jpt.core.utility.jdt.AnnotatedElement;
+
+/**
+ * Used to build Annotations discovered in the Java source code.
+ * To provide new AnnotationDefinitions, create a new JaxbPlatform
+ * by implementing JaxbPlatformDefinition.
+ *
+ * @see Annotation
+ * @see org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDefinition
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface AnnotationDefinition
+{
+ /**
+ * Return the name of the annotation the definition will build in the
+ * various #build...(...) methods.
+ */
+ String getAnnotationName();
+
+ /**
+ * Build and return an annotation for the specified annotated element.
+ */
+ Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement);
+
+ /**
+ * Build and return an annotation for the specified JDT annotation
+ * on the specified annotated element.
+ */
+ Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation);
+
+ /**
+ * Build and return a "null" annotation for the specified annotated element.
+ * Only certain annotations are required to have "null" implementations;
+ * typically the annotations with reasonably complex default behavior.
+ * The "null" annotation is used by the corresponding default context model.
+ * The "null" annotation simplifies the context model code, allowing the
+ * context model to simply set various bits of state (e.g. 'name') and the
+ * "null" annotation will create a new "real" annotation and forward the
+ * new state to it. This reduces the number of null checks in the context
+ * model (hopefully).
+ */
+ Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent);
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/ContainerAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/ContainerAnnotation.java
new file mode 100644
index 0000000000..5f0f13d0c9
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/ContainerAnnotation.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+/**
+ * Common behavior for all "container" annotations.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 2.0
+ */
+public interface ContainerAnnotation<T extends NestableAnnotation>
+ extends Annotation, AnnotationContainer<T>
+{
+ // combine two interfaces
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java
new file mode 100644
index 0000000000..d248d5b6bb
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAnnotatedElement.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.utility.TextRange;
+
+/**
+ * Java source code or binary annotated element.
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaResourceAnnotatedElement
+ extends JavaResourceNode
+{
+ // ********** annotations **********
+
+ /**
+ * String associated with changes to the "annotations" collection
+ */
+ String ANNOTATIONS_COLLECTION = "annotations"; //$NON-NLS-1$
+
+ /**
+ * Return the member's annotations in the order that they appear.
+ * Do not return duplicate annotations as this error is handled by the Java
+ * compiler.
+ */
+ Iterable<Annotation> getAnnotations();
+
+ /**
+ * Return the number of annotations.
+ */
+ int getAnnotationsSize();
+
+ /**
+ * Return the annotation with the specified name.
+ * Return the first if there are duplicates in the source code.
+ */
+ Annotation getAnnotation(String annotationName);
+
+ /**
+ * Return the specified annotation.
+ * Return the first if there are duplicates in the source code.
+ * Do not return null, but a Null Object instead if no annotation
+ * with the specified name exists in the source code.
+ */
+ Annotation getNonNullAnnotation(String annotationName);
+
+ /**
+ * Return the nestable annotations with the specified name in the order that
+ * they appear.
+ * If nestable and container annotations are both specified on the
+ * member directly, return only the nestable annotations specified within
+ * the container annotation.
+ */
+ // TODO tie the singular and plural annotations together so we can generate
+ // a validation error when both are specified
+ Iterable<NestableAnnotation> getAnnotations(String nestableAnnotationName, String containerAnnotationName);
+
+ /**
+ * Add an annotation with the specified name.
+ * Return the newly-created annotation.
+ */
+ Annotation addAnnotation(String annotationName);
+
+ /**
+ * Add a new nestable annotation with the specified name.
+ * Create a new container annotation if necessary and add the nestable
+ * annotation to it.
+ * If both the nestable annotation and the container annotation already
+ * exist, then add to the container annotation, leaving the existing
+ * nestable annotation alone.
+ * If only the nestable annotation exists, then create the new container
+ * annotation and move the existing nestable annotation to it along with
+ * the new one. If neither annotation exists, then create a new nestable
+ * annotation.
+ */
+ NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
+
+ /**
+ * Move the nestable annotation found in the specified container
+ * annotation at the specified source index to the specified target index.
+ */
+ void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName);
+
+ /**
+ * Remove the specified annotation.
+ */
+ void removeAnnotation(String annotationName);
+
+ /**
+ * Remove the specified nestable annotation from the container annotation at the specified
+ * index.
+ * If there is no container, assume the index is zero and this does the same as
+ * {@link #removeAnnotation(String)}
+ */
+ void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
+
+
+ // ********** queries **********
+
+ /**
+ * Return whether the underlying JDT member is currently annotated with any recognized
+ * annotations.
+ */
+ boolean isAnnotated();
+
+ /**
+ * Return the text range for the member's name.
+ */
+ TextRange getNameTextRange(CompilationUnit astRoot);
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java
new file mode 100644
index 0000000000..7f074507a9
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceAttribute.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jpt.utility.MethodSignature;
+import org.eclipse.jpt.utility.internal.iterables.ListIterable;
+
+/**
+ * Java source code or binary attribute (field or method)
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaResourceAttribute
+ extends JavaResourceMember
+{
+ /**
+ * The Java resource attribute's name does not change.
+ */
+ String getName();
+
+ /**
+ * Return a null annotation for the specified annotation name.
+ * Return null if the specified annotation name is null.
+ * The corresponding AnnotationDefinition must implement #buildNullAnnotation()
+ * {@link AnnotationDefinition#buildNullAnnotation(JavaResourceMember,
+ * org.eclipse.jpt.core.utility.jdt.Member)}
+ */
+ Annotation buildNullAnnotation(String annotationName);
+
+ /**
+ * Whether the Java resource persistent attribute is a field does not change.
+ */
+ boolean isField();
+
+ /**
+ * Whether the Java resource persistent attribute is a property does not change.
+ */
+ boolean isProperty();
+
+ /**
+ * Return the access type explicitly specified by the javax.persistence.Access annotation.
+ * Return null if the Access annotation is not present.
+ * For JPA 1.0 this is always going to return null; Access annotation is not supported in 1.0.
+ */
+ XmlAccessType getSpecifiedAccess();
+
+ /**
+ * Return whether the attribute's type implements or extends the specified
+ * type.
+ */
+ boolean typeIsSubTypeOf(String typeName);
+
+ /**
+ * Return whether the attribute's type is a "variable" primitive type
+ * (i.e. any primitive type except 'void').
+ */
+ boolean typeIsVariablePrimitive();
+
+ /**
+ * Return whether the Java resource persistent attribute is for the specified
+ * method.
+ */
+ boolean isFor(MethodSignature methodSignature, int occurrence);
+
+ /**
+ * @see java.lang.reflect.Modifier
+ */
+ int getModifiers();
+ String MODIFIERS_PROPERTY = "modifiers"; //$NON-NLS-1$
+
+ /**
+ * Return the resolved, qualified name of the attribute's type
+ * (e.g. "java.util.Collection" or "byte[]").
+ * If the type is an array, this name will include the appropriate number
+ * of bracket pairs.
+ * This name will not include the type's generic type arguments
+ * (e.g. "java.util.Collection<java.lang.String>" will only return
+ * "java.util.Collection").
+ * @see #typeTypeArgumentNames()
+ */
+ String getTypeName();
+ String TYPE_NAME_PROPERTY = "typeName"; //$NON-NLS-1$
+
+ /**
+ * Return whether the attribute type is an interface.
+ */
+ boolean typeIsInterface();
+ String TYPE_IS_INTERFACE_PROPERTY = "typeIsInterface"; //$NON-NLS-1$
+
+ /**
+ * Return whether the attribute type is an enum.
+ */
+ boolean typeIsEnum();
+ String TYPE_IS_ENUM_PROPERTY = "typeIsEnum"; //$NON-NLS-1$
+
+ /**
+ * Return the names of the attribute type's superclasses.
+ */
+ ListIterable<String> getTypeSuperclassNames();
+ String TYPE_SUPERCLASS_NAMES_LIST = "typeSuperclassNames"; //$NON-NLS-1$
+
+ /**
+ * Return the names of the attribute type's interfaces.
+ */
+ Iterable<String> getTypeInterfaceNames();
+ String TYPE_INTERFACE_NAMES_COLLECTION = "typeInterfaceNames"; //$NON-NLS-1$
+
+ /**
+ * Return the names of the attribute type's type arguments.
+ * The name for any argument that is an array will contain the appropriate
+ * number of bracket pairs.
+ * The names will not include any further generic type arguments.
+ */
+ ListIterable<String> getTypeTypeArgumentNames();
+ String TYPE_TYPE_ARGUMENT_NAMES_LIST = "typeTypeArgumentNames"; //$NON-NLS-1$
+
+ int getTypeTypeArgumentNamesSize();
+
+ String getTypeTypeArgumentName(int index);
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java
new file mode 100644
index 0000000000..2267bcb4ea
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceClassFile.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+
+/**
+ * Java class file
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaResourceClassFile
+ extends JavaResourceNode
+{
+ /**
+ * Return the class file's persistent type.
+ */
+ JavaResourceType getPersistentType();
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java
new file mode 100644
index 0000000000..5ce9f27d1f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceCompilationUnit.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
+import org.eclipse.jpt.utility.CommandExecutor;
+
+/**
+ * Dali resource for JDT compilation unit.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaResourceCompilationUnit
+ extends JavaResourceNode.Root
+{
+ /**
+ * Return the corresponding JDT compilation unit.
+ */
+ ICompilationUnit getCompilationUnit();
+
+ /**
+ * Return the JPA project's annotation formatter. This is used to make any
+ * manipulated annotations reasonably readable after being written to the
+ * Java source file.
+ */
+ AnnotationEditFormatter getAnnotationEditFormatter();
+
+ /**
+ * This allows the resource model to modify the Java source code on the
+ * UI thread when it is executing on another thread.
+ */
+ CommandExecutor getModifySharedDocumentCommandExecutor();
+
+ /**
+ * Resolve type information that could be dependent on other files being
+ * added/removed.
+ */
+ void resolveTypes();
+
+ /**
+ * Something in Java has changed (typically either the compilation unit's
+ * source code or the Java classpath); synchronize the compilation unit's
+ * state with the Java source code etc.
+ */
+ void synchronizeWithJavaSource();
+
+ /**
+ * Build an AST for the compilation unit with its bindings resolved.
+ */
+ CompilationUnit buildASTRoot();
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java
new file mode 100644
index 0000000000..f02b804d4c
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceMember.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+
+/**
+ * Java source code or binary persistent member.
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 2.0
+ */
+public interface JavaResourceMember
+ extends JavaResourceAnnotatedElement
+{
+
+ // ********** annotations **********
+
+ /**
+ * Sets the specified primary annotation as the first annotation, and removes all known
+ * annotations (i.e. does not remove non-persistence annotations) which are not included
+ * in the supporting annotations.
+ */
+ Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames);
+
+
+ // ********** queries **********
+
+ /**
+ * Return whether the underlying JDT member is persistable according to
+ * the JPA spec.
+ */
+ boolean isPersistable();
+ String PERSISTABLE_PROPERTY = "persistable"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type is final.
+ */
+ boolean isFinal();
+ String FINAL_PROPERTY = "final"; //$NON-NLS-1$
+
+ /**
+ * Return whether the Java resource persistent member is for the specified
+ * member.
+ */
+ boolean isFor(String memberName, int occurrence);
+
+
+ // ********** behavior **********
+
+ /**
+ * Resolve type information that could be dependent on changes elsewhere
+ * in the workspace.
+ */
+ void resolveTypes(CompilationUnit astRoot);
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java
new file mode 100644
index 0000000000..6f7df4c208
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceNode.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.JpaResourceModel;
+import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.utility.model.Model;
+
+/**
+ * Common interface for Java resource nodes (source code or binary).
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaResourceNode
+ extends Model
+{
+
+ /**
+ * Return the Eclipse file that contains the Java resource node
+ * (typically either a Java source code file or a JAR).
+ */
+ IFile getFile();
+
+ /**
+ * Return the root of the Java resource containment hierarchy
+ * (typically either a compilation unit or a package fragment root).
+ */
+ Root getRoot();
+
+ /**
+ * Return the [source] node's root (the compilation unit).
+ */
+ // TODO get rid of this method...?
+ JavaResourceCompilationUnit getJavaResourceCompilationUnit();
+
+ /**
+ * Return the [source] node's text range in the compilation unit's file.
+ */
+ TextRange getTextRange(CompilationUnit astRoot);
+
+ /**
+ * Initialize the [source] node from the specified AST.
+ */
+ void initialize(CompilationUnit astRoot);
+
+ /**
+ * Synchronize the [source] node with the specified AST.
+ */
+ void synchronizeWith(CompilationUnit astRoot);
+
+
+ /**
+ * Root of Java resource model containment hierarchy.
+ */
+ interface Root extends JavaResourceNode, JpaResourceModel {
+
+ /**
+ * Return the root's Java resource types.
+ */
+ Iterable<JavaResourceType> getTypes();
+ String TYPES_COLLECTION = "type"; //$NON-NLS-1$
+
+ /**
+ * Called (via a hook in change notification) whenever anything in the
+ * Java resource model changes. Forwarded to listeners.
+ */
+ void resourceModelChanged();
+
+ /**
+ * Return the annotation provider that supplies the annotations found
+ * in the Java resource model.
+ */
+ AnnotationProvider getAnnotationProvider();
+
+ }
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
new file mode 100644
index 0000000000..cc3e9c1461
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackage.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ * Java source code of package-info
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ */
+public interface JavaResourcePackage
+ extends
+ JavaResourceAnnotatedElement
+{
+
+ /**
+ * The Java resource persistent package's name.
+ */
+ String getName();
+ String NAME_PROPERTY = "name"; //$NON-NLS-1$
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java
new file mode 100644
index 0000000000..f488cc96a9
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragment.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+
+/**
+ * Java package fragment
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.2
+ * @since 2.2
+ */
+public interface JavaResourcePackageFragment
+ extends JavaResourceNode
+{
+ /**
+ * Return the package fragment's class files that contain "persistable" types.
+ */
+ Iterable<JavaResourceClassFile> getClassFiles();
+ String CLASS_FILES_COLLECTION = "classFiles"; //$NON-NLS-1$
+
+ /**
+ * Return the size of the package fragment's class files.
+ */
+ int getClassFilesSize();
+
+ /**
+ * Return the package fragment's Java persistent types.
+ * Return only the files that are annotated with JAXB annotations.
+ */
+ Iterable<JavaResourceType> getPersistedTypes();
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java
new file mode 100644
index 0000000000..e23bc87f4f
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageFragmentRoot.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+
+/**
+ * Java package fragement root
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.2
+ * @since 2.2
+ */
+public interface JavaResourcePackageFragmentRoot
+ extends JavaResourceNode.Root
+{
+ /**
+ * Return the package fragment root's package fragments.
+ */
+ Iterable<JavaResourcePackageFragment> getPackageFragments();
+ String PACKAGE_FRAGMENTS_COLLECTION = "packageFragments"; //$NON-NLS-1$
+
+ /**
+ * Return the size of the package fragment root's package fragments.
+ */
+ int getPackageFragmentsSize();
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java
new file mode 100644
index 0000000000..29a829c232
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourcePackageInfoCompilationUnit.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+/**
+ * Dali resource for JDT compilation unit named package-info.java.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface JavaResourcePackageInfoCompilationUnit
+ extends JavaResourceCompilationUnit
+{
+ JavaResourcePackage getPackage();
+ String PACKAGE = "package"; //$NON-NLS-1$
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java
new file mode 100644
index 0000000000..e9ac3df638
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/JavaResourceType.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+import org.eclipse.jdt.core.IPackageFragment;
+
+/**
+ * Java source code or binary type.
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 2.0
+ */
+public interface JavaResourceType
+ extends JavaResourceMember
+{
+ /**
+ * Return the unqualified (short) type name.
+ */
+ String getName();
+ String NAME_PROPERTY = "name"; //$NON-NLS-1$
+
+ /**
+ * Return the fully qualified type name.
+ */
+ String getQualifiedName();
+ String QUALIFIED_NAME_PROPERTY = "qualifiedName"; //$NON-NLS-1$
+
+ /**
+ * Return the package name.
+ */
+ String getPackageName();
+ String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$
+
+ /**
+ * Return the fully qualified name of the type's superclass.
+ */
+ String getSuperclassQualifiedName();
+ String SUPERCLASS_QUALIFIED_NAME_PROPERTY = "superclassQualifiedName"; //$NON-NLS-1$
+
+ /**
+ * Return the name of the type's "declaring type".
+ * Return <code>null</code> if the type is a top-level type.
+ */
+ String getDeclaringTypeName();
+ String DECLARING_TYPE_NAME_PROPERTY = "declaringTypeName"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type is abstract.
+ */
+ boolean isAbstract();
+ String ABSTRACT_PROPERTY = "abstract"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type is a member type.
+ */
+ boolean isMemberType();
+ String MEMBER_TYPE_PROPERTY = "memberType"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type is static.
+ */
+ boolean isStatic();
+ String STATIC_PROPERTY = "static"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type has a no-arg constructor (private, protected, or public)
+ */
+ boolean hasNoArgConstructor();
+ String NO_ARG_CONSTRUCTOR_PROPERTY = "noArgConstructor"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type has a private no-arg constructor
+ */
+ boolean hasPrivateNoArgConstructor();
+ String PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY = "privateNoArgConstructor"; //$NON-NLS-1$
+
+ /**
+ * Return whether the type is annotated with any annotations that determine whether and
+ * how the type is persisted
+ */
+ boolean isMapped();
+
+ /**
+ * Return whether the type has any attributes that have JAXB annotations
+ * on them (which can be used to infer the type's access type).
+ */
+ boolean hasAnyAnnotatedAttributes();
+
+ boolean isIn(IPackageFragment packageFragment);
+
+
+ // ********** types **********
+
+ /**
+ * Return the immediately nested types (children).
+ */
+ Iterable<JavaResourceType> getTypes();
+ String TYPES_COLLECTION = "types"; //$NON-NLS-1$
+
+ /**
+ * Return all the types; the type itself, its children, its grandchildren,
+ * etc.
+ */
+ Iterable<JavaResourceType> getAllTypes();
+
+ /**
+ * Return the immediately nested persistable types.
+ */
+ Iterable<JavaResourceType> getPersistableTypes();
+
+
+ // ********** fields **********
+
+ /**
+ * Return the type's fields.
+ */
+ Iterable<JavaResourceAttribute> getFields();
+ String FIELDS_COLLECTION = "fields"; //$NON-NLS-1$
+
+ /**
+ * Return the type's persistable fields.
+ */
+ Iterable<JavaResourceAttribute> getPersistableFields();
+
+
+ // ********** methods **********
+
+ /**
+ * Return the type's methods. This returns *all* methods from the JDT Type
+ */
+ Iterable<JavaResourceAttribute> getMethods();
+ String METHODS_COLLECTION = "methods"; //$NON-NLS-1$
+
+ /**
+ * Return the type's persistable properties. This returns only the getter methods
+ * that match the JavaBeans criteria for JPA, hence the name properties instead of methods
+ */
+ Iterable<JavaResourceAttribute> getPersistableProperties();
+
+
+ // ********** attributes **********
+
+ /**
+ * Return the type's persistable fields and properties.
+ * {@link JavaResourceMember#isPersistable()}
+ */
+ Iterable<JavaResourceAttribute> getPersistableAttributes();
+
+ /**
+ * Return the persistable properties and/or fields given the non-null specified access type
+ * {@link JavaResourceMember#isPersistable()}
+ */
+ Iterable<JavaResourceAttribute> getPersistableAttributes(XmlAccessType specifiedAccess);
+
+}
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java
new file mode 100644
index 0000000000..63224828e8
--- /dev/null
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/NestableAnnotation.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.resource.java;
+
+/**
+ * Interface for dealing with annotations that can be "nested" within other
+ * annotations, typically within arrays.
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.0
+ * @since 2.0
+ */
+public interface NestableAnnotation
+ extends Annotation
+{
+ // currently using this when the NestableAnnotation is moved from
+ // stand-alone to nested or from nested to stand-alone;
+ // not the greatest, since you have to make sure to call all setter methods
+ void initializeFrom(NestableAnnotation oldAnnotation);
+
+ /**
+ * Move the annotation to the specified index within its container annotation.
+ * This should only be called when the annotation is actually nested.
+ */
+ void moveAnnotation(int index);
+
+}
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 78fef166ee..e71b1ecb3a 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 6e4eb53075..2cf18032b2 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 39e0f87074..2a0f79dd4e 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 a27b433886..b07d7126b1 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 7160cda4aa..f02dfaeba5 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 a0a66125ac..816d1774ed 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 7cdba6a3f4..0b6bad2564 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 d18d2abdfa..cc4cb3449f 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 b195d2205a..16c981dba4 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 4fe3c5c027..c08a95073e 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
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
/**
* Corresponds to the JAXB annotation
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 3fcc81df26..3162d01e58 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 3ee71c301b..c2319bce29 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
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
/**
* Corresponds to the JAXB annotation
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 31157d2f08..a593461806 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 659606a564..a9ff3df184 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 dd59a82cd6..98379fdbe0 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 911c2e7dbd..eea217cdf6 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 ef26842510..1e1e7c97ec 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 ab657ab8c9..0d43cf8cb6 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java
index 0775044510..c7481c63d3 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlJavaTypeAdaptersAnnotation.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
/**
* Corresponds to the JAXB annotation
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 82c5fe8ea2..6b32924649 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 d4d6b2919f..9b599de2e4 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 e2e3255d98..832cb98570 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB annotation
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 c467d4a29b..cdce62b895 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 6f3aceac16..0ed5752e78 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 33a5ebb81f..9dc5b2f6a7 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
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 c874a8f022..99ab23eb2b 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
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 649b595814..a06c7cab0a 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
/**
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java
index 9d922c91c5..c0ebdf7ea6 100644
--- a/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java
+++ b/jaxb/plugins/org.eclipse.jpt.jaxb.core/src/org/eclipse/jpt/jaxb/core/resource/java/XmlSchemaTypesAnnotation.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
public interface XmlSchemaTypesAnnotation
extends ContainerAnnotation<XmlSchemaTypeAnnotation> {
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 d64b416261..39d48c77b0 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
/**
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 7dbaabc345..65a62172ff 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB 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 7ec151211c..5081e214d8 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
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jaxb.core.resource.java;
import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.utility.internal.iterables.ListIterable;
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 82d6a30869..74fa320c04 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
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.resource.java;
-import org.eclipse.jpt.core.resource.java.Annotation;
/**
* Corresponds to the JAXB annotation
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JavaResourceModelTestCase.java
new file mode 100644
index 0000000000..31b0b51ff3
--- /dev/null
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JavaResourceModelTestCase.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
+
+import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IElementChangedListener;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaElementDelta;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jpt.core.internal.utility.jdt.NullAnnotationEditFormatter;
+import org.eclipse.jpt.core.tests.internal.utility.jdt.AnnotationTestCase;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
+import org.eclipse.jpt.jaxb.core.AnnotationProvider;
+import org.eclipse.jpt.jaxb.core.internal.GenericAnnotationProvider;
+import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceTypeCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.utility.CommandExecutor;
+import org.eclipse.jpt.utility.internal.BitTools;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.jpt.utility.internal.ReflectionTools;
+import org.eclipse.jpt.utility.internal.StringTools;
+
+@SuppressWarnings("nls")
+public abstract class JavaResourceModelTestCase
+ extends AnnotationTestCase {
+
+ private JavaElementChangeListener javaElementChangeListener;
+ protected JavaResourceCompilationUnit javaResourceCompilationUnit;
+
+
+ public JavaResourceModelTestCase(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ this.javaElementChangeListener = new JavaElementChangeListener();
+ JavaCore.addElementChangedListener(this.javaElementChangeListener);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ JavaCore.removeElementChangedListener(this.javaElementChangeListener);
+ this.javaElementChangeListener = null;
+ }
+
+ private class JavaElementChangeListener
+ implements IElementChangedListener {
+
+ JavaElementChangeListener() {
+ super();
+ }
+
+ public void elementChanged(ElementChangedEvent event) {
+ JavaResourceModelTestCase.this.javaElementChanged(event);
+ }
+
+ @Override
+ public String toString() {
+ return StringTools.buildToStringFor(this);
+ }
+ }
+
+ void javaElementChanged(ElementChangedEvent event) {
+ if (this.javaResourceCompilationUnit == null) {
+ return;
+ }
+ this.syncWithJavaDelta(event.getDelta());
+ }
+
+ /**
+ * NB: this is copied from GenericJpaProject, so it might need to be
+ * kept in synch with that code if it changes... yech...
+ */
+ protected void syncWithJavaDelta(IJavaElementDelta delta) {
+ switch (delta.getElement().getElementType()) {
+ case IJavaElement.JAVA_MODEL :
+ case IJavaElement.JAVA_PROJECT :
+ case IJavaElement.PACKAGE_FRAGMENT_ROOT :
+ case IJavaElement.PACKAGE_FRAGMENT :
+ this.syncWithJavaDeltaChildren(delta);
+ break;
+ case IJavaElement.COMPILATION_UNIT :
+ this.javaCompilationUnitChanged(delta);
+ break;
+ default :
+ break; // ignore the elements inside a compilation unit
+ }
+ }
+
+ protected void syncWithJavaDeltaChildren(IJavaElementDelta delta) {
+ for (IJavaElementDelta child : delta.getAffectedChildren()) {
+ this.syncWithJavaDelta(child); // recurse
+ }
+ }
+
+ protected void javaCompilationUnitChanged(IJavaElementDelta delta) {
+ if (this.deltaIsRelevant(delta)) {
+ this.javaResourceCompilationUnit.synchronizeWithJavaSource();
+ }
+ }
+
+ protected boolean deltaIsRelevant(IJavaElementDelta delta) {
+ if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
+ return false;
+ }
+ return delta.getKind() == IJavaElementDelta.CHANGED;
+ }
+
+ protected ICompilationUnit createAnnotationAndMembers(String packageName, String annotationName, String annotationBody) throws Exception {
+ return this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
+ }
+
+ protected ICompilationUnit createEnumAndMembers(String packageName, String enumName, String enumBody) throws Exception {
+ return this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
+ }
+
+ protected JavaResourcePackage buildJavaResourcePackage(ICompilationUnit cu) {
+ JavaResourcePackageInfoCompilationUnit pkgCu =
+ new SourcePackageInfoCompilationUnit(
+ cu,
+ this.buildAnnotationProvider(),
+ NullAnnotationEditFormatter.instance(),
+ CommandExecutor.Default.instance());
+ this.javaResourceCompilationUnit = pkgCu;
+ return pkgCu.getPackage();
+ }
+
+ protected JavaResourceType buildJavaResourceType(ICompilationUnit cu) {
+ this.javaResourceCompilationUnit = this.buildJavaResourceCompilationUnit(cu);
+ this.javaResourceCompilationUnit.resolveTypes();
+ return this.hackJavaResourceType();
+ }
+
+ protected JavaResourceAttribute getField(JavaResourceType type, int index) {
+ return CollectionTools.get(type.getFields(), index);
+ }
+
+ protected JavaResourceAttribute getMethod(JavaResourceType type, int index) {
+ return CollectionTools.get(type.getMethods(), index);
+ }
+
+ protected JavaResourceType hackJavaResourceType() {
+ return (JavaResourceType) ReflectionTools.getFieldValue(this.javaResourceCompilationUnit, "type");
+ }
+
+ protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit cu) {
+ if (this.javaResourceCompilationUnit != null) {
+ throw new IllegalStateException();
+ }
+ return new SourceTypeCompilationUnit(
+ cu,
+ this.buildAnnotationProvider(),
+ NullAnnotationEditFormatter.instance(),
+ CommandExecutor.Default.instance()
+ );
+ }
+
+ protected AnnotationProvider buildAnnotationProvider() {
+ return new GenericAnnotationProvider(this.annotationDefinitionProvider());
+ }
+
+ protected abstract AnnotationDefinitionProvider annotationDefinitionProvider();
+}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
index 96f23c62ce..5ece726dfa 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/JaxbJavaResourceModelTestCase.java
@@ -9,21 +9,18 @@
******************************************************************************/
package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.tests.internal.resource.java.JavaResourceModelTestCase;
+import org.eclipse.jpt.jaxb.core.AnnotationDefinitionProvider;
import org.eclipse.jpt.jaxb.core.internal.GenericJaxbAnnotationDefinitionProvider;
public class JaxbJavaResourceModelTestCase
extends JavaResourceModelTestCase {
-
+
public JaxbJavaResourceModelTestCase(String name) {
super(name);
}
-
@Override
- protected JpaAnnotationProvider buildAnnotationProvider() {
- return new GenericJpaAnnotationProvider(GenericJaxbAnnotationDefinitionProvider.instance());
+ protected AnnotationDefinitionProvider annotationDefinitionProvider() {
+ return GenericJaxbAnnotationDefinitionProvider.instance();
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java
index f138f12642..5fde462795 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderPackageAnnotationTests.java
@@ -11,12 +11,12 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
-
+@SuppressWarnings("nls")
public class XmlAccessorOrderPackageAnnotationTests
extends JaxbJavaResourceModelTestCase {
@@ -35,10 +35,10 @@ public class XmlAccessorOrderPackageAnnotationTests
throws Exception {
ICompilationUnit cu = createPackageInfoWithAccessorOrder();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
XmlAccessorOrderAnnotation annotation =
- (XmlAccessorOrderAnnotation) packageResource.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
+ (XmlAccessorOrderAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
assertTrue(annotation != null);
assertEquals(XmlAccessOrder.UNDEFINED, annotation.getValue());
@@ -47,7 +47,7 @@ public class XmlAccessorOrderPackageAnnotationTests
assertSourceContains("@XmlAccessorOrder(ALPHABETICAL)", cu);
annotation.setValue(null);
- assertNull(packageResource.getAnnotation(JAXB.XML_ACCESSOR_ORDER));
+ assertNull(resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_ORDER));
assertSourceDoesNotContain("@XmlAccessorOrder", cu);
// TODO uncomment when bug 328400 is addressed
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
index bb921f2615..cb39c66a01 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorOrderTypeAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessOrder;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorOrderAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -53,26 +53,26 @@ public class XmlAccessorOrderTypeAnnotationTests
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorOrder();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
+ XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
assertTrue(xmlAccessorOrderAnnotation != null);
assertNull(xmlAccessorOrderAnnotation.getValue());
}
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorOrderWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
+ XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
assertEquals(XmlAccessOrder.ALPHABETICAL, xmlAccessorOrderAnnotation.getValue());
}
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorOrder();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
+ XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
assertEquals(null, xmlAccessorOrderAnnotation.getValue());
xmlAccessorOrderAnnotation.setValue(XmlAccessOrder.UNDEFINED);
@@ -83,9 +83,9 @@ public class XmlAccessorOrderTypeAnnotationTests
public void testSetValueNull() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorOrderWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
+ XmlAccessorOrderAnnotation xmlAccessorOrderAnnotation = (XmlAccessorOrderAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_ORDER);
assertEquals(XmlAccessOrder.ALPHABETICAL, xmlAccessorOrderAnnotation.getValue());
xmlAccessorOrderAnnotation.setValue(null);
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java
index 48f011f3c3..39f61e6b72 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypePackageAnnotationTests.java
@@ -11,12 +11,12 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
-
+@SuppressWarnings("nls")
public class XmlAccessorTypePackageAnnotationTests
extends JaxbJavaResourceModelTestCase {
@@ -35,10 +35,10 @@ public class XmlAccessorTypePackageAnnotationTests
throws Exception {
ICompilationUnit cu = createPackageInfoWithAccessorOrder();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
XmlAccessorTypeAnnotation annotation =
- (XmlAccessorTypeAnnotation) packageResource.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
+ (XmlAccessorTypeAnnotation) resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
assertTrue(annotation != null);
assertEquals(XmlAccessType.PROPERTY, annotation.getValue());
@@ -55,7 +55,7 @@ public class XmlAccessorTypePackageAnnotationTests
assertSourceContains("@XmlAccessorType(value = PUBLIC_MEMBER)", cu);
annotation.setValue(null);
- assertNull(packageResource.getAnnotation(JAXB.XML_ACCESSOR_TYPE));
+ assertNull(resourcePackage.getAnnotation(JAXB.XML_ACCESSOR_TYPE));
assertSourceDoesNotContain("@XmlAccessorType", cu);
// TODO uncomment when bug 328400 is addressed
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
index d09d819b7b..392c4d39a5 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAccessorTypeTypeAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAccessorTypeAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -53,26 +53,26 @@ public class XmlAccessorTypeTypeAnnotationTests
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
+ XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
assertTrue(xmlAccessorTypeAnnotation != null);
assertNull(xmlAccessorTypeAnnotation.getValue());
}
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorTypeWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
+ XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
assertEquals(XmlAccessType.FIELD, xmlAccessorTypeAnnotation.getValue());
}
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
+ XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
assertEquals(null, xmlAccessorTypeAnnotation.getValue());
xmlAccessorTypeAnnotation.setValue(XmlAccessType.PUBLIC_MEMBER);
@@ -93,9 +93,9 @@ public class XmlAccessorTypeTypeAnnotationTests
public void testSetValueNull() throws Exception {
ICompilationUnit cu = this.createTestXmlAccessorTypeWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) typeResource.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
+ XmlAccessorTypeAnnotation xmlAccessorTypeAnnotation = (XmlAccessorTypeAnnotation) resourceType.getAnnotation(JAXB.XML_ACCESSOR_TYPE);
assertEquals(XmlAccessType.FIELD, xmlAccessorTypeAnnotation.getValue());
xmlAccessorTypeAnnotation.setValue(null);
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java
index 6bd1c4e774..c4d72e2b2f 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyAttributeAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyAttributeAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlAnyAttributeAnnotationTests extends JaxbJavaResourceModelTestCas
public void testGetXmlAnyAttribute() throws Exception {
ICompilationUnit cu = this.createTestXmlAnyAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAnyAttributeAnnotation xmlAnyAttributeAnnotation = (XmlAnyAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ANY_ATTRIBUTE);
+ XmlAnyAttributeAnnotation xmlAnyAttributeAnnotation = (XmlAnyAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ATTRIBUTE);
assertTrue(xmlAnyAttributeAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_ANY_ATTRIBUTE);
+ resourceAttribute.removeAnnotation(JAXB.XML_ANY_ATTRIBUTE);
assertSourceDoesNotContain("@XmlAnyAttribute", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
index 501d274bb5..2cbd003b11 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAnyElementAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAnyElementAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -67,10 +67,10 @@ public class XmlAnyElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ANY_ELEMENT);
+ XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
assertTrue(xmlAnyElementAnnotation != null);
assertNull(xmlAnyElementAnnotation.getLax());
assertNull(xmlAnyElementAnnotation.getValue());
@@ -78,18 +78,18 @@ public class XmlAnyElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetLax() throws Exception {
ICompilationUnit cu = this.createTestXmlAnyElementWithBooleanElement("lax");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ANY_ELEMENT);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
assertEquals(Boolean.TRUE, xmlAnyElementAnnotation.getLax());
}
public void testSetLax() throws Exception {
ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ANY_ELEMENT);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
assertNotNull(xmlAnyElementAnnotation);
assertNull(xmlAnyElementAnnotation.getLax());
@@ -106,10 +106,10 @@ public class XmlAnyElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlAnyElementWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ANY_ELEMENT);
+ XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
assertTrue(xmlAnyElementAnnotation != null);
assertEquals(XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getValue());
assertEquals("java.lang." + XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getFullyQualifiedValueClassName());
@@ -117,10 +117,10 @@ public class XmlAnyElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlAnyElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ANY_ELEMENT);
+ XmlAnyElementAnnotation xmlAnyElementAnnotation = (XmlAnyElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ANY_ELEMENT);
assertNull(xmlAnyElementAnnotation.getValue());
xmlAnyElementAnnotation.setValue(XML_ANY_ELEMENT_VALUE);
assertEquals(XML_ANY_ELEMENT_VALUE, xmlAnyElementAnnotation.getValue());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java
index 9dc7870059..51a4533042 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttachmentRefAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttachmentRefAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlAttachmentRefAnnotationTests extends JaxbJavaResourceModelTestCa
public void testGetXmlAttachmentRef() throws Exception {
ICompilationUnit cu = this.createTestXmlAttachmentRef();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTACHMENT_REF);
+ XmlAttachmentRefAnnotation xmlAttachmentRefAnnotation = (XmlAttachmentRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTACHMENT_REF);
assertTrue(xmlAttachmentRefAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_ATTACHMENT_REF);
+ resourceAttribute.removeAnnotation(JAXB.XML_ATTACHMENT_REF);
assertSourceDoesNotContain("@XmlAttachmentRef", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java
index e4a2ea3227..642ee5750d 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlAttributeAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlAttributeAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -76,20 +76,20 @@ public class XmlAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlAttributeWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertTrue(xmlAttributeAnnotation != null);
assertEquals(XML_ATTRIBUTE_NAME, xmlAttributeAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertTrue(xmlAttributeAnnotation != null);
assertNull(xmlAttributeAnnotation.getName());
assertNull(xmlAttributeAnnotation.getNamespace());
@@ -98,10 +98,10 @@ public class XmlAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertNull(xmlAttributeAnnotation.getName());
xmlAttributeAnnotation.setName(XML_ATTRIBUTE_NAME);
assertEquals(XML_ATTRIBUTE_NAME, xmlAttributeAnnotation.getName());
@@ -117,20 +117,20 @@ public class XmlAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlAttributeWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertTrue(xmlAttributeAnnotation != null);
assertEquals(XML_ATTRIBUTE_NAMESPACE, xmlAttributeAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertNull(xmlAttributeAnnotation.getNamespace());
xmlAttributeAnnotation.setNamespace(XML_ATTRIBUTE_NAMESPACE);
assertEquals(XML_ATTRIBUTE_NAMESPACE, xmlAttributeAnnotation.getNamespace());
@@ -146,18 +146,18 @@ public class XmlAttributeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetRequired() throws Exception {
ICompilationUnit cu = this.createTestXmlAttributeWithBooleanElement("required");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertEquals(Boolean.TRUE, xmlAttributeAnnotation.getRequired());
}
public void testSetRequired() throws Exception {
ICompilationUnit cu = this.createTestXmlAttribute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) attributeResource.getAnnotation(JAXB.XML_ATTRIBUTE);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlAttributeAnnotation xmlAttributeAnnotation = (XmlAttributeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ATTRIBUTE);
assertNotNull(xmlAttributeAnnotation);
assertNull(xmlAttributeAnnotation.getRequired());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
index fee920f40b..373e2701d2 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -95,20 +95,20 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertTrue(xmlElementAnnotation != null);
assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertTrue(xmlElementAnnotation != null);
assertNull(xmlElementAnnotation.getName());
assertNull(xmlElementAnnotation.getNamespace());
@@ -120,10 +120,10 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertNull(xmlElementAnnotation.getName());
xmlElementAnnotation.setName(XML_ELEMENT_NAME);
assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
@@ -139,20 +139,20 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertTrue(xmlElementAnnotation != null);
assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertNull(xmlElementAnnotation.getNamespace());
xmlElementAnnotation.setNamespace(XML_ELEMENT_NAMESPACE);
assertEquals(XML_ELEMENT_NAMESPACE, xmlElementAnnotation.getNamespace());
@@ -168,20 +168,20 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetDefaultValue() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithDefaultValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertTrue(xmlElementAnnotation != null);
assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
}
public void testSetDefaultValue() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertNull(xmlElementAnnotation.getDefaultValue());
xmlElementAnnotation.setDefaultValue(XML_ELEMENT_DEFAULT_VALUE);
assertEquals(XML_ELEMENT_DEFAULT_VALUE, xmlElementAnnotation.getDefaultValue());
@@ -197,18 +197,18 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetNillable() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("nillable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertEquals(Boolean.TRUE, xmlElementAnnotation.getNillable());
}
public void testSetNillable() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertNotNull(xmlElementAnnotation);
assertNull(xmlElementAnnotation.getNillable());
@@ -225,18 +225,18 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetRequired() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithBooleanElement("required");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertEquals(Boolean.TRUE, xmlElementAnnotation.getRequired());
}
public void testSetRequired() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertNotNull(xmlElementAnnotation);
assertNull(xmlElementAnnotation.getRequired());
@@ -253,10 +253,10 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetType() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertTrue(xmlElementAnnotation != null);
assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
assertEquals("java.lang." + XML_ELEMENT_TYPE, xmlElementAnnotation.getFullyQualifiedTypeName());
@@ -264,10 +264,10 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testSetType() throws Exception {
ICompilationUnit cu = this.createTestXmlElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertNull(xmlElementAnnotation.getType());
xmlElementAnnotation.setType(XML_ELEMENT_TYPE);
assertEquals(XML_ELEMENT_TYPE, xmlElementAnnotation.getType());
@@ -283,14 +283,14 @@ public class XmlElementAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testAddXmlElementAnnotation() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT);
+ XmlElementAnnotation xmlElementAnnotation = (XmlElementAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT);
assertTrue(xmlElementAnnotation != null);
assertEquals(XML_ELEMENT_NAME, xmlElementAnnotation.getName());
- XmlElementAnnotation xmlElementAnnotation2 = (XmlElementAnnotation) attributeResource.addAnnotation(1, JAXB.XML_ELEMENT, JAXB.XML_ELEMENTS);
+ XmlElementAnnotation xmlElementAnnotation2 = (XmlElementAnnotation) resourceAttribute.addAnnotation(1, JAXB.XML_ELEMENT, JAXB.XML_ELEMENTS);
xmlElementAnnotation2.setName("Foo");
assertSourceContains("@XmlElements({@XmlElement(name = \"" + XML_ELEMENT_NAME + "\"),@XmlElement(name = \"Foo\")})", cu);
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
index da3f2d0e76..fecc1e428d 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementDeclAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementDeclAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -90,20 +90,20 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDeclWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertNull(xmlElementDeclAnnotation.getName());
assertNull(xmlElementDeclAnnotation.getNamespace());
@@ -115,10 +115,10 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertNull(xmlElementDeclAnnotation.getName());
xmlElementDeclAnnotation.setName(XML_ELEMENT_DECL_NAME);
assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getName());
@@ -134,20 +134,20 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDeclWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertEquals(XML_ELEMENT_DECL_NAMESPACE, xmlElementDeclAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertNull(xmlElementDeclAnnotation.getNamespace());
xmlElementDeclAnnotation.setNamespace(XML_ELEMENT_DECL_NAMESPACE);
assertEquals(XML_ELEMENT_DECL_NAMESPACE, xmlElementDeclAnnotation.getNamespace());
@@ -163,20 +163,20 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetDefaultValue() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDeclWithDefaultValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertEquals(XML_ELEMENT_DECL_DEFAULT_VALUE, xmlElementDeclAnnotation.getDefaultValue());
}
public void testSetDefaultValue() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertNull(xmlElementDeclAnnotation.getDefaultValue());
xmlElementDeclAnnotation.setDefaultValue(XML_ELEMENT_DECL_DEFAULT_VALUE);
assertEquals(XML_ELEMENT_DECL_DEFAULT_VALUE, xmlElementDeclAnnotation.getDefaultValue());
@@ -192,10 +192,10 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetScope() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDeclWithScope();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertEquals(XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getScope());
assertEquals("javax.xml.bind.annotation." + XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getFullyQualifiedScopeClassName());
@@ -203,10 +203,10 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testSetScope() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertNull(xmlElementDeclAnnotation.getScope());
xmlElementDeclAnnotation.setScope(XML_ELEMENT_DECL_SCOPE);
assertEquals(XML_ELEMENT_DECL_SCOPE, xmlElementDeclAnnotation.getScope());
@@ -222,20 +222,20 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetSubstitutionHeadName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDeclWithSubstitutionHeadName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadName());
}
public void testSetSubstitutionHeadName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertNull(xmlElementDeclAnnotation.getSubstitutionHeadName());
xmlElementDeclAnnotation.setSubstitutionHeadName(XML_ELEMENT_DECL_NAME);
assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadName());
@@ -251,20 +251,20 @@ public class XmlElementDeclAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetSubstitutionHeadNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDeclWithSubstitutionHeadNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertTrue(xmlElementDeclAnnotation != null);
assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
}
public void testSetSubstitutionHeadNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementDecl();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.methods().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getMethod(resourceType, 0);
- XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_DECL);
+ XmlElementDeclAnnotation xmlElementDeclAnnotation = (XmlElementDeclAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_DECL);
assertNull(xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
xmlElementDeclAnnotation.setSubstitutionHeadNamespace(XML_ELEMENT_DECL_NAME);
assertEquals(XML_ELEMENT_DECL_NAME, xmlElementDeclAnnotation.getSubstitutionHeadNamespace());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
index 7c563f7dc8..463ff70c05 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementRefAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementRefAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -77,20 +77,20 @@ public class XmlElementRefAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRefWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertTrue(xmlElementRefAnnotation != null);
assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertTrue(xmlElementRefAnnotation != null);
assertNull(xmlElementRefAnnotation.getName());
assertNull(xmlElementRefAnnotation.getNamespace());
@@ -99,10 +99,10 @@ public class XmlElementRefAnnotationTests extends JaxbJavaResourceModelTestCase
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertNull(xmlElementRefAnnotation.getName());
xmlElementRefAnnotation.setName(XML_ELEMENT_REF_NAME);
assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
@@ -118,20 +118,20 @@ public class XmlElementRefAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRefWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertTrue(xmlElementRefAnnotation != null);
assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertNull(xmlElementRefAnnotation.getNamespace());
xmlElementRefAnnotation.setNamespace(XML_ELEMENT_REF_NAMESPACE);
assertEquals(XML_ELEMENT_REF_NAMESPACE, xmlElementRefAnnotation.getNamespace());
@@ -147,10 +147,10 @@ public class XmlElementRefAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetType() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRefWithType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertTrue(xmlElementRefAnnotation != null);
assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
assertEquals("java.lang." + XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getFullyQualifiedTypeName());
@@ -158,10 +158,10 @@ public class XmlElementRefAnnotationTests extends JaxbJavaResourceModelTestCase
public void testSetType() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRef();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertNull(xmlElementRefAnnotation.getType());
xmlElementRefAnnotation.setType(XML_ELEMENT_REF_TYPE);
assertEquals(XML_ELEMENT_REF_TYPE, xmlElementRefAnnotation.getType());
@@ -177,14 +177,14 @@ public class XmlElementRefAnnotationTests extends JaxbJavaResourceModelTestCase
public void testAddXmlElementRefAnnotation() throws Exception {
ICompilationUnit cu = this.createTestXmlElementRefWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_REF);
+ XmlElementRefAnnotation xmlElementRefAnnotation = (XmlElementRefAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_REF);
assertTrue(xmlElementRefAnnotation != null);
assertEquals(XML_ELEMENT_REF_NAME, xmlElementRefAnnotation.getName());
- XmlElementRefAnnotation xmlElementRefAnnotation2 = (XmlElementRefAnnotation) attributeResource.addAnnotation(1, JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
+ XmlElementRefAnnotation xmlElementRefAnnotation2 = (XmlElementRefAnnotation) resourceAttribute.addAnnotation(1, JAXB.XML_ELEMENT_REF, JAXB.XML_ELEMENT_REFS);
xmlElementRefAnnotation2.setName("Foo");
assertSourceContains("@XmlElementRefs({@XmlElementRef(name = \"" + XML_ELEMENT_REF_NAME + "\"),@XmlElementRef(name = \"Foo\")})", cu);
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
index 9ac02daebf..c7ecab5e9b 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlElementWrapperAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlElementWrapperAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -76,20 +76,20 @@ public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestC
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapperWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertTrue(xmlElementWrapperAnnotation != null);
assertEquals(XML_ELEMENT_WRAPPER_NAME, xmlElementWrapperAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertTrue(xmlElementWrapperAnnotation != null);
assertNull(xmlElementWrapperAnnotation.getName());
assertNull(xmlElementWrapperAnnotation.getNamespace());
@@ -99,10 +99,10 @@ public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestC
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertNull(xmlElementWrapperAnnotation.getName());
xmlElementWrapperAnnotation.setName(XML_ELEMENT_WRAPPER_NAME);
assertEquals(XML_ELEMENT_WRAPPER_NAME, xmlElementWrapperAnnotation.getName());
@@ -118,20 +118,20 @@ public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestC
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapperWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertTrue(xmlElementWrapperAnnotation != null);
assertEquals(XML_ELEMENT_WRAPPER_NAMESPACE, xmlElementWrapperAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertNull(xmlElementWrapperAnnotation.getNamespace());
xmlElementWrapperAnnotation.setNamespace(XML_ELEMENT_WRAPPER_NAMESPACE);
assertEquals(XML_ELEMENT_WRAPPER_NAMESPACE, xmlElementWrapperAnnotation.getNamespace());
@@ -147,18 +147,18 @@ public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestC
public void testGetNillable() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapperWithBooleanElement("nillable");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertEquals(Boolean.TRUE, xmlElementWrapperAnnotation.getNillable());
}
public void testSetNillable() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertNotNull(xmlElementWrapperAnnotation);
assertNull(xmlElementWrapperAnnotation.getNillable());
@@ -175,18 +175,18 @@ public class XmlElementWrapperAnnotationTests extends JaxbJavaResourceModelTestC
public void testGetRequired() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapperWithBooleanElement("required");
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertEquals(Boolean.TRUE, xmlElementWrapperAnnotation.getRequired());
}
public void testSetRequired() throws Exception {
ICompilationUnit cu = this.createTestXmlElementWrapper();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
- XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) attributeResource.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
+ XmlElementWrapperAnnotation xmlElementWrapperAnnotation = (XmlElementWrapperAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ELEMENT_WRAPPER);
assertNotNull(xmlElementWrapperAnnotation);
assertNull(xmlElementWrapperAnnotation.getRequired());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
index 56b02601d4..ab4376356c 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -53,18 +53,18 @@ public class XmlEnumAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlEnum();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) typeResource.getAnnotation(JAXB.XML_ENUM);
+ XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceType.getAnnotation(JAXB.XML_ENUM);
assertTrue(xmlEnumAnnotation != null);
assertNull(xmlEnumAnnotation.getValue());
}
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlEnumWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) typeResource.getAnnotation(JAXB.XML_ENUM);
+ XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceType.getAnnotation(JAXB.XML_ENUM);
assertTrue(xmlEnumAnnotation != null);
assertEquals(XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getValue());
assertEquals("java.lang." + XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getFullyQualifiedValueClassName());
@@ -72,9 +72,9 @@ public class XmlEnumAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlEnum();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) typeResource.getAnnotation(JAXB.XML_ENUM);
+ XmlEnumAnnotation xmlEnumAnnotation = (XmlEnumAnnotation) resourceType.getAnnotation(JAXB.XML_ENUM);
assertNull(xmlEnumAnnotation.getValue());
xmlEnumAnnotation.setValue(XML_ENUM_JAVA_TYPE);
assertEquals(XML_ENUM_JAVA_TYPE, xmlEnumAnnotation.getValue());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java
index a0221a5c51..f82a4bd648 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlEnumValueAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlEnumValueAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -58,43 +58,43 @@ public class XmlEnumValueAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlEnumValue() throws Exception {
ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) attributeResource.getAnnotation(JAXB.XML_ENUM_VALUE);
+ XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ENUM_VALUE);
assertTrue(xmlEnumValueAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_ENUM_VALUE);
+ resourceAttribute.removeAnnotation(JAXB.XML_ENUM_VALUE);
assertSourceDoesNotContain("@XmlEnumValue", cu);
}
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlEnumValueWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) attributeResource.getAnnotation(JAXB.XML_ENUM_VALUE);
+ XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ENUM_VALUE);
assertTrue(xmlEnumValueAnnotation != null);
assertEquals(XML_ENUM_VALUE_VALUE, xmlEnumValueAnnotation.getValue());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) attributeResource.getAnnotation(JAXB.XML_ENUM_VALUE);
+ XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ENUM_VALUE);
assertTrue(xmlEnumValueAnnotation != null);
assertNull(xmlEnumValueAnnotation.getValue());
}
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlEnumValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) attributeResource.getAnnotation(JAXB.XML_ENUM_VALUE);
+ XmlEnumValueAnnotation xmlEnumValueAnnotation = (XmlEnumValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ENUM_VALUE);
assertNull(xmlEnumValueAnnotation.getValue());
xmlEnumValueAnnotation.setValue(XML_ENUM_VALUE_VALUE);
assertEquals(XML_ENUM_VALUE_VALUE, xmlEnumValueAnnotation.getValue());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java
index c9186f40c8..727b5c0417 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlIDAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlID() throws Exception {
ICompilationUnit cu = this.createTestXmlID();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) attributeResource.getAnnotation(JAXB.XML_ID);
+ XmlIDAnnotation xmlIDAnnotation = (XmlIDAnnotation) resourceAttribute.getAnnotation(JAXB.XML_ID);
assertTrue(xmlIDAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_ID);
+ resourceAttribute.removeAnnotation(JAXB.XML_ID);
assertSourceDoesNotContain("@XmlID", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java
index 8b1961fd46..a4b0576a6e 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlIDREFAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlIDREFAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlIDREFAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlIDREF() throws Exception {
ICompilationUnit cu = this.createTestXmlIDREF();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) attributeResource.getAnnotation(JAXB.XML_IDREF);
+ XmlIDREFAnnotation xmlIDREFAnnotation = (XmlIDREFAnnotation) resourceAttribute.getAnnotation(JAXB.XML_IDREF);
assertTrue(xmlIDREFAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_IDREF);
+ resourceAttribute.removeAnnotation(JAXB.XML_IDREF);
assertSourceDoesNotContain("@XmlIDREF", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAnnotationTests.java
index 3fbc49522e..27d7245bae 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlInlineBinaryDataAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlInlineBinaryDataAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -38,12 +38,12 @@ public class XmlInlineBinaryDataAnnotationTests extends JaxbJavaResourceModelTes
public void testGetXmlInlineBinaryData() throws Exception {
ICompilationUnit cu = this.createTestXmlInlineBinaryData();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlInlineBinaryDataAnnotation xmlInlineBinaryDataAnnotation = (XmlInlineBinaryDataAnnotation) typeResource.getAnnotation(JAXB.XML_INLINE_BINARY_DATA);
+ XmlInlineBinaryDataAnnotation xmlInlineBinaryDataAnnotation = (XmlInlineBinaryDataAnnotation) resourceType.getAnnotation(JAXB.XML_INLINE_BINARY_DATA);
assertTrue(xmlInlineBinaryDataAnnotation != null);
- typeResource.removeAnnotation(JAXB.XML_INLINE_BINARY_DATA);
+ resourceType.removeAnnotation(JAXB.XML_INLINE_BINARY_DATA);
assertSourceDoesNotContain("@XmlInlineBinaryData", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
index 5060201996..883f584b43 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterPackageAnnotationTests.java
@@ -11,13 +11,13 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdaptersAnnotation;
-
+@SuppressWarnings("nls")
public class XmlJavaTypeAdapterPackageAnnotationTests
extends JaxbJavaResourceModelTestCase {
@@ -84,11 +84,11 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
throws Exception {
ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndValue();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
createTestClass2();
XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertTrue(annotation != null);
assertEquals(TEST_CLASS, annotation.getValue());
assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedValue());
@@ -114,11 +114,11 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
throws Exception {
ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndType();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
createTestClass2();
XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertTrue(annotation != null);
assertEquals(TEST_CLASS, annotation.getType());
assertEquals(FQ_TEST_CLASS, annotation.getFullyQualifiedType());
@@ -144,11 +144,11 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
throws Exception {
ICompilationUnit cu = createPackageInfoWithJavaTypeAdapterAndValue();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
createTestClass2();
XmlJavaTypeAdapterAnnotation annotation =
- (XmlJavaTypeAdapterAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ (XmlJavaTypeAdapterAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertTrue(annotation != null);
assertEquals(TEST_CLASS, annotation.getValue());
assertSourceContains("@XmlJavaTypeAdapter(" + TEST_CLASS + ".class)", cu);
@@ -179,11 +179,11 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
// test contained annotation value setting/updating
ICompilationUnit cu = createPackageInfoWithJavaTypeAdapters();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
createTestClass();
XmlJavaTypeAdaptersAnnotation adaptersAnnotation =
- (XmlJavaTypeAdaptersAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
+ (XmlJavaTypeAdaptersAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
XmlJavaTypeAdapterAnnotation adapterAnnotation = adaptersAnnotation.getNestedAnnotation(0);
adapterAnnotation.setValue(TEST_CLASS);
@@ -204,11 +204,11 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
// test contained annotation type setting/updating
ICompilationUnit cu = createPackageInfoWithJavaTypeAdapters();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
createTestClass();
XmlJavaTypeAdaptersAnnotation adaptersAnnotation =
- (XmlJavaTypeAdaptersAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
+ (XmlJavaTypeAdaptersAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
XmlJavaTypeAdapterAnnotation adapterAnnotation = adaptersAnnotation.getNestedAnnotation(1);
adapterAnnotation.setType(TEST_CLASS);
@@ -229,17 +229,17 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
// test adding/removing/moving
ICompilationUnit cu = createPackageInfoWithJavaTypeAdapter();
- JavaResourcePackage packageResource = buildJavaResourcePackage(cu);
+ JavaResourcePackage resourcePackage = buildJavaResourcePackage(cu);
createTestClass();
createTestClass2();
XmlJavaTypeAdaptersAnnotation adaptersAnnotation =
- (XmlJavaTypeAdaptersAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
+ (XmlJavaTypeAdaptersAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
assertNull(adaptersAnnotation);
- packageResource.addAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER, JAXB.XML_JAVA_TYPE_ADAPTERS);
+ resourcePackage.addAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER, JAXB.XML_JAVA_TYPE_ADAPTERS);
adaptersAnnotation =
- (XmlJavaTypeAdaptersAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
+ (XmlJavaTypeAdaptersAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
assertEquals(2, adaptersAnnotation.getNestedAnnotationsSize());
assertSourceContains("@XmlJavaTypeAdapters({@XmlJavaTypeAdapter,@XmlJavaTypeAdapter})", cu);
@@ -252,16 +252,16 @@ public class XmlJavaTypeAdapterPackageAnnotationTests
+ ".class),@XmlJavaTypeAdapter(" + TEST_CLASS_2
+ ".class)})", cu);
- packageResource.moveAnnotation(0, 1, JAXB.XML_JAVA_TYPE_ADAPTERS);
+ resourcePackage.moveAnnotation(0, 1, JAXB.XML_JAVA_TYPE_ADAPTERS);
assertSourceContains(
"@XmlJavaTypeAdapters({@XmlJavaTypeAdapter(" + TEST_CLASS_2
+ ".class),@XmlJavaTypeAdapter(" + TEST_CLASS
+ ".class)})", cu);
// TODO uncomment when bug 328400 is addressed
-// packageResource.removeAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER, JAXB.XML_JAVA_TYPE_ADAPTERS);
+// resourcePackage.removeAnnotation(1, JAXB.XML_JAVA_TYPE_ADAPTER, JAXB.XML_JAVA_TYPE_ADAPTERS);
// adaptersAnnotation =
-// (XmlJavaTypeAdaptersAnnotation) packageResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
+// (XmlJavaTypeAdaptersAnnotation) resourcePackage.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTERS);
// assertNull(adaptersAnnotation);
// assertSourceContains(
// "@XmlJavaTypeAdapter(" + TEST_CLASS_2 + ")", cu);
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java
index 53ab19c722..b7babc158b 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlJavaTypeAdapterTypeAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlJavaTypeAdapterAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -66,18 +66,18 @@ public class XmlJavaTypeAdapterTypeAnnotationTests extends JaxbJavaResourceModel
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlJavaTypeAdapter();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) typeResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertTrue(xmlJavaTypeAdapterAnnotation != null);
assertNull(xmlJavaTypeAdapterAnnotation.getValue());
}
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlJavaTypeAdapterWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) typeResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertTrue(xmlJavaTypeAdapterAnnotation != null);
assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
assertEquals("test." + XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getFullyQualifiedValue());
@@ -85,9 +85,9 @@ public class XmlJavaTypeAdapterTypeAnnotationTests extends JaxbJavaResourceModel
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlJavaTypeAdapter();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) typeResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertNull(xmlJavaTypeAdapterAnnotation.getValue());
xmlJavaTypeAdapterAnnotation.setValue(XML_JAVA_TYPE_ADAPTER_CLASS);
assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
@@ -97,9 +97,9 @@ public class XmlJavaTypeAdapterTypeAnnotationTests extends JaxbJavaResourceModel
public void testSetValueNull() throws Exception {
ICompilationUnit cu = this.createTestXmlJavaTypeAdapterWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) typeResource.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
+ XmlJavaTypeAdapterAnnotation xmlJavaTypeAdapterAnnotation = (XmlJavaTypeAdapterAnnotation) resourceType.getAnnotation(JAXB.XML_JAVA_TYPE_ADAPTER);
assertEquals(XML_JAVA_TYPE_ADAPTER_CLASS, xmlJavaTypeAdapterAnnotation.getValue());
xmlJavaTypeAdapterAnnotation.setValue(null);
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java
index f25b5f3e02..add1da747c 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlListAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlListAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlListAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlList() throws Exception {
ICompilationUnit cu = this.createTestXmlList();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) attributeResource.getAnnotation(JAXB.XML_LIST);
+ XmlListAnnotation xmlListAnnotation = (XmlListAnnotation) resourceAttribute.getAnnotation(JAXB.XML_LIST);
assertTrue(xmlListAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_LIST);
+ resourceAttribute.removeAnnotation(JAXB.XML_LIST);
assertSourceDoesNotContain("@XmlList", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java
index 2c9b336293..f50c4feb9a 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMimeTypeAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMimeTypeAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -58,42 +58,42 @@ public class XmlMimeTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlMimeType() throws Exception {
ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) attributeResource.getAnnotation(JAXB.XML_MIME_TYPE);
+ XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
assertTrue(xmlMimeTypeAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_MIME_TYPE);
+ resourceAttribute.removeAnnotation(JAXB.XML_MIME_TYPE);
assertSourceDoesNotContain("@XmlMimeType", cu);
}
public void testGetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlMimeTypeWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) attributeResource.getAnnotation(JAXB.XML_MIME_TYPE);
+ XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
assertTrue(xmlMimeTypeAnnotation != null);
assertEquals(XML_MIME_TYPE_VALUE, xmlMimeTypeAnnotation.getValue());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) attributeResource.getAnnotation(JAXB.XML_MIME_TYPE);
+ XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
assertTrue(xmlMimeTypeAnnotation != null);
assertNull(xmlMimeTypeAnnotation.getValue());
}
public void testSetValue() throws Exception {
ICompilationUnit cu = this.createTestXmlMimeType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) attributeResource.getAnnotation(JAXB.XML_MIME_TYPE);
+ XmlMimeTypeAnnotation xmlMimeTypeAnnotation = (XmlMimeTypeAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIME_TYPE);
assertNull(xmlMimeTypeAnnotation.getValue());
xmlMimeTypeAnnotation.setValue(XML_MIME_TYPE_VALUE);
assertEquals(XML_MIME_TYPE_VALUE, xmlMimeTypeAnnotation.getValue());
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java
index c476c0ec50..e6b8d4c848 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlMixedAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlMixedAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlMixedAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlMixed() throws Exception {
ICompilationUnit cu = this.createTestXmlMixed();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlMixedAnnotation xmlMixedAnnotation = (XmlMixedAnnotation) attributeResource.getAnnotation(JAXB.XML_MIXED);
+ XmlMixedAnnotation xmlMixedAnnotation = (XmlMixedAnnotation) resourceAttribute.getAnnotation(JAXB.XML_MIXED);
assertTrue(xmlMixedAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_MIXED);
+ resourceAttribute.removeAnnotation(JAXB.XML_MIXED);
assertSourceDoesNotContain("@XmlMixed", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
index c11f4ef9ce..4868727977 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRegistryAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRegistryAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -38,12 +38,12 @@ public class XmlRegistryAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlRegistry() throws Exception {
ICompilationUnit cu = this.createTestXmlRegistry();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlRegistryAnnotation xmlRegistryAnnotation = (XmlRegistryAnnotation) typeResource.getAnnotation(JAXB.XML_REGISTRY);
+ XmlRegistryAnnotation xmlRegistryAnnotation = (XmlRegistryAnnotation) resourceType.getAnnotation(JAXB.XML_REGISTRY);
assertTrue(xmlRegistryAnnotation != null);
- typeResource.removeAnnotation(JAXB.XML_REGISTRY);
+ resourceType.removeAnnotation(JAXB.XML_REGISTRY);
assertSourceDoesNotContain("@XmlRegistry", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java
index e7a49cfd01..9295ba8dbf 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlRootElementAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlRootElementAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -67,18 +67,18 @@ public class XmlRootElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlRootElementWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) typeResource.getAnnotation(JAXB.XML_ROOT_ELEMENT);
+ XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
assertTrue(xmlRootElementAnnotation != null);
assertEquals(XML_ROOT_ELEMENT_NAME, xmlRootElementAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) typeResource.getAnnotation(JAXB.XML_ROOT_ELEMENT);
+ XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
assertTrue(xmlRootElementAnnotation != null);
assertNull(xmlRootElementAnnotation.getName());
assertNull(xmlRootElementAnnotation.getNamespace());
@@ -86,9 +86,9 @@ public class XmlRootElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) typeResource.getAnnotation(JAXB.XML_ROOT_ELEMENT);
+ XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
assertNull(xmlRootElementAnnotation.getName());
xmlRootElementAnnotation.setName(XML_ROOT_ELEMENT_NAME);
assertEquals(XML_ROOT_ELEMENT_NAME, xmlRootElementAnnotation.getName());
@@ -104,18 +104,18 @@ public class XmlRootElementAnnotationTests extends JaxbJavaResourceModelTestCase
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlRootElementWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) typeResource.getAnnotation(JAXB.XML_ROOT_ELEMENT);
+ XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
assertTrue(xmlRootElementAnnotation != null);
assertEquals(XML_ROOT_ELEMENT_NAMESPACE, xmlRootElementAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlRootElement();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) typeResource.getAnnotation(JAXB.XML_ROOT_ELEMENT);
+ XmlRootElementAnnotation xmlRootElementAnnotation = (XmlRootElementAnnotation) resourceType.getAnnotation(JAXB.XML_ROOT_ELEMENT);
assertNull(xmlRootElementAnnotation.getNamespace());
xmlRootElementAnnotation.setNamespace(XML_ROOT_ELEMENT_NAMESPACE);
assertEquals(XML_ROOT_ELEMENT_NAMESPACE, xmlRootElementAnnotation.getNamespace());
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 bd5ad41d5a..c3ca286281 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
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
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;
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAnnotationTests.java
index f7751a3522..03099f4306 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSchemaTypeAnnotationTests.java
@@ -13,12 +13,12 @@ import java.util.Date;
import java.util.GregorianCalendar;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourcePackage;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypeAnnotation;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSchemaTypesAnnotation;
-
+@SuppressWarnings("nls")
public class XmlSchemaTypeAnnotationTests
extends JaxbJavaResourceModelTestCase {
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
index 145aa283d9..a312562667 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlSeeAlsoAnnotationTests.java
@@ -12,8 +12,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import java.util.ListIterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlSeeAlsoAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -54,18 +54,18 @@ public class XmlSeeAlsoAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
assertEquals(0, xmlSeeAlsoAnnotation.getClassesSize());
}
public void testGetClasses() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
ListIterator<String> classes = xmlSeeAlsoAnnotation.getClasses().iterator();
assertEquals("Foo", classes.next());
@@ -74,18 +74,18 @@ public class XmlSeeAlsoAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetClassesSize() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
assertEquals(2, xmlSeeAlsoAnnotation.getClassesSize());
}
public void testAddClass() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
xmlSeeAlsoAnnotation.addClass("Fooo");
@@ -96,9 +96,9 @@ public class XmlSeeAlsoAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testAddClassIndex() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
xmlSeeAlsoAnnotation.addClass(0, "Fooo");
@@ -110,9 +110,9 @@ public class XmlSeeAlsoAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testRemoveClass() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
xmlSeeAlsoAnnotation.removeClass("Foo");
@@ -125,9 +125,9 @@ public class XmlSeeAlsoAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testRemoveClassIndex() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlsoWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
xmlSeeAlsoAnnotation.removeClass(0);
@@ -140,9 +140,9 @@ public class XmlSeeAlsoAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testMoveClass() throws Exception {
ICompilationUnit cu = this.createTestXmlSeeAlso();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) typeResource.getAnnotation(JAXB.XML_SEE_ALSO);
+ XmlSeeAlsoAnnotation xmlSeeAlsoAnnotation = (XmlSeeAlsoAnnotation) resourceType.getAnnotation(JAXB.XML_SEE_ALSO);
assertTrue(xmlSeeAlsoAnnotation != null);
xmlSeeAlsoAnnotation.addClass("Fooo");
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAnnotationTests.java
index 82b7c32991..59551d8f1c 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTransientAnnotationTests.java
@@ -11,8 +11,8 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTransientAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -38,12 +38,12 @@ public class XmlTransientAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlTransient() throws Exception {
ICompilationUnit cu = this.createTestXmlTransient();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTransientAnnotation xmlTransientAnnotation = (XmlTransientAnnotation) typeResource.getAnnotation(JAXB.XML_TRANSIENT);
+ XmlTransientAnnotation xmlTransientAnnotation = (XmlTransientAnnotation) resourceType.getAnnotation(JAXB.XML_TRANSIENT);
assertTrue(xmlTransientAnnotation != null);
- typeResource.removeAnnotation(JAXB.XML_TRANSIENT);
+ resourceType.removeAnnotation(JAXB.XML_TRANSIENT);
assertSourceDoesNotContain("@XmlTransient", cu);
}
}
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
index 309b71650c..3c06252b96 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlTypeAnnotationTests.java
@@ -12,9 +12,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import java.util.ListIterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlTypeAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -122,18 +122,18 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetName() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
assertEquals(XML_TYPE_NAME, xmlTypeAnnotation.getName());
}
public void testGetNull() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
assertNull(xmlTypeAnnotation.getName());
assertNull(xmlTypeAnnotation.getNamespace());
@@ -144,9 +144,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testSetName() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertNull(xmlTypeAnnotation.getName());
xmlTypeAnnotation.setName(XML_TYPE_NAME);
assertEquals(XML_TYPE_NAME, xmlTypeAnnotation.getName());
@@ -162,18 +162,18 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithNamespace();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
assertEquals(XML_TYPE_NAMESPACE, xmlTypeAnnotation.getNamespace());
}
public void testSetNamespace() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertNull(xmlTypeAnnotation.getNamespace());
xmlTypeAnnotation.setNamespace(XML_TYPE_NAMESPACE);
assertEquals(XML_TYPE_NAMESPACE, xmlTypeAnnotation.getNamespace());
@@ -189,18 +189,18 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetFactoryMethod() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithFactoryMethod();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
assertEquals(XML_TYPE_FACTORY_METHOD, xmlTypeAnnotation.getFactoryMethod());
}
public void testSetFactoryMethod() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertNull(xmlTypeAnnotation.getFactoryMethod());
xmlTypeAnnotation.setFactoryMethod(XML_TYPE_FACTORY_METHOD);
assertEquals(XML_TYPE_FACTORY_METHOD, xmlTypeAnnotation.getFactoryMethod());
@@ -216,9 +216,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetFactoryClass() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithFactoryClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
assertEquals(XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFactoryClass());
assertEquals("test." + XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFullyQualifiedFactoryClassName());
@@ -226,9 +226,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testSetFactoryClass() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertNull(xmlTypeAnnotation.getFactoryClass());
xmlTypeAnnotation.setFactoryClass(XML_TYPE_FACTORY_CLASS);
assertEquals(XML_TYPE_FACTORY_CLASS, xmlTypeAnnotation.getFactoryClass());
@@ -244,9 +244,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetPropOrder() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
ListIterator<String> propOrder = xmlTypeAnnotation.getPropOrder().iterator();
assertEquals("foo", propOrder.next());
@@ -255,18 +255,18 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetPropOrderSize() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
assertEquals(2, xmlTypeAnnotation.getPropOrderSize());
}
public void testAddProp() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
xmlTypeAnnotation.addProp("fooo");
@@ -277,9 +277,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testAddPropIndex() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
xmlTypeAnnotation.addProp(0, "fooo");
@@ -291,9 +291,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testRemoveProp() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
xmlTypeAnnotation.removeProp("foo");
@@ -306,9 +306,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testRemovePropIndex() throws Exception {
ICompilationUnit cu = this.createTestXmlTypeWithPropOrder();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
xmlTypeAnnotation.removeProp(0);
@@ -321,9 +321,9 @@ public class XmlTypeAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testMoveProp() throws Exception {
ICompilationUnit cu = this.createTestXmlType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
+ JavaResourceType resourceType = buildJavaResourceType(cu);
- XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) typeResource.getAnnotation(JAXB.XML_TYPE);
+ XmlTypeAnnotation xmlTypeAnnotation = (XmlTypeAnnotation) resourceType.getAnnotation(JAXB.XML_TYPE);
assertTrue(xmlTypeAnnotation != null);
xmlTypeAnnotation.addProp("fooo");
diff --git a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java
index 1ba7e774f9..114f4c3a48 100644
--- a/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java
+++ b/jaxb/tests/org.eclipse.jpt.jaxb.core.tests/src/org/eclipse/jpt/jaxb/core/tests/internal/resource/java/XmlValueAnnotationTests.java
@@ -11,9 +11,9 @@ package org.eclipse.jpt.jaxb.core.tests.internal.resource.java;
import java.util.Iterator;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.jaxb.core.resource.java.JAXB;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAttribute;
+import org.eclipse.jpt.jaxb.core.resource.java.JavaResourceType;
import org.eclipse.jpt.jaxb.core.resource.java.XmlValueAnnotation;
import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
@@ -39,13 +39,13 @@ public class XmlValueAnnotationTests extends JaxbJavaResourceModelTestCase {
public void testGetXmlValue() throws Exception {
ICompilationUnit cu = this.createTestXmlValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
+ JavaResourceType resourceType = buildJavaResourceType(cu);
+ JavaResourceAttribute resourceAttribute = getField(resourceType, 0);
- XmlValueAnnotation xmlValueAnnotation = (XmlValueAnnotation) attributeResource.getAnnotation(JAXB.XML_VALUE);
+ XmlValueAnnotation xmlValueAnnotation = (XmlValueAnnotation) resourceAttribute.getAnnotation(JAXB.XML_VALUE);
assertTrue(xmlValueAnnotation != null);
- attributeResource.removeAnnotation(JAXB.XML_VALUE);
+ resourceAttribute.removeAnnotation(JAXB.XML_VALUE);
assertSourceDoesNotContain("@XmlValue", cu);
}
}

Back to the top