diff options
author | kmoore | 2010-10-12 20:58:38 +0000 |
---|---|---|
committer | kmoore | 2010-10-12 20:58:38 +0000 |
commit | 5ff7c6963dfaf6200d3dc1c0e7dfb789bb7693f8 (patch) | |
tree | 1c2ead4272e07c9070e5188942c23e44ef46b469 /jpa/plugins/org.eclipse.jpt.core/src/org/eclipse | |
parent | 8bd2f0628732a49f4b470ed5cfaa4c33bfc27a28 (diff) | |
download | webtools.dali-5ff7c6963dfaf6200d3dc1c0e7dfb789bb7693f8.tar.gz webtools.dali-5ff7c6963dfaf6200d3dc1c0e7dfb789bb7693f8.tar.xz webtools.dali-5ff7c6963dfaf6200d3dc1c0e7dfb789bb7693f8.zip |
327609 - refactor Member hierarchy to include an AnnotatedElement interface in preparation for package annotation support.
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse')
143 files changed, 1883 insertions, 1528 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java index 01e98a4fe5..02e6b41741 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java @@ -10,7 +10,7 @@ package org.eclipse.jpt.core.context.java; import org.eclipse.jpt.core.context.GeneratorContainer; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; /** * Provisional API: This interface is part of an interim API that is still @@ -19,7 +19,7 @@ import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; * pioneering adopters on the understanding that any code that uses this API * will almost certainly be broken (repeatedly) as the API evolves. * - * @version 2.3 + * @version 3.0 * @since 2.3 */ public interface JavaGeneratorContainer @@ -33,12 +33,12 @@ public interface JavaGeneratorContainer JavaTableGenerator addTableGenerator(); - void initialize(JavaResourcePersistentMember jrpm); + void initialize(JavaResourceAnnotatedElement jrae); /** - * Update the JavaGeneratorContainer context model object to match the JavaResourcePersistentMember + * Update the JavaGeneratorContainer context model object to match the JavaResourceAnnotatedElement * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()} */ - void update(JavaResourcePersistentMember jrpm); + void update(JavaResourceAnnotatedElement jrae); }
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java index 7aa11f8585..8b46cc0775 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.context.java; import java.util.ListIterator; import org.eclipse.jpt.core.context.QueryContainer; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; /** * Provisional API: This interface is part of an interim API that is still @@ -20,7 +20,7 @@ import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; * pioneering adopters on the understanding that any code that uses this API * will almost certainly be broken (repeatedly) as the API evolves. * - * @version 2.3 + * @version 3.0 * @since 2.3 */ public interface JavaQueryContainer @@ -36,12 +36,12 @@ public interface JavaQueryContainer JavaNamedNativeQuery addNamedNativeQuery(int index); - void initialize(JavaResourcePersistentMember jrpm); + void initialize(JavaResourceAnnotatedElement jrae); /** - * Update the JavaGeneratorContainer context model object to match the JavaResourcePersistentMember + * Update the JavaQueryContainer context model object to match the JavaResourceAnnotatedElement * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()} */ - void update(JavaResourcePersistentMember jrpm); + void update(JavaResourceAnnotatedElement jrae); }
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java index 1f4586a705..63c1b24ad0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -22,7 +22,7 @@ import org.eclipse.jpt.core.context.java.JavaTableGenerator; import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode; import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages; import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation; import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation; import org.eclipse.jpt.core.utility.TextRange; @@ -33,7 +33,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode implements JavaGeneratorContainer { - protected JavaResourcePersistentMember javaResourcePersistentMember; + protected JavaResourceAnnotatedElement javaResourceAnnotatedElement; protected JavaSequenceGenerator sequenceGenerator; @@ -54,7 +54,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } this.tableGenerator = getJpaFactory().buildJavaTableGenerator(this); TableGeneratorAnnotation tableGeneratorResource = - (TableGeneratorAnnotation) this.javaResourcePersistentMember. + (TableGeneratorAnnotation) this.javaResourceAnnotatedElement. addAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME); this.tableGenerator.initialize(tableGeneratorResource); firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator); @@ -67,7 +67,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } JavaTableGenerator oldTableGenerator = this.tableGenerator; this.tableGenerator = null; - this.javaResourcePersistentMember.removeAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME); + this.javaResourceAnnotatedElement.removeAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME); firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, null); } @@ -87,7 +87,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } this.sequenceGenerator = getJpaFactory().buildJavaSequenceGenerator(this); SequenceGeneratorAnnotation sequenceGeneratorResource = - (SequenceGeneratorAnnotation) this.javaResourcePersistentMember. + (SequenceGeneratorAnnotation) this.javaResourceAnnotatedElement. addAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME); this.sequenceGenerator.initialize(sequenceGeneratorResource); firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator); @@ -100,7 +100,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator; this.sequenceGenerator = null; - this.javaResourcePersistentMember.removeAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME); + this.javaResourceAnnotatedElement.removeAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME); firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator,null); } @@ -115,8 +115,8 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } - public void initialize(JavaResourcePersistentMember jrpm) { - this.javaResourcePersistentMember = jrpm; + public void initialize(JavaResourceAnnotatedElement jrae) { + this.javaResourceAnnotatedElement = jrae; this.initializeTableGenerator(); this.initializeSequenceGenerator(); } @@ -135,8 +135,8 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } } - public void update(JavaResourcePersistentMember jrpm) { - this.javaResourcePersistentMember = jrpm; + public void update(JavaResourceAnnotatedElement jrae) { + this.javaResourceAnnotatedElement = jrae; this.updateTableGenerator(); this.updateSequenceGenerator(); } @@ -165,7 +165,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } protected TableGeneratorAnnotation getResourceTableGenerator() { - return (TableGeneratorAnnotation) this.javaResourcePersistentMember. + return (TableGeneratorAnnotation) this.javaResourceAnnotatedElement. getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME); } @@ -193,7 +193,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } protected SequenceGeneratorAnnotation getResourceSequenceGenerator() { - return (SequenceGeneratorAnnotation) this.javaResourcePersistentMember. + return (SequenceGeneratorAnnotation) this.javaResourceAnnotatedElement. getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME); } @@ -264,7 +264,7 @@ public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode } public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.javaResourcePersistentMember.getTextRange(astRoot); + return this.javaResourceAnnotatedElement.getTextRange(astRoot); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java index 3baaedc7bc..df6ef5d53e 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -25,7 +25,7 @@ import org.eclipse.jpt.core.context.java.JavaQueryContainer; import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode; import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages; import org.eclipse.jpt.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation; import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation; import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation; @@ -41,7 +41,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter; public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode implements JavaQueryContainer { - protected JavaResourcePersistentMember javaResourcePersistentMember; + protected JavaResourceAnnotatedElement javaResourceAnnotatedElement; protected final List<JavaNamedQuery> namedQueries; @@ -71,7 +71,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode JavaNamedQuery namedQuery = getJpaFactory().buildJavaNamedQuery(this); this.namedQueries.add(index, namedQuery); NamedQueryAnnotation namedQueryAnnotation = - (NamedQueryAnnotation) this.javaResourcePersistentMember. + (NamedQueryAnnotation) this.javaResourceAnnotatedElement. addAnnotation( index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME); @@ -94,7 +94,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode public void removeNamedQuery(int index) { JavaNamedQuery removedNamedQuery = this.namedQueries.remove(index); - this.javaResourcePersistentMember.removeAnnotation( + this.javaResourceAnnotatedElement.removeAnnotation( index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME); fireItemRemoved(NAMED_QUERIES_LIST, index, removedNamedQuery); } @@ -105,7 +105,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode public void moveNamedQuery(int targetIndex, int sourceIndex) { CollectionTools.move(this.namedQueries, targetIndex, sourceIndex); - this.javaResourcePersistentMember.moveAnnotation( + this.javaResourceAnnotatedElement.moveAnnotation( targetIndex, sourceIndex, NamedQueriesAnnotation.ANNOTATION_NAME); fireItemMoved(NAMED_QUERIES_LIST, targetIndex, sourceIndex); } @@ -122,7 +122,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode JavaNamedNativeQuery namedNativeQuery = getJpaFactory().buildJavaNamedNativeQuery(this); this.namedNativeQueries.add(index, namedNativeQuery); NamedNativeQueryAnnotation namedNativeQueryAnnotation = - (NamedNativeQueryAnnotation) this.javaResourcePersistentMember. + (NamedNativeQueryAnnotation) this.javaResourceAnnotatedElement. addAnnotation( index, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME); @@ -145,7 +145,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode public void removeNamedNativeQuery(int index) { JavaNamedNativeQuery removedNamedNativeQuery = this.namedNativeQueries.remove(index); - this.javaResourcePersistentMember.removeAnnotation( + this.javaResourceAnnotatedElement.removeAnnotation( index, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME); fireItemRemoved(NAMED_NATIVE_QUERIES_LIST, index, removedNamedNativeQuery); @@ -157,21 +157,21 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode public void moveNamedNativeQuery(int targetIndex, int sourceIndex) { CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex); - this.javaResourcePersistentMember.moveAnnotation( + this.javaResourceAnnotatedElement.moveAnnotation( targetIndex, sourceIndex, NamedNativeQueriesAnnotation.ANNOTATION_NAME); fireItemMoved(NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex); } - public void initialize(JavaResourcePersistentMember jrpm) { - this.javaResourcePersistentMember = jrpm; + public void initialize(JavaResourceAnnotatedElement jrae) { + this.javaResourceAnnotatedElement = jrae; this.initializeNamedQueries(); this.initializeNamedNativeQueries(); } protected void initializeNamedQueries() { - for (Iterator<NestableAnnotation> stream = this.javaResourcePersistentMember. + for (Iterator<NestableAnnotation> stream = this.javaResourceAnnotatedElement. annotations( NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME); @@ -181,7 +181,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode } protected void initializeNamedNativeQueries() { - for (Iterator<NestableAnnotation> stream = this.javaResourcePersistentMember. + for (Iterator<NestableAnnotation> stream = this.javaResourceAnnotatedElement. annotations( NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME); @@ -202,8 +202,8 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode return namedNativeQuery; } - public void update(JavaResourcePersistentMember jrpm) { - this.javaResourcePersistentMember = jrpm; + public void update(JavaResourceAnnotatedElement jrae) { + this.javaResourceAnnotatedElement = jrae; this.updateNamedQueries(); this.updateNamedNativeQueries(); } @@ -211,7 +211,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode protected void updateNamedQueries() { ListIterator<JavaNamedQuery> queries = namedQueries(); Iterator<NestableAnnotation> resourceNamedQueries = - this.javaResourcePersistentMember.annotations( + this.javaResourceAnnotatedElement.annotations( NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME); @@ -233,7 +233,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode protected void updateNamedNativeQueries() { ListIterator<JavaNamedNativeQuery> queries = namedNativeQueries(); Iterator<NestableAnnotation> resourceNamedNativeQueries = - this.javaResourcePersistentMember.annotations( + this.javaResourceAnnotatedElement.annotations( NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueriesAnnotation.ANNOTATION_NAME); @@ -287,7 +287,7 @@ public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode } public TextRange getValidationTextRange(CompilationUnit astRoot) { - return this.javaResourcePersistentMember.getTextRange(astRoot); + return this.javaResourceAnnotatedElement.getTextRange(astRoot); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java index 617747551f..edb94b6fcf 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * 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. @@ -10,8 +10,8 @@ package org.eclipse.jpt.core.internal.jpa1.resource.java.source; import org.eclipse.jpt.core.internal.resource.java.source.SourceAssociationOverrideAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.resource.java.JPA; import org.eclipse.jpt.core.resource.java.JavaResourceNode; @@ -37,12 +37,12 @@ public final class SourceAssociationOverride1_0Annotation // ********** static methods ********** public static SourceAssociationOverride1_0Annotation buildAssociationOverride(JavaResourceNode parent, Member member) { - return new SourceAssociationOverride1_0Annotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); + return new SourceAssociationOverride1_0Annotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); } static SourceAssociationOverride1_0Annotation buildNestedAssociationOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa); return new SourceAssociationOverride1_0Annotation(parent, member, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java index 44bf07b668..9d0ac2c39d 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java @@ -27,7 +27,7 @@ public final class SourceAssociationOverrides1_0Annotation @Override protected NestableAssociationOverrideAnnotation buildAssociationOverride(int index) { - return SourceAssociationOverride1_0Annotation.buildNestedAssociationOverride(this, this.member, index, this.daa); + return SourceAssociationOverride1_0Annotation.buildNestedAssociationOverride(this, this.annotatedElement, index, this.daa); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java index ec2cd71009..882463673b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceAccess2_0An import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation; 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; /** @@ -41,16 +43,16 @@ public final class Access2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceAccess2_0Annotation(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceAccess2_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - return new NullAccess2_0Annotation(parent); + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { + return new NullAccess2_0Annotation((JavaResourcePersistentMember) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { - return new BinaryAccess2_0Annotation(parent, jdtAnnotation); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { + return new BinaryAccess2_0Annotation((JavaResourcePersistentMember) parent, jdtAnnotation); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java index d885db7ebf..db340bd03f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceAssociation import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class AssociationOverride2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceAssociationOverride2_0Annotation.buildAssociationOverride(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceAssociationOverride2_0Annotation.buildAssociationOverride((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryAssociationOverride2_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java index 3d9b6239d1..7a1b956899 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceAssociation import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class AssociationOverrides2_0AnnotationDefinition super(); } - public AssociationOverridesAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceAssociationOverrides2_0Annotation(parent, member); + public AssociationOverridesAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceAssociationOverrides2_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public AssociationOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public AssociationOverridesAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryAssociationOverrides2_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java index e5911e193b..449589b721 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceCacheable2_ import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class Cacheable2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceCacheable2_0Annotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceCacheable2_0Annotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryCacheable2_0Annotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java index 83740dbc57..add7b0eb7b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceCollectionT import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.CollectionTable @@ -43,15 +43,15 @@ public final class CollectionTable2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceCollectionTable2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceCollectionTable2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullCollectionTable2_0Annotation(parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryCollectionTable2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java index 867ffbf4bb..d2ed5be3dd 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceElementColl import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.ElementCollection @@ -43,15 +43,15 @@ public final class ElementCollection2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceElementCollection2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceElementCollection2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryElementCollection2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java index 42a60a11a5..3d8941b6bc 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryGeneratedAn import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceGeneratedAnnotation; import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -45,15 +45,15 @@ public final class GeneratedAnnotationDefinition super(); } - public GeneratedAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceGeneratedAnnotation((JavaResourcePersistentType) parent, (Type) member); + public GeneratedAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceGeneratedAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public GeneratedAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public GeneratedAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return null; } - public GeneratedAnnotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public GeneratedAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryGeneratedAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java index 0d2aa5b318..5c7042aebf 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyClass import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKeyClass @@ -43,15 +43,15 @@ public final class MapKeyClass2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapKeyClass2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapKeyClass2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyClass2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java index 92e276eb68..1ef128e751 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyColum import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKeyColumn @@ -43,15 +43,15 @@ public final class MapKeyColumn2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapKeyColumn2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapKeyColumn2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullMapKeyColumnAnnotation(parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyColumn2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java index db6c09c0ca..602e923870 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyEnume import org.eclipse.jpt.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKeyTemporal @@ -43,15 +43,15 @@ public final class MapKeyEnumerated2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java index f4e77d272a..a63a6fde6a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyJoinC import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKeyJoinColumn @@ -41,15 +41,15 @@ public final class MapKeyJoinColumn2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceMapKeyJoinColumn2_0Annotation.createMapKeyJoinColumn(parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceMapKeyJoinColumn2_0Annotation.createMapKeyJoinColumn(parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyJoinColumn2_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java index 5054f2349c..2369738b96 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,10 +14,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyJoinC import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKeyJoinColumns @@ -42,15 +42,15 @@ public final class MapKeyJoinColumns2_0AnnotationDefinition super(); } - public MapKeyJoinColumns2_0Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapKeyJoinColumns2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public MapKeyJoinColumns2_0Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapKeyJoinColumns2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public MapKeyJoinColumns2_0Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public MapKeyJoinColumns2_0Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyJoinColumns2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java index 86ada7cf70..dc20f1b06b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyTempo import org.eclipse.jpt.core.jpa2.resource.java.MapKeyTemporal2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKeyTemporal @@ -43,15 +43,15 @@ public final class MapKeyTemporal2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java index b8fb43cd26..c95e94cb49 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. + * 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 @@ -16,10 +16,11 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapsId2_0An import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapsId @@ -46,15 +47,15 @@ public class MapsId2_0AnnotationDefinition implements AnnotationDefinition } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapsId2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapsId2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { - return new NullMapsId2_0Annotation(parent); + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { + return new NullMapsId2_0Annotation((JavaResourcePersistentMember) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapsId2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java index 2c17accad0..fe9fe210fc 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 Oracle. All rights reserved. +* 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryNamedQuerie import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceNamedQueries2_0Annotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -42,15 +42,15 @@ public class NamedQueries2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceNamedQueries2_0Annotation(parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceNamedQueries2_0Annotation(parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryNamedQueries2_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java index 5c09d18be5..d5eee3db23 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 Oracle. All rights reserved. +* 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryNamedQuery2 import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceNamedQuery2_0Annotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -42,15 +42,15 @@ public class NamedQuery2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceNamedQuery2_0Annotation(parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceNamedQuery2_0Annotation(parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryNamedQuery2_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java index 114a3a704e..beb31d43e3 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceOrderColumn import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation; 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.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.OrderColumn @@ -43,15 +43,15 @@ public final class OrderColumn2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java index f3d9aed822..b93573029c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 Oracle. All rights reserved. +* 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinarySequenceGen import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceSequenceGenerator2_0Annotation; 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.resource.java.SequenceGeneratorAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class SequenceGenerator2_0AnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceSequenceGenerator2_0Annotation(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceSequenceGenerator2_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinarySequenceGenerator2_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java index 7d5aa069a1..1dea4addd4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -10,8 +10,8 @@ package org.eclipse.jpt.core.internal.jpa2.resource.java; import org.eclipse.jpt.core.internal.resource.java.source.SourceBaseJoinColumnAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.jpa2.resource.java.JPA2_0; @@ -38,11 +38,11 @@ public final class SourceMapKeyJoinColumn2_0Annotation } public SourceMapKeyJoinColumn2_0Annotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) { - this(parent, attribute, daa, new MemberAnnotationAdapter(attribute, daa)); + this(parent, attribute, daa, new ElementAnnotationAdapter(attribute, daa)); } public SourceMapKeyJoinColumn2_0Annotation(JavaResourceNode parent, Attribute attribute, IndexedDeclarationAnnotationAdapter idaa) { - this(parent, attribute, idaa, new MemberIndexedAnnotationAdapter(attribute, idaa)); + this(parent, attribute, idaa, new ElementIndexedAnnotationAdapter(attribute, idaa)); } public String getAnnotationName() { @@ -106,7 +106,7 @@ public final class SourceMapKeyJoinColumn2_0Annotation static SourceMapKeyJoinColumn2_0Annotation createNestedMapKeyJoinColumn(JavaResourceNode parent, Attribute attribute, int index, DeclarationAnnotationAdapter joinColumnsAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(attribute, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(attribute, idaa); return new SourceMapKeyJoinColumn2_0Annotation(parent, attribute, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java index 68ca7dafc9..8969766c8d 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java @@ -21,7 +21,6 @@ import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation; import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation; import org.eclipse.jpt.core.jpa2.resource.java.NestableMapKeyJoinColumnAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation; import org.eclipse.jpt.core.utility.jdt.Attribute; import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; import org.eclipse.jpt.utility.internal.CollectionTools; @@ -97,7 +96,7 @@ public final class SourceMapKeyJoinColumns2_0Annotation } private NestableMapKeyJoinColumnAnnotation buildMapKeyJoinColumn(int index) { - return SourceMapKeyJoinColumn2_0Annotation.createNestedMapKeyJoinColumn(this, this.member, index, this.daa); + return SourceMapKeyJoinColumn2_0Annotation.createNestedMapKeyJoinColumn(this, this.annotatedElement, index, this.daa); } public NestableMapKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java index 76686e5815..676036658f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryStaticMetam import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceStaticMetamodelAnnotation; import org.eclipse.jpt.core.jpa2.resource.java.StaticMetamodelAnnotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -45,15 +45,15 @@ public final class StaticMetamodelAnnotationDefinition super(); } - public StaticMetamodelAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceStaticMetamodelAnnotation((JavaResourcePersistentType) parent, (Type) member); + public StaticMetamodelAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceStaticMetamodelAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public StaticMetamodelAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public StaticMetamodelAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return null; } - public StaticMetamodelAnnotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public StaticMetamodelAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryStaticMetamodelAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java index 0fa89552f4..8bcf5f4221 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java @@ -12,7 +12,7 @@ package org.eclipse.jpt.core.internal.jpa2.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.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation; import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0; @@ -40,7 +40,7 @@ public final class SourceAccess2_0Annotation public SourceAccess2_0Annotation(JavaResourcePersistentMember parent, Member member) { super(parent, member, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(member, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(member, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java index e006d46218..ac2436b769 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java @@ -13,8 +13,8 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.jpa2.resource.java.NullAssociationOverrideJoinTableAnnotation; import org.eclipse.jpt.core.internal.resource.java.source.SourceAssociationOverrideAnnotation; import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinTableAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.NestedDeclarationAnnotationAdapter; import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter; import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation; @@ -35,21 +35,21 @@ public final class SourceAssociationOverride2_0Annotation extends SourceAssociationOverrideAnnotation implements AssociationOverride2_0Annotation { - private final MemberAnnotationAdapter joinTableAdapter; + private final ElementAnnotationAdapter joinTableAdapter; private NestableJoinTableAnnotation joinTable; // ********** constructor ********** public SourceAssociationOverride2_0Annotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { super(parent, member, daa, annotationAdapter); - this.joinTableAdapter = new MemberAnnotationAdapter(this.member, buildJoinTableAnnotationAdapter(this.daa)); + this.joinTableAdapter = new ElementAnnotationAdapter(this.annotatedElement, buildJoinTableAnnotationAdapter(this.daa)); } @Override public void initialize(CompilationUnit astRoot) { super.initialize(astRoot); if (this.joinTableAdapter.getAnnotation(astRoot) != null) { - this.joinTable = buildJoinTableAnnotation(this, this.member, this.daa); + this.joinTable = buildJoinTableAnnotation(this, this.annotatedElement, this.daa); this.joinTable.initialize(astRoot); } } @@ -75,7 +75,7 @@ public final class SourceAssociationOverride2_0Annotation if (this.joinTable != null) { throw new IllegalStateException("'joinTable' element already exists: " + this.joinTable); //$NON-NLS-1$ } - this.joinTable = buildJoinTableAnnotation(this, this.member, this.daa); + this.joinTable = buildJoinTableAnnotation(this, this.annotatedElement, this.daa); this.joinTable.newAnnotation(); return this.joinTable; } @@ -93,7 +93,7 @@ public final class SourceAssociationOverride2_0Annotation this.syncJoinTable_(null); } else { if (this.joinTable == null) { - NestableJoinTableAnnotation table = buildJoinTableAnnotation(this, this.member, this.daa); + NestableJoinTableAnnotation table = buildJoinTableAnnotation(this, this.annotatedElement, this.daa); table.initialize(astRoot); this.syncJoinTable_(table); } else { @@ -112,7 +112,7 @@ public final class SourceAssociationOverride2_0Annotation // ********** static methods ********** public static SourceAssociationOverride2_0Annotation buildAssociationOverride(JavaResourceNode parent, Member member) { - return new SourceAssociationOverride2_0Annotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); + return new SourceAssociationOverride2_0Annotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); } static NestableJoinTableAnnotation buildJoinTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter associationOverrideAnnotationAdapter) { @@ -126,7 +126,7 @@ public final class SourceAssociationOverride2_0Annotation static SourceAssociationOverrideAnnotation buildNestedAssociationOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa); return new SourceAssociationOverride2_0Annotation(parent, member, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java index 9a72dd220e..65654ebbbb 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java @@ -27,7 +27,7 @@ public final class SourceAssociationOverrides2_0Annotation @Override protected NestableAssociationOverrideAnnotation buildAssociationOverride(int index) { - return SourceAssociationOverride2_0Annotation.buildNestedAssociationOverride(this, this.member, index, this.daa); + return SourceAssociationOverride2_0Annotation.buildNestedAssociationOverride(this, this.annotatedElement, index, this.daa); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java index 85fd521da8..7879971781 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java @@ -13,7 +13,7 @@ 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.BooleanExpressionConverter; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation; import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0; @@ -41,7 +41,7 @@ public final class SourceCacheable2_0Annotation public SourceCacheable2_0Annotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<Boolean>(type, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(type, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java index 8591d533b1..c25acb66ff 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java @@ -147,7 +147,7 @@ public final class SourceCollectionTable2_0Annotation } private NestableJoinColumnAnnotation buildJoinColumn(int index) { - return new SourceJoinColumnAnnotation(this, this.member, buildJoinColumnAnnotationAdapter(index)); + return new SourceJoinColumnAnnotation(this, this.annotatedElement, buildJoinColumnAnnotationAdapter(index)); } private IndexedDeclarationAnnotationAdapter buildJoinColumnAnnotationAdapter(int index) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java index 9c2cbbc509..5aadf6afd1 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java @@ -14,7 +14,7 @@ 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.EnumDeclarationAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.ASTTools; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.jpa2.resource.java.ElementCollection2_0Annotation; @@ -50,8 +50,8 @@ public final class SourceElementCollection2_0Annotation public SourceElementCollection2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.targetClassAdapter = new MemberAnnotationElementAdapter<String>(attribute, TARGET_CLASS_ADAPTER); - this.fetchAdapter = new MemberAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER); + this.targetClassAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, TARGET_CLASS_ADAPTER); + this.fetchAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java index fa8da6ec08..fe05d57de2 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java @@ -17,7 +17,7 @@ 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.AnnotationStringArrayExpressionConverter; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; @@ -64,11 +64,11 @@ public final class SourceGeneratedAnnotation } private AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) { - return new MemberAnnotationElementAdapter<String[]>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea); } private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } public void initialize(CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java index 27177fdb01..38d0b29b66 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java @@ -13,7 +13,7 @@ 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.ASTTools; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.jpa2.resource.java.JPA2_0; @@ -43,7 +43,7 @@ public final class SourceMapKeyClass2_0Annotation public SourceMapKeyClass2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java index 4331c36a1d..fe3fa6e609 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java @@ -12,7 +12,7 @@ package org.eclipse.jpt.core.internal.jpa2.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.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0; import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation; @@ -42,7 +42,7 @@ public final class SourceMapsId2_0Annotation public SourceMapsId2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java index 1e86f39717..1e06d80008 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java @@ -26,6 +26,6 @@ public final class SourceNamedQueries2_0Annotation @Override protected NestableNamedQueryAnnotation buildNamedQuery(int index) { - return SourceNamedQuery2_0Annotation.createNestedNamedQuery(this, member, index, this.daa); + return SourceNamedQuery2_0Annotation.createNestedNamedQuery(this, this.annotatedElement, index, this.daa); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java index abc4264e2c..2d9a9e9130 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java @@ -12,9 +12,9 @@ package org.eclipse.jpt.core.internal.jpa2.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueryAnnotation; import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter; import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter; import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0; import org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0; @@ -46,11 +46,11 @@ public final class SourceNamedQuery2_0Annotation public SourceNamedQuery2_0Annotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { super(parent, type, daa, annotationAdapter); this.lockModeDeclarationAdapter = this.buildLockModeTypeAdapter(daa); - this.lockModeAdapter = new MemberAnnotationElementAdapter<String>(type, this.lockModeDeclarationAdapter); + this.lockModeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, this.lockModeDeclarationAdapter); } public SourceNamedQuery2_0Annotation(JavaResourceNode parent, Type type) { - this(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER)); + this(parent, type, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER)); } private DeclarationAnnotationElementAdapter<String> buildLockModeTypeAdapter(DeclarationAnnotationAdapter daAdapter) { @@ -123,7 +123,7 @@ public final class SourceNamedQuery2_0Annotation static SourceNamedQuery2_0Annotation createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(type, idaa); return new SourceNamedQuery2_0Annotation(parent, type, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java index 4a2ceea0ef..d7c4adb5e7 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java @@ -13,7 +13,7 @@ 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.ASTTools; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.jpa2.resource.java.JPA2_0; @@ -42,7 +42,7 @@ public final class SourceStaticMetamodelAnnotation public SourceStaticMetamodelAnnotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java index 9fc26e3348..50711510e4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceAssociation import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class AssociationOverrideAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceAssociationOverride1_0Annotation.buildAssociationOverride(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceAssociationOverride1_0Annotation.buildAssociationOverride((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryAssociationOverride1_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java index 2fd18af99f..1c22e47f57 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceAssociation import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class AssociationOverridesAnnotationDefinition super(); } - public AssociationOverridesAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceAssociationOverrides1_0Annotation(parent, member); + public AssociationOverridesAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceAssociationOverrides1_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public AssociationOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public AssociationOverridesAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryAssociationOverrides1_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java index 03b83f682e..9cff112d36 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceAttributeOverrid import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class AttributeOverrideAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceAttributeOverrideAnnotation.buildAttributeOverride(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceAttributeOverrideAnnotation.buildAttributeOverride((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryAttributeOverrideAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java index 27c8986fcb..4076edf941 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceAttributeOverrid import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class AttributeOverridesAnnotationDefinition super(); } - public AttributeOverridesAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceAttributeOverridesAnnotation(parent, member); + public AttributeOverridesAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceAttributeOverridesAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public AttributeOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public AttributeOverridesAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryAttributeOverridesAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java index 989aa71ed0..d42a2e93b2 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceBasicAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.BasicAnnotation; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Basic @@ -43,15 +43,15 @@ public final class BasicAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceBasicAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceBasicAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullBasicAnnotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryBasicAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java index 219c98745c..5de550cfff 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,7 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceColumnAnnotation import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.ColumnAnnotation; +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; /** @@ -41,15 +43,15 @@ public final class ColumnAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceColumnAnnotation(parent, member, SourceColumnAnnotation.MAPPING_DECLARATION_ANNOTATION_ADAPTER); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceColumnAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement, SourceColumnAnnotation.MAPPING_DECLARATION_ANNOTATION_ADAPTER); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullColumnAnnotation(parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryColumnAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java index 503bc038d3..9aa2710a3a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceDiscriminatorCol import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -44,15 +44,15 @@ public final class DiscriminatorColumnAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java index 449ccdadc4..3bf48b53a5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceDiscriminatorVal import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class DiscriminatorValueAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullDiscriminatorValueAnnotation((JavaResourcePersistentType) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java index fd7dbfa3c7..d46f5fb42e 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceEmbeddableAnnota import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class EmbeddableAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEmbeddableAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceEmbeddableAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryEmbeddableAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java index 1a3889fe3c..1f8f1894bd 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceEmbeddedAnnotati import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Embedded @@ -43,15 +43,15 @@ public final class EmbeddedAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullEmbeddedAnnotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java index 741375240d..254060b91b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceEmbeddedIdAnnota import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.EmbeddedId @@ -43,15 +43,15 @@ public final class EmbeddedIdAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java index 7c4f432ffe..be9463071d 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceEntityAnnotation import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.EntityAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class EntityAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEntityAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceEntityAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryEntityAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java index f5e9c49e1a..a3ff9bee5c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceEnumeratedAnnota import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Enumerated @@ -43,15 +43,15 @@ public final class EnumeratedAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullEnumeratedAnnotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java index 0b537e4757..db490cd11a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceGeneratedValueAn import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.GeneratedValue @@ -43,15 +43,15 @@ public final class GeneratedValueAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java index 12ebf03b98..24a22d40cb 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,10 +15,10 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceIdAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.IdAnnotation; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Id @@ -43,15 +43,15 @@ public final class IdAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryIdAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java index 1f7bec270c..5df915d4e9 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceIdClassAnnotatio import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.IdClassAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class IdClassAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceIdClassAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceIdClassAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryIdClassAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java index 297ae12fa7..d69eb2b90c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -15,9 +15,9 @@ import org.eclipse.jpt.core.internal.resource.java.source.SourceInheritanceAnnot import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; import org.eclipse.jpt.core.resource.java.InheritanceAnnotation; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class InheritanceAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceInheritanceAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceInheritanceAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullInheritanceAnnotation((JavaResourcePersistentType) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryInheritanceAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java index c2c248a86c..3886b290aa 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinColumnAnnota import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinColumnAnnotation; 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.resource.java.JoinColumnAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class JoinColumnAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceJoinColumnAnnotation.createJoinColumn(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceJoinColumnAnnotation.createJoinColumn((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryJoinColumnAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java index 1c00f40fde..a68ca888a6 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinColumnsAnnot import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinColumnsAnnotation; 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.resource.java.JoinColumnsAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class JoinColumnsAnnotationDefinition super(); } - public JoinColumnsAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceJoinColumnsAnnotation(parent, member); + public JoinColumnsAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceJoinColumnsAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public JoinColumnsAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public JoinColumnsAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryJoinColumnsAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java index a58445ec6a..fd30d5041a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinTableAnnotat import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinTableAnnotation; 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.resource.java.JoinTableAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class JoinTableAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceJoinTableAnnotation(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceJoinTableAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullJoinTableAnnotation(parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryJoinTableAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java index fc4536f6c3..241312d2c1 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryLobAnnotation; import org.eclipse.jpt.core.internal.resource.java.source.SourceLobAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.LobAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Lob @@ -43,15 +43,15 @@ public final class LobAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceLobAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceLobAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryLobAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java index a10d93fec5..0fae712ccd 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryManyToManyAnnota import org.eclipse.jpt.core.internal.resource.java.source.SourceManyToManyAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.ManyToMany @@ -43,15 +43,15 @@ public final class ManyToManyAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceManyToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceManyToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryManyToManyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java index 140d7977b8..db3b4663fe 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryManyToOneAnnotat import org.eclipse.jpt.core.internal.resource.java.source.SourceManyToOneAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.ManyToOne @@ -43,15 +43,15 @@ public final class ManyToOneAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceManyToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceManyToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryManyToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java index a104c7036d..a6caec3309 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryMapKeyAnnotation import org.eclipse.jpt.core.internal.resource.java.source.SourceMapKeyAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.MapKeyAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.MapKey @@ -43,15 +43,15 @@ public final class MapKeyAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMapKeyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMapKeyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMapKeyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java index c6452c9e68..844ac6aaed 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,10 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryMappedSuperclass import org.eclipse.jpt.core.internal.resource.java.source.SourceMappedSuperclassAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class MappedSuperclassAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceMappedSuperclassAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceMappedSuperclassAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryMappedSuperclassAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java index 21d55cb918..d503efdb6a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedNativeQueri import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedNativeQueriesAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -42,15 +42,15 @@ public final class NamedNativeQueriesAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceNamedNativeQueriesAnnotation(parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceNamedNativeQueriesAnnotation(parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryNamedNativeQueriesAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java index db6d640c07..c8e63fc6a1 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedNativeQuery import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedNativeQueryAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -42,15 +42,15 @@ public final class NamedNativeQueryAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceNamedNativeQueryAnnotation.createNamedNativeQuery(parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceNamedNativeQueryAnnotation.createNamedNativeQuery(parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryNamedNativeQueryAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java index ef71eec403..17b84bc2b3 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinaryNamedQuerie import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueries1_0Annotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -42,15 +42,15 @@ public final class NamedQueriesAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceNamedQueries1_0Annotation(parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceNamedQueries1_0Annotation(parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryNamedQueries1_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java index 9685560628..0f16c9c625 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,9 @@ import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinaryNamedQuery1 import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceNamedQuery1_0Annotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -42,15 +42,15 @@ public final class NamedQueryAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceNamedQuery1_0Annotation(parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceNamedQuery1_0Annotation(parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryNamedQuery1_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java index 0c9833eefd..f577b6c278 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryOneToManyAnnotat import org.eclipse.jpt.core.internal.resource.java.source.SourceOneToManyAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.OneToManyAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.OneToMany @@ -43,15 +43,15 @@ public final class OneToManyAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceOneToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceOneToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullOneToManyAnnotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryOneToManyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java index 6b600ca1f1..64892f8892 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryOneToOneAnnotati import org.eclipse.jpt.core.internal.resource.java.source.SourceOneToOneAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.OneToOneAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.OneToOne @@ -43,15 +43,15 @@ public final class OneToOneAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceOneToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceOneToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullOneToOneAnnotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryOneToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java index 59997519a7..46bc3accb4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryOrderByAnnotatio import org.eclipse.jpt.core.internal.resource.java.source.SourceOrderByAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.OrderByAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.OrderBy @@ -43,15 +43,15 @@ public final class OrderByAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceOrderByAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceOrderByAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryOrderByAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java index 77499381c1..e2ecdc3bdb 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryPrimaryKeyJoinCo import org.eclipse.jpt.core.internal.resource.java.source.SourcePrimaryKeyJoinColumnAnnotation; 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.resource.java.PrimaryKeyJoinColumnAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class PrimaryKeyJoinColumnAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourcePrimaryKeyJoinColumnAnnotation.createPrimaryKeyJoinColumn(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourcePrimaryKeyJoinColumnAnnotation.createPrimaryKeyJoinColumn((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryPrimaryKeyJoinColumnAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java index 0c67aba310..a88725f801 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryPrimaryKeyJoinCo import org.eclipse.jpt.core.internal.resource.java.source.SourcePrimaryKeyJoinColumnsAnnotation; 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.resource.java.PrimaryKeyJoinColumnsAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class PrimaryKeyJoinColumnsAnnotationDefinition super(); } - public PrimaryKeyJoinColumnsAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourcePrimaryKeyJoinColumnsAnnotation(parent, member); + public PrimaryKeyJoinColumnsAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourcePrimaryKeyJoinColumnsAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public PrimaryKeyJoinColumnsAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public PrimaryKeyJoinColumnsAnnotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryPrimaryKeyJoinColumnsAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java index cca983ff52..173c92027e 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinarySecondaryTableAn import org.eclipse.jpt.core.internal.resource.java.source.SourceSecondaryTableAnnotation; 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.resource.java.SecondaryTableAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class SecondaryTableAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return SourceSecondaryTableAnnotation.createSecondaryTable(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return SourceSecondaryTableAnnotation.createSecondaryTable((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinarySecondaryTableAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java index 037c96894c..2fceff310b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,9 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinarySecondaryTablesA import org.eclipse.jpt.core.internal.resource.java.source.SourceSecondaryTablesAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; import org.eclipse.jpt.core.resource.java.SecondaryTablesAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -42,15 +43,15 @@ public final class SecondaryTablesAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceSecondaryTablesAnnotation((JavaResourcePersistentType) parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceSecondaryTablesAnnotation((JavaResourcePersistentType) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinarySecondaryTablesAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java index 884b36bb1a..a2a549b431 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinarySequenceGen import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceSequenceGenerator1_0Annotation; 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.resource.java.SequenceGeneratorAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class SequenceGeneratorAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceSequenceGenerator1_0Annotation(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceSequenceGenerator1_0Annotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinarySequenceGenerator1_0Annotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java index eb4880ad97..7c90087be1 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,10 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTableAnnotation; import org.eclipse.jpt.core.internal.resource.java.source.SourceTableAnnotation; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.AnnotationDefinition; -import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; +import org.eclipse.jpt.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType; import org.eclipse.jpt.core.resource.java.TableAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Type; /** @@ -43,15 +43,15 @@ public final class TableAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceTableAnnotation((JavaResourcePersistentType) parent, (Type) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceTableAnnotation((JavaResourcePersistentType) parent, (Type) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullTableAnnotation((JavaResourcePersistentType) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryTableAnnotation((JavaResourcePersistentType) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java index 428e818d4c..e272f037eb 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,8 +14,10 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTableGeneratorAn import org.eclipse.jpt.core.internal.resource.java.source.SourceTableGeneratorAnnotation; 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.resource.java.TableGeneratorAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Member; /** @@ -41,15 +43,15 @@ public final class TableGeneratorAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceTableGeneratorAnnotation(parent, member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceTableGeneratorAnnotation((JavaResourcePersistentMember) parent, (Member) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryTableGeneratorAnnotation(parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java index a1661263c9..ed951dc1d4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTemporalAnnotati import org.eclipse.jpt.core.internal.resource.java.source.SourceTemporalAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.TemporalAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Temporal @@ -43,15 +43,15 @@ public final class TemporalAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceTemporalAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceTemporalAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { return new NullTemporalAnnotation((JavaResourcePersistentAttribute) parent); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryTemporalAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java index 4d84704c0f..414a2c6ac3 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTransientAnnotat import org.eclipse.jpt.core.internal.resource.java.source.SourceTransientAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.TransientAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Transient @@ -43,15 +43,15 @@ public final class TransientAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceTransientAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceTransientAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryTransientAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java index 3b11cce142..1147e36a4a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. + * 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. @@ -14,11 +14,11 @@ import org.eclipse.jpt.core.internal.resource.java.binary.BinaryVersionAnnotatio import org.eclipse.jpt.core.internal.resource.java.source.SourceVersionAnnotation; 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.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.VersionAnnotation; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.Attribute; -import org.eclipse.jpt.core.utility.jdt.Member; /** * javax.persistence.Version @@ -43,15 +43,15 @@ public final class VersionAnnotationDefinition super(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) { - return new SourceVersionAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member); + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceVersionAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) annotatedElement); } - public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) { + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { throw new UnsupportedOperationException(); } - public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) { + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { return new BinaryVersionAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotatedElement.java new file mode 100644 index 0000000000..0c0ae97db6 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotatedElement.java @@ -0,0 +1,207 @@ +/******************************************************************************* + * 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.core.internal.resource.java.binary; + +import java.util.Iterator; +import java.util.Vector; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.core.JptCorePlugin; +import org.eclipse.jpt.core.resource.java.Annotation; +import org.eclipse.jpt.core.resource.java.ContainerAnnotation; +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.utility.internal.CollectionTools; +import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable; +import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator; +import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; + +/** + * binary annotated element + */ +abstract class BinaryAnnotatedElement + extends BinaryNode + implements JavaResourceAnnotatedElement +{ + /** JDT annotated element adapter */ + final Adapter adapter; + + /** annotations */ + final Vector<Annotation> annotations = new Vector<Annotation>(); + + + // ********** construction/initialization ********** + + public BinaryAnnotatedElement(JavaResourceNode parent, Adapter adapter) { + super(parent); + this.adapter = adapter; + this.initializeAnnotations(); + } + + private void initializeAnnotations() { + for (IAnnotation annotation : this.getJdtAnnotations()) { + this.addAnnotation(annotation); + } + } + + private void addAnnotation(IAnnotation jdtAnnotation) { + if (this.annotationIsValid(jdtAnnotation)) { + this.annotations.add(this.buildAnnotation(jdtAnnotation)); + } + } + + + // ********** updating ********** + + @Override + public void update() { + super.update(); + this.updateAnnotations(); + } + + // TODO + private void updateAnnotations() { + throw new UnsupportedOperationException(); + } + + + // ********** annotations ********** + + public Iterator<Annotation> annotations() { + return this.getAnnotations().iterator(); + } + + private Iterable<Annotation> getAnnotations() { + return new LiveCloneIterable<Annotation>(this.annotations); + } + + public int annotationsSize() { + 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 Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) { + ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName); + if (containerAnnotation != null) { + return containerAnnotation.getNestedAnnotations().iterator(); + } + NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName); + return (nestableAnnotation == null) ? + EmptyListIterator.<NestableAnnotation>instance() : + new SingleElementIterator<NestableAnnotation>(nestableAnnotation); + } + + private NestableAnnotation getNestableAnnotation(String annotationName) { + return (NestableAnnotation) this.getAnnotation(annotationName); + } + + @SuppressWarnings("unchecked") + private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) { + return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName); + } + + private boolean annotationIsValid(IAnnotation jdtAnnotation) { + return CollectionTools.contains(this.validAnnotationNames(), jdtAnnotation.getElementName()); + } + + abstract Iterator<String> validAnnotationNames(); + + abstract Annotation buildAnnotation(IAnnotation jdtAnnotation); + + abstract Annotation buildNullAnnotation(String annotationName); + + + // ********** simple state ********** + + public boolean isAnnotated() { + return ! this.annotations.isEmpty(); + } + + + // ********** miscellaneous ********** + + IJavaElement getAnnotatedElement() { + return this.adapter.getElement(); + } + + private Annotation selectAnnotationNamed(Iterable<Annotation> annotationList, String annotationName) { + for (Annotation annotation : annotationList) { + if (annotation.getAnnotationName().equals(annotationName)) { + return annotation; + } + } + return null; + } + + private IAnnotation[] getJdtAnnotations() { + try { + return this.adapter.getAnnotations(); + } catch (JavaModelException ex) { + JptCorePlugin.log(ex); + return EMPTY_JDT_ANNOTATION_ARRAY; + } + } + private static final IAnnotation[] EMPTY_JDT_ANNOTATION_ARRAY = new IAnnotation[0]; + + + // ********** IJavaElement adapter ********** + + interface Adapter { + /** + * Return the adapter's JDT element (IPackageFragment, IType, IField, IMethod). + */ + IJavaElement getElement(); + + /** + * Return the adapter's element's JDT annotations. + */ + IAnnotation[] getAnnotations() throws JavaModelException; + } + + + // ********** unsupported JavaResourcePersistentMember implementation ********** + + public Annotation addAnnotation(String annotationName) { + throw new UnsupportedOperationException(); + } + + public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) { + throw new UnsupportedOperationException(); + } + + public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) { + throw new UnsupportedOperationException(); + } + + public void removeAnnotation(String annotationName) { + throw new UnsupportedOperationException(); + } + + public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) { + throw new UnsupportedOperationException(); + } + + public TextRange getNameTextRange(CompilationUnit astRoot) { + throw new UnsupportedOperationException(); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java index 1b3f027257..5d8de0a927 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java @@ -447,7 +447,7 @@ final class BinaryPersistentAttribute this.field = field; } - public IField getMember() { + public IField getElement() { return this.field; } @@ -503,7 +503,7 @@ final class BinaryPersistentAttribute this.method = method; } - public IMethod getMember() { + public IMethod getElement() { return this.method; } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java index 8925e3d86e..9e5c6fce3b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java @@ -10,39 +10,26 @@ package org.eclipse.jpt.core.internal.resource.java.binary; import java.util.Iterator; -import java.util.Vector; - import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.JptCorePlugin; import org.eclipse.jpt.core.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.ContainerAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; import org.eclipse.jpt.core.resource.java.NestableAnnotation; import org.eclipse.jpt.core.utility.TextRange; -import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable; -import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator; import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; /** * binary persistent member */ abstract class BinaryPersistentMember - extends BinaryNode + extends BinaryAnnotatedElement implements JavaResourcePersistentMember { - /** JDT member adapter */ - final Adapter adapter; - - /** annotations */ - final Vector<Annotation> annotations = new Vector<Annotation>(); boolean persistable; @@ -52,95 +39,25 @@ abstract class BinaryPersistentMember // ********** construction/initialization ********** public BinaryPersistentMember(JavaResourceNode parent, Adapter adapter) { - super(parent); - this.adapter = adapter; - this.initializeAnnotations(); + super(parent, adapter); this.persistable = this.buildPersistable(); this.final_ = this.buildFinal(); } - private void initializeAnnotations() { - for (IAnnotation annotation : this.getJdtAnnotations()) { - this.addAnnotation(annotation); - } - } - private void addAnnotation(IAnnotation jdtAnnotation) { - if (this.annotationIsValid(jdtAnnotation)) { - this.annotations.add(this.buildAnnotation(jdtAnnotation)); - } + private Adapter getAdapter() { + return (Adapter) this.adapter; } - // ********** updating ********** @Override public void update() { super.update(); - this.updateAnnotations(); this.setPersistable(this.buildPersistable()); this.setFinal(this.buildFinal()); } - // TODO - private void updateAnnotations() { - throw new UnsupportedOperationException(); - } - - - // ********** annotations ********** - - public Iterator<Annotation> annotations() { - return this.getAnnotations().iterator(); - } - - private Iterable<Annotation> getAnnotations() { - return new LiveCloneIterable<Annotation>(this.annotations); - } - - public int annotationsSize() { - 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 Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) { - ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName); - if (containerAnnotation != null) { - return containerAnnotation.getNestedAnnotations().iterator(); - } - NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName); - return (nestableAnnotation == null) ? - EmptyListIterator.<NestableAnnotation>instance() : - new SingleElementIterator<NestableAnnotation>(nestableAnnotation); - } - - private NestableAnnotation getNestableAnnotation(String annotationName) { - return (NestableAnnotation) this.getAnnotation(annotationName); - } - - @SuppressWarnings("unchecked") - private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) { - return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName); - } - - private boolean annotationIsValid(IAnnotation jdtAnnotation) { - return CollectionTools.contains(this.validAnnotationNames(), jdtAnnotation.getElementName()); - } - - abstract Iterator<String> validAnnotationNames(); - - abstract Annotation buildAnnotation(IAnnotation jdtAnnotation); - - abstract Annotation buildNullAnnotation(String annotationName); - // ********** simple state ********** @@ -155,7 +72,7 @@ abstract class BinaryPersistentMember } private boolean buildPersistable() { - return this.adapter.isPersistable(); + return this.getAdapter().isPersistable(); } // ***** final @@ -178,25 +95,11 @@ abstract class BinaryPersistentMember } } - - public boolean isAnnotated() { - return ! this.annotations.isEmpty(); - } - // ********** miscellaneous ********** IMember getMember() { - return this.adapter.getMember(); - } - - private Annotation selectAnnotationNamed(Iterable<Annotation> annotationList, String annotationName) { - for (Annotation annotation : annotationList) { - if (annotation.getAnnotationName().equals(annotationName)) { - return annotation; - } - } - return null; + return (IMember) this.adapter.getElement(); } /** @@ -226,56 +129,46 @@ abstract class BinaryPersistentMember return Signature.toString(Signature.getTypeErasure(typeSignature)); } - private IAnnotation[] getJdtAnnotations() { - try { - return this.adapter.getAnnotations(); - } catch (JavaModelException ex) { - JptCorePlugin.log(ex); - return EMPTY_JDT_ANNOTATION_ARRAY; - } - } - private static final IAnnotation[] EMPTY_JDT_ANNOTATION_ARRAY = new IAnnotation[0]; - // ********** IMember adapter ********** - interface Adapter { + interface Adapter extends BinaryAnnotatedElement.Adapter { /** * Return the adapter's JDT member (IType, IField, IMethod). */ - IMember getMember(); + IMember getElement(); /** * Return whether the adapter's member is "persistable" * (i.e. according to the JPA spec the member can be mapped) */ boolean isPersistable(); - - /** - * Return the adapter's member's JDT annotations. - */ - IAnnotation[] getAnnotations() throws JavaModelException; } - // ********** unsupported JavaResourcePersistentMember implementation ********** + // ********** unsupported JavaResourceAnnotatedElement implementation ********** + @Override public Annotation addAnnotation(String annotationName) { throw new UnsupportedOperationException(); } + @Override public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) { throw new UnsupportedOperationException(); } + @Override public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) { throw new UnsupportedOperationException(); } + @Override public void removeAnnotation(String annotationName) { throw new UnsupportedOperationException(); } + @Override public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) { throw new UnsupportedOperationException(); } @@ -284,6 +177,7 @@ abstract class BinaryPersistentMember throw new UnsupportedOperationException(); } + @Override public TextRange getNameTextRange(CompilationUnit astRoot) { throw new UnsupportedOperationException(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java index 22ffc19866..cc8ab60755 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java @@ -566,7 +566,7 @@ final class BinaryPersistentType this.type = type; } - public IType getMember() { + public IType getElement() { return this.type; } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotatedElement.java new file mode 100644 index 0000000000..21f7269431 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotatedElement.java @@ -0,0 +1,441 @@ +/******************************************************************************* + * 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.core.internal.resource.java.source; + +import java.util.HashSet; +import java.util.Iterator; +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.resource.java.Annotation; +import org.eclipse.jpt.core.resource.java.ContainerAnnotation; +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.utility.internal.CollectionTools; +import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable; +import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; +import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; + +/** + * 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 Iterator<Annotation> annotations() { + return this.getAnnotations().iterator(); + } + + Iterable<Annotation> getAnnotations() { + return new LiveCloneIterable<Annotation>(this.annotations); + } + + public int annotationsSize() { + 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 Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) { + ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName); + if (containerAnnotation != null) { + return containerAnnotation.getNestedAnnotations().iterator(); + } + NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName); + if (nestableAnnotation != null) { + return new SingleElementIterator<NestableAnnotation>(nestableAnnotation); + } + return EmptyIterator.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.validAnnotationNames(), annotationName); + } + + abstract Iterator<String> validAnnotationNames(); + + 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java index 27e8e8c4e9..6a95185d73 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java @@ -13,24 +13,24 @@ 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.MemberAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter; import org.eclipse.jpt.core.resource.java.Annotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; 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.core.utility.jdt.Member; /** * some common state and behavior for Java source annotations; * and lots of convenience methods */ -public abstract class SourceAnnotation<M extends Member> +public abstract class SourceAnnotation<A extends AnnotatedElement> extends SourceNode implements Annotation { - protected final M member; + protected final A annotatedElement; protected final DeclarationAnnotationAdapter daa; @@ -40,16 +40,16 @@ public abstract class SourceAnnotation<M extends Member> /** * constructor for straight member annotation */ - protected SourceAnnotation(JavaResourceNode parent, M member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + 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, M member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { + protected SourceAnnotation(JavaResourceNode parent, A annotatedElement, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { super(parent); - this.member = member; + this.annotatedElement = annotatedElement; this.daa = daa; this.annotationAdapter = annotationAdapter; } @@ -132,7 +132,7 @@ public abstract class SourceAnnotation<M extends Member> * Return the specified AST DOM element. */ protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) { - return adapter.getExpression(this.member.getModifiedDeclaration(astRoot)); + return adapter.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot)); } /** diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java index ea11bfe3a6..4034302844 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java @@ -120,7 +120,7 @@ public abstract class SourceAssociationOverrideAnnotation } private NestableJoinColumnAnnotation buildJoinColumn(int index) { - return SourceJoinColumnAnnotation.createAssociationOverrideJoinColumn(this.daa, this, this.member, index); + return SourceJoinColumnAnnotation.createAssociationOverrideJoinColumn(this.daa, this, this.annotatedElement, index); } void joinColumnAdded(int index, NestableJoinColumnAnnotation joinColumn) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java index f3f8f3b3c3..80f9aade75 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java @@ -11,8 +11,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverrideColumnAnnotation; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.resource.java.AttributeOverrideAnnotation; @@ -37,7 +37,7 @@ public final class SourceAttributeOverrideAnnotation { public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - private final MemberAnnotationAdapter columnAdapter; + private final ElementAnnotationAdapter columnAdapter; private NestableColumnAnnotation column; @@ -45,7 +45,7 @@ public final class SourceAttributeOverrideAnnotation public SourceAttributeOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { super(parent, member, daa, annotationAdapter); - this.columnAdapter = new MemberAnnotationAdapter(this.member, SourceColumnAnnotation.buildAttributeOverrideAnnotationAdapter(this.daa)); + this.columnAdapter = new ElementAnnotationAdapter(this.annotatedElement, SourceColumnAnnotation.buildAttributeOverrideAnnotationAdapter(this.daa)); } public String getAnnotationName() { @@ -56,7 +56,7 @@ public final class SourceAttributeOverrideAnnotation public void initialize(CompilationUnit astRoot) { super.initialize(astRoot); if (this.columnAdapter.getAnnotation(astRoot) != null) { - this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.member, this.daa); + this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.annotatedElement, this.daa); this.column.initialize(astRoot); } } @@ -91,7 +91,7 @@ public final class SourceAttributeOverrideAnnotation if (this.column != null) { throw new IllegalStateException("'column' element already exists: " + this.column); //$NON-NLS-1$ } - this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.member, this.daa); + this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.annotatedElement, this.daa); this.column.newAnnotation(); return this.column; } @@ -109,7 +109,7 @@ public final class SourceAttributeOverrideAnnotation this.syncColumn_(null); } else { if (this.column == null) { - NestableColumnAnnotation col = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.member, this.daa); + NestableColumnAnnotation col = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.annotatedElement, this.daa); col.initialize(astRoot); this.syncColumn_(col); } else { @@ -142,12 +142,12 @@ public final class SourceAttributeOverrideAnnotation // ********** static methods ********** public static SourceAttributeOverrideAnnotation buildAttributeOverride(JavaResourceNode parent, Member member) { - return new SourceAttributeOverrideAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); + return new SourceAttributeOverrideAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); } static SourceAttributeOverrideAnnotation buildNestedAttributeOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa); return new SourceAttributeOverrideAnnotation(parent, member, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java index 21eb002c3d..b0e1f4d74f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java @@ -94,7 +94,7 @@ public final class SourceAttributeOverridesAnnotation } private NestableAttributeOverrideAnnotation buildAttributeOverride(int index) { - return SourceAttributeOverrideAnnotation.buildNestedAttributeOverride(this, this.member, index, this.daa); + return SourceAttributeOverrideAnnotation.buildNestedAttributeOverride(this, this.annotatedElement, index, this.daa); } public NestableAttributeOverrideAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java index 2dab34af2d..2ce59879c6 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java @@ -10,7 +10,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter; import org.eclipse.jpt.core.resource.java.BaseColumnAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.NestableAnnotation; @@ -51,7 +51,7 @@ public abstract class SourceBaseColumnAnnotation protected SourceBaseColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + this(parent, member, daa, new ElementAnnotationAdapter(member, daa)); } protected SourceBaseColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java index cd14ba5636..5d877ff49e 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.resource.java.EnumType; import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; @@ -37,7 +37,7 @@ public abstract class SourceBaseEnumeratedAnnotation protected SourceBaseEnumeratedAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) { super(parent, attribute, daa); this.valueDeclarationAdapter = new EnumDeclarationAnnotationElementAdapter(daa, getValueElementName(), false); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter); } public void initialize(CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java index 63e1dc52b4..86a70da607 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java @@ -10,8 +10,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter; import org.eclipse.jpt.core.resource.java.BaseJoinColumnAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.NestableAnnotation; @@ -44,11 +44,11 @@ public abstract class SourceBaseJoinColumnAnnotation } protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + this(parent, member, daa, new ElementAnnotationAdapter(member, daa)); } protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) { - this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa)); + this(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa)); } @Override diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java index 33c866bca1..2327e06502 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java @@ -15,7 +15,7 @@ import java.util.Vector; import org.eclipse.jdt.core.dom.Annotation; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.resource.java.AnnotationContainer; import org.eclipse.jpt.core.resource.java.BaseNamedQueryAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; @@ -78,7 +78,7 @@ abstract class SourceBaseNamedQueryAnnotation * convenience method */ protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } @Override diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java index 237510866e..2416e19c97 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java @@ -14,8 +14,8 @@ import java.util.Vector; import org.eclipse.jdt.core.dom.Annotation; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter; import org.eclipse.jpt.core.resource.java.AnnotationContainer; import org.eclipse.jpt.core.resource.java.BaseTableAnnotation; @@ -63,7 +63,7 @@ public abstract class SourceBaseTableAnnotation protected SourceBaseTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + this(parent, member, daa, new ElementAnnotationAdapter(member, daa)); } protected SourceBaseTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { @@ -77,7 +77,7 @@ public abstract class SourceBaseTableAnnotation } private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } public void initialize(CompilationUnit astRoot) { @@ -259,7 +259,7 @@ public abstract class SourceBaseTableAnnotation } NestableUniqueConstraintAnnotation buildUniqueConstraint(int index) { - return new SourceUniqueConstraintAnnotation(this, this.member, buildUniqueConstraintAnnotationAdapter(index)); + return new SourceUniqueConstraintAnnotation(this, this.annotatedElement, buildUniqueConstraintAnnotationAdapter(index)); } IndexedDeclarationAnnotationAdapter buildUniqueConstraintAnnotationAdapter(int index) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java index 4845d65307..2995571ae0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.TemporalAnnotation; import org.eclipse.jpt.core.resource.java.TemporalType; @@ -38,7 +38,7 @@ public abstract class SourceBaseTemporalAnnotation protected SourceBaseTemporalAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) { super(parent, attribute, daa); this.valueDeclarationAdapter = new EnumDeclarationAnnotationElementAdapter(daa, getValueElementName()); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter); } public void initialize(CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java index fe6151673c..f2bf083063 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java @@ -13,7 +13,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter; 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.MemberAnnotationElementAdapter; +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.BasicAnnotation; import org.eclipse.jpt.core.resource.java.FetchType; @@ -45,8 +45,8 @@ public final class SourceBasicAnnotation public SourceBasicAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.optionalAdapter = new MemberAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER); - this.fetchAdapter = new MemberAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER); + this.optionalAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER); + this.fetchAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java index e600666f3e..8bb0374ca0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.DiscriminatorColumnAnnotation; import org.eclipse.jpt.core.resource.java.DiscriminatorType; @@ -43,7 +43,7 @@ public final class SourceDiscriminatorColumnAnnotation public SourceDiscriminatorColumnAnnotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.discriminatorTypeAdapter = new MemberAnnotationElementAdapter<String>(type, DISCRIMINATOR_TYPE_ADAPTER); + this.discriminatorTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, DISCRIMINATOR_TYPE_ADAPTER); this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH); this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java index 17f63b8238..df25fe7c7c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.DiscriminatorValueAnnotation; import org.eclipse.jpt.core.resource.java.JPA; @@ -38,7 +38,7 @@ public final class SourceDiscriminatorValueAnnotation public SourceDiscriminatorValueAnnotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java index 8aa53f278a..5d360990c7 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.EntityAnnotation; import org.eclipse.jpt.core.resource.java.JPA; @@ -38,7 +38,7 @@ public final class SourceEntityAnnotation public SourceEntityAnnotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.nameAdapter = new MemberAnnotationElementAdapter<String>(this.member, NAME_ADAPTER); + this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, NAME_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java index 75b8b9fe5f..94bf3142ca 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java @@ -12,7 +12,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; 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.MemberAnnotationElementAdapter; +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.GeneratedValueAnnotation; import org.eclipse.jpt.core.resource.java.GenerationType; @@ -45,8 +45,8 @@ public final class SourceGeneratedValueAnnotation public SourceGeneratedValueAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.strategyAdapter = new MemberAnnotationElementAdapter<String>(attribute, STRATEGY_ADAPTER); - this.generatorAdapter = new MemberAnnotationElementAdapter<String>(attribute, GENERATOR_ADAPTER); + this.strategyAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, STRATEGY_ADAPTER); + this.generatorAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, GENERATOR_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java index 7e2d84fe78..ef415a7e50 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter; import org.eclipse.jpt.core.resource.java.GeneratorAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; @@ -53,11 +53,11 @@ abstract class SourceGeneratorAnnotation } protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } protected AnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationElementAdapter<Integer> daea) { - return new MemberAnnotationElementAdapter<Integer>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<Integer>(this.annotatedElement, daea); } public void initialize(CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java index 1160907e68..485eff8b71 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java @@ -12,7 +12,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.ASTTools; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.IdClassAnnotation; @@ -42,7 +42,7 @@ public final class SourceIdClassAnnotation public SourceIdClassAnnotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java index e08d9abdd4..da5d8429e3 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.InheritanceAnnotation; import org.eclipse.jpt.core.resource.java.InheritanceType; @@ -39,7 +39,7 @@ public final class SourceInheritanceAnnotation public SourceInheritanceAnnotation(JavaResourcePersistentType parent, Type type) { super(parent, type, DECLARATION_ANNOTATION_ADAPTER); - this.strategyAdapter = new MemberAnnotationElementAdapter<String>(type, STRATEGY_ADAPTER); + this.strategyAdapter = new AnnotatedElementAnnotationElementAdapter<String>(type, STRATEGY_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java index d1c8e0d657..f040d96de5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * 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. @@ -9,8 +9,8 @@ ******************************************************************************/ package org.eclipse.jpt.core.internal.resource.java.source; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.resource.java.JPA; @@ -37,11 +37,11 @@ public final class SourceJoinColumnAnnotation } public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + this(parent, member, daa, new ElementAnnotationAdapter(member, daa)); } public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) { - this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa)); + this(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa)); } public String getAnnotationName() { @@ -105,7 +105,7 @@ public final class SourceJoinColumnAnnotation static SourceJoinColumnAnnotation createNestedJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter joinColumnsAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa); return new SourceJoinColumnAnnotation(parent, member, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java index 81335c57d3..ab52ca0f56 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java @@ -93,7 +93,7 @@ public final class SourceJoinColumnsAnnotation } private NestableJoinColumnAnnotation buildJoinColumn(int index) { - return SourceJoinColumnAnnotation.createNestedJoinColumn(this, this.member, index, this.daa); + return SourceJoinColumnAnnotation.createNestedJoinColumn(this, this.annotatedElement, index, this.daa); } public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java index 66bc641d8f..219b32fa1f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java @@ -144,7 +144,7 @@ public final class SourceJoinTableAnnotation } private NestableJoinColumnAnnotation buildJoinColumn(int index) { - return new SourceJoinColumnAnnotation(this, this.member, buildJoinColumnAnnotationAdapter(index)); + return new SourceJoinColumnAnnotation(this, this.annotatedElement, buildJoinColumnAnnotationAdapter(index)); } private IndexedDeclarationAnnotationAdapter buildJoinColumnAnnotationAdapter(int index) { @@ -214,7 +214,7 @@ public final class SourceJoinTableAnnotation } private NestableJoinColumnAnnotation buildInverseJoinColumn(int index) { - return new SourceJoinColumnAnnotation(this, this.member, buildInverseJoinColumnAnnotationAdapter(index)); + return new SourceJoinColumnAnnotation(this, this.annotatedElement, buildInverseJoinColumnAnnotationAdapter(index)); } private IndexedDeclarationAnnotationAdapter buildInverseJoinColumnAnnotationAdapter(int index) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java index 24a3087ad8..daa721257c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.JPA; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; @@ -38,7 +38,7 @@ public final class SourceMapKeyAnnotation public SourceMapKeyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.nameAdapter = new MemberAnnotationElementAdapter<String>(attribute, NAME_ADAPTER); + this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, NAME_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java index b168201eae..8806402301 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java @@ -12,8 +12,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation; @@ -45,7 +45,7 @@ public abstract class SourceNamedColumnAnnotation protected SourceNamedColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + this(parent, member, daa, new ElementAnnotationAdapter(member, daa)); } protected SourceNamedColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { @@ -69,15 +69,15 @@ public abstract class SourceNamedColumnAnnotation } AnnotationElementAdapter<String> buildShortCircuitElementAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } protected AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) { - return new MemberAnnotationElementAdapter<Boolean>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea); } protected AnnotationElementAdapter<Integer> buildShortCircuitIntegerElementAdapter(DeclarationAnnotationElementAdapter<Integer> daea) { - return new MemberAnnotationElementAdapter<Integer>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<Integer>(this.annotatedElement, daea); } AnnotationElementAdapter<String> buildShortCircuitStringElementAdapter(String elementName) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java index fba3361720..c12fdef5b5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java @@ -94,7 +94,7 @@ public final class SourceNamedNativeQueriesAnnotation } private NestableNamedNativeQueryAnnotation buildNamedNativeQuery(int index) { - return SourceNamedNativeQueryAnnotation.createNestedNamedNativeQuery(this, this.member, index, this.daa); + return SourceNamedNativeQueryAnnotation.createNestedNamedNativeQuery(this, this.annotatedElement, index, this.daa); } public NestableNamedNativeQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java index b3d3483af7..2418e05a4c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java @@ -12,8 +12,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.ASTTools; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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; @@ -100,7 +100,7 @@ public final class SourceNamedNativeQueryAnnotation @Override NestableQueryHintAnnotation buildHint(int index) { - return SourceQueryHintAnnotation.createNamedNativeQueryQueryHint(this, this.member, this.daa, index); + return SourceQueryHintAnnotation.createNamedNativeQueryQueryHint(this, this.annotatedElement, this.daa, index); } @@ -196,12 +196,12 @@ public final class SourceNamedNativeQueryAnnotation // ********** static methods ********** public static SourceNamedNativeQueryAnnotation createNamedNativeQuery(JavaResourceNode parent, Type type) { - return new SourceNamedNativeQueryAnnotation(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER)); + return new SourceNamedNativeQueryAnnotation(parent, type, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER)); } static SourceNamedNativeQueryAnnotation createNestedNamedNativeQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(type, idaa); return new SourceNamedNativeQueryAnnotation(parent, type, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java index 451da89edd..4d73fa4732 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java @@ -25,6 +25,6 @@ public final class SourceNamedQueries1_0Annotation @Override protected NestableNamedQueryAnnotation buildNamedQuery(int index) { - return SourceNamedQueryAnnotation.createNestedNamedQuery(this, member, index, this.daa); + return SourceNamedQueryAnnotation.createNestedNamedQuery(this, this.annotatedElement, index, this.daa); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java index 01c8053f22..9c178a1cc4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java @@ -10,8 +10,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceNamedQuery1_0Annotation; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.resource.java.JPA; @@ -35,7 +35,7 @@ public abstract class SourceNamedQueryAnnotation // ********** constructors ********** public SourceNamedQueryAnnotation(JavaResourceNode parent, Type type) { - super(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER)); + super(parent, type, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER)); } public SourceNamedQueryAnnotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { @@ -66,7 +66,7 @@ public abstract class SourceNamedQueryAnnotation @Override NestableQueryHintAnnotation buildHint(int index) { - return SourceQueryHintAnnotation.createNamedQueryQueryHint(this, this.member, this.daa, index); + return SourceQueryHintAnnotation.createNamedQueryQueryHint(this, this.annotatedElement, this.daa, index); } @@ -74,7 +74,7 @@ public abstract class SourceNamedQueryAnnotation static SourceNamedQueryAnnotation createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(type, idaa); return new SourceNamedQuery1_0Annotation(parent, type, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java index 08c060a41d..8f146b5eea 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +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.JPA; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute; @@ -38,7 +38,7 @@ public final class SourceOrderByAnnotation public SourceOrderByAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) { super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER); - this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER); } public String getAnnotationName() { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java index dbb5b89a7c..c9f26ce48b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java @@ -11,7 +11,7 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.NestableAnnotation; import org.eclipse.jpt.core.resource.java.OverrideAnnotation; @@ -42,7 +42,7 @@ abstract class SourceOverrideAnnotation SourceOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { super(parent, member, daa, annotationAdapter); this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getNameElementName(), false); // false = do not remove annotation when empty - this.nameAdapter = new MemberAnnotationElementAdapter<String>(this.member, this.nameDeclarationAdapter); + this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.nameDeclarationAdapter); } public void initialize(CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java index 99852e1d54..6868e2c2e2 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java @@ -161,7 +161,7 @@ final class SourcePersistentAttribute @Override Annotation buildAnnotation(String annotationName) { - return this.getAnnotationProvider().buildAttributeAnnotation(this, this.member, annotationName); + return this.getAnnotationProvider().buildAttributeAnnotation(this, this.annotatedElement, annotationName); } Annotation buildNullAnnotation_(String annotationName) { @@ -169,14 +169,14 @@ final class SourcePersistentAttribute } public boolean isFor(MethodSignature signature, int occurrence) { - return ((MethodAttribute) this.member).matches(signature, occurrence); + return ((MethodAttribute) this.annotatedElement).matches(signature, occurrence); } // ******** JavaResourcePersistentAttribute implementation ******** public String getName() { - return this.member.getAttributeName(); + return this.annotatedElement.getAttributeName(); } @Override @@ -185,7 +185,7 @@ final class SourcePersistentAttribute } public boolean isField() { - return this.member.isField(); + return this.annotatedElement.isField(); } public boolean isProperty() { @@ -215,7 +215,7 @@ final class SourcePersistentAttribute } private ITypeBinding getTypeBinding(CompilationUnit astRoot) { - return this.member.getTypeBinding(astRoot); + return this.annotatedElement.getTypeBinding(astRoot); } @@ -234,7 +234,7 @@ final class SourcePersistentAttribute * zero seems like a reasonable default... */ private int buildModifiers(CompilationUnit astRoot) { - IBinding binding = this.member.getBinding(astRoot); + IBinding binding = this.annotatedElement.getBinding(astRoot); return (binding == null) ? 0 : binding.getModifiers(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java index 8c18ed9a4c..bcfe6a851e 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java @@ -10,48 +10,24 @@ package org.eclipse.jpt.core.internal.resource.java.source; import java.util.ArrayList; -import java.util.HashSet; import java.util.Iterator; -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.BodyDeclaration; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.IBinding; -import org.eclipse.jdt.core.dom.MarkerAnnotation; import org.eclipse.jdt.core.dom.Modifier; -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.resource.java.Annotation; -import org.eclipse.jpt.core.resource.java.ContainerAnnotation; import org.eclipse.jpt.core.resource.java.JavaResourceNode; import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember; -import org.eclipse.jpt.core.resource.java.NestableAnnotation; -import org.eclipse.jpt.core.utility.TextRange; import org.eclipse.jpt.core.utility.jdt.Member; import org.eclipse.jpt.utility.internal.CollectionTools; -import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable; -import org.eclipse.jpt.utility.internal.iterators.EmptyIterator; import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; -import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator; /** * Java source persistent member (annotations, "persistable") */ abstract class SourcePersistentMember<M extends Member> - extends SourceNode + extends SourceAnnotatedElement<M> implements JavaResourcePersistentMember { - final M member; - - /** - * annotations; no duplicates (java compiler has an error for duplicates) - */ - final Vector<Annotation> annotations = new Vector<Annotation>(); boolean persistable; @@ -61,217 +37,28 @@ abstract class SourcePersistentMember<M extends Member> // ********** construction/initialization ********** SourcePersistentMember(JavaResourceNode parent, M member) { - super(parent); - this.member = member; + super(parent, member); } + @Override public void initialize(CompilationUnit astRoot) { - this.member.getBodyDeclaration(astRoot).accept(this.buildInitialAnnotationVisitor(astRoot)); + super.initialize(astRoot); this.persistable = this.buildPersistable(astRoot); - IBinding binding = this.member.getBinding(astRoot); + IBinding binding = this.annotatedElement.getBinding(astRoot); this.final_ = this.buildFinal(binding); } - private ASTVisitor buildInitialAnnotationVisitor(CompilationUnit astRoot) { - return new InitialAnnotationVisitor(astRoot, this.member.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); - } - } - } - + @Override public void synchronizeWith(CompilationUnit astRoot) { - this.syncAnnotations(astRoot); + super.synchronizeWith(astRoot); this.syncPersistable(this.buildPersistable(astRoot)); - IBinding binding = this.member.getBinding(astRoot); + IBinding binding = this.annotatedElement.getBinding(astRoot); this.syncFinal(this.buildFinal(binding)); } // ********** annotations ********** - public Iterator<Annotation> annotations() { - return this.getAnnotations().iterator(); - } - - Iterable<Annotation> getAnnotations() { - return new LiveCloneIterable<Annotation>(this.annotations); - } - - public int annotationsSize() { - 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 Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) { - ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName); - if (containerAnnotation != null) { - return containerAnnotation.getNestedAnnotations().iterator(); - } - NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName); - if (nestableAnnotation != null) { - return new SingleElementIterator<NestableAnnotation>(nestableAnnotation); - } - return EmptyIterator.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); - } - public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) { ArrayList<String> annotationNames = new ArrayList<String>(); CollectionTools.addAll(annotationNames, supportingAnnotationNames); @@ -295,74 +82,6 @@ abstract class SourcePersistentMember<M extends Member> return newPrimaryAnnotation; } - private boolean annotationIsValid(String annotationName) { - return CollectionTools.contains(this.validAnnotationNames(), annotationName); - } - - abstract Iterator<String> validAnnotationNames(); - - abstract Annotation buildAnnotation(String mappingAnnotationName); - - 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.member.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.member.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); - } - } - // ********** persistable ********** @@ -377,7 +96,7 @@ abstract class SourcePersistentMember<M extends Member> } private boolean buildPersistable(CompilationUnit astRoot) { - return this.member.isPersistable(astRoot); + return this.annotatedElement.isPersistable(astRoot); } // ***** final @@ -398,43 +117,14 @@ abstract class SourcePersistentMember<M extends Member> // ********** miscellaneous ********** - public boolean isAnnotated() { - return ! this.annotations.isEmpty(); - } - public boolean isFor(String memberName, int occurrence) { - return this.member.matches(memberName, occurrence); - } - - public TextRange getTextRange(CompilationUnit astRoot) { - return this.fullTextRange(astRoot); - } - - private TextRange fullTextRange(CompilationUnit astRoot) { - return this.buildTextRange(this.member.getBodyDeclaration(astRoot)); - } - - public TextRange getNameTextRange(CompilationUnit astRoot) { - return this.member.getNameTextRange(astRoot); + return this.annotatedElement.matches(memberName, occurrence); } public void resolveTypes(CompilationUnit astRoot) { this.syncPersistable(this.buildPersistable(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); - } - /** * convenience method */ @@ -446,85 +136,4 @@ abstract class SourcePersistentMember<M extends Member> } }; } - - - // ********** AST visitors ********** - - /** - * annotation visitor - */ - protected static abstract class AnnotationVisitor - extends ASTVisitor - { - protected final CompilationUnit astRoot; - protected final BodyDeclaration bodyDeclaration; - - protected AnnotationVisitor(CompilationUnit astRoot, BodyDeclaration bodyDeclaration) { - super(); - this.astRoot = astRoot; - this.bodyDeclaration = bodyDeclaration; - } - - @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.bodyDeclaration) { - 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, BodyDeclaration bodyDeclaration) { - super(astRoot, bodyDeclaration); - } - - @Override - protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) { - SourcePersistentMember.this.addInitialAnnotation(node, this.astRoot); - } - } - - - /** - * synchronize annotation visitor - */ - protected class SynchronizeAnnotationVisitor - extends AnnotationVisitor - { - protected final Set<Annotation> annotationsToRemove; - - protected SynchronizeAnnotationVisitor(CompilationUnit astRoot, BodyDeclaration bodyDeclaration, Set<Annotation> annotationsToRemove) { - super(astRoot, bodyDeclaration); - this.annotationsToRemove = annotationsToRemove; - } - - @Override - protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) { - SourcePersistentMember.this.addOrSyncAnnotation(node, this.astRoot, this.annotationsToRemove); - } - } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java index 3dccfd2ff7..138da40533 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java @@ -149,7 +149,7 @@ final class SourcePersistentType @Override public void initialize(CompilationUnit astRoot) { super.initialize(astRoot); - ITypeBinding binding = this.member.getBinding(astRoot); + ITypeBinding binding = this.annotatedElement.getBinding(astRoot); this.name = this.buildName(binding); this.qualifiedName = this.buildQualifiedName(binding); this.packageName = this.buildPackageName(binding); @@ -176,12 +176,12 @@ final class SourcePersistentType void addInitialAnnotation(String jdtAnnotationName, CompilationUnit astRoot) { if (jdtAnnotationName.equals(STATIC_METAMODEL_ANNOTATION_DEFINITION.getAnnotationName())) { if (this.staticMetamodelAnnotation == null) { // ignore duplicates - this.staticMetamodelAnnotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.member); + this.staticMetamodelAnnotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.annotatedElement); this.staticMetamodelAnnotation.initialize(astRoot); } } else if (jdtAnnotationName.equals(GENERATED_ANNOTATION_DEFINITION.getAnnotationName())) { if (this.generatedAnnotation == null) { // ignore duplicates - this.generatedAnnotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.member); + this.generatedAnnotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.annotatedElement); this.generatedAnnotation.initialize(astRoot); } } else { @@ -195,7 +195,7 @@ final class SourcePersistentType @Override public void synchronizeWith(CompilationUnit astRoot) { super.synchronizeWith(astRoot); - ITypeBinding binding = this.member.getBinding(astRoot); + ITypeBinding binding = this.annotatedElement.getBinding(astRoot); this.syncName(this.buildName(binding)); this.syncQualifiedName(this.buildQualifiedName(binding)); this.syncPackageName(this.buildPackageName(binding)); @@ -221,7 +221,7 @@ final class SourcePersistentType * because we also have to handle removing these annotations separately. */ private void syncMetamodelAnnotations(CompilationUnit astRoot) { - ITypeBinding binding = this.member.getBinding(astRoot); + ITypeBinding binding = this.annotatedElement.getBinding(astRoot); this.syncStaticMetamodelAnnotation(astRoot, binding); this.syncGeneratedAnnotation(astRoot, binding); } @@ -232,7 +232,7 @@ final class SourcePersistentType this.staticMetamodelAnnotation.synchronizeWith(astRoot); } else { - StaticMetamodelAnnotation newStaticMetamodelAnnotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.member); + StaticMetamodelAnnotation newStaticMetamodelAnnotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.annotatedElement); newStaticMetamodelAnnotation.initialize(astRoot); this.setStaticMetamodelAnnotation(newStaticMetamodelAnnotation); } @@ -248,7 +248,7 @@ final class SourcePersistentType this.generatedAnnotation.synchronizeWith(astRoot); } else { - GeneratedAnnotation newGeneratedAnnotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.member); + GeneratedAnnotation newGeneratedAnnotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.annotatedElement); newGeneratedAnnotation.initialize(astRoot); this.setGeneratedAnnotation(newGeneratedAnnotation); } @@ -284,8 +284,8 @@ final class SourcePersistentType } @Override - Annotation buildAnnotation(String mappingAnnotationName) { - return this.getAnnotationProvider().buildTypeAnnotation(this, this.member, mappingAnnotationName); + Annotation buildAnnotation(String annotationName) { + return this.getAnnotationProvider().buildTypeAnnotation(this, this.annotatedElement, annotationName); } @Override @@ -297,7 +297,7 @@ final class SourcePersistentType public void resolveTypes(CompilationUnit astRoot) { super.resolveTypes(astRoot); - this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(this.member.getBinding(astRoot))); + this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(this.annotatedElement.getBinding(astRoot))); for (JavaResourcePersistentAttribute field : this.getFields()) { field.resolveTypes(astRoot); @@ -601,7 +601,7 @@ final class SourcePersistentType } private void initializeTypes(CompilationUnit astRoot) { - TypeDeclaration[] typeDeclarations = this.member.getTypes(astRoot); + TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot); CounterMap counters = new CounterMap(typeDeclarations.length); for (TypeDeclaration td : typeDeclarations) { String tdName = td.getName().getFullyQualifiedName(); @@ -611,7 +611,7 @@ final class SourcePersistentType } private void syncTypes(CompilationUnit astRoot) { - TypeDeclaration[] typeDeclarations = this.member.getTypes(astRoot); + TypeDeclaration[] typeDeclarations = this.annotatedElement.getTypes(astRoot); CounterMap counters = new CounterMap(typeDeclarations.length); HashSet<JavaResourcePersistentType> typesToRemove = new HashSet<JavaResourcePersistentType>(this.types); for (TypeDeclaration typeDeclaration : typeDeclarations) { @@ -630,7 +630,7 @@ final class SourcePersistentType } private JavaResourcePersistentType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) { - return newInstance(this.getJavaResourceCompilationUnit(), this.member, nestedTypeDeclaration, occurrence, astRoot); + return newInstance(this.getJavaResourceCompilationUnit(), this.annotatedElement, nestedTypeDeclaration, occurrence, astRoot); } @@ -675,7 +675,7 @@ final class SourcePersistentType } private void initializeFields(CompilationUnit astRoot) { - FieldDeclaration[] fieldDeclarations = this.member.getFields(astRoot); + FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot); CounterMap counters = new CounterMap(fieldDeclarations.length); for (FieldDeclaration fieldDeclaration : fieldDeclarations) { for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) { @@ -687,7 +687,7 @@ final class SourcePersistentType } private void syncFields(CompilationUnit astRoot) { - FieldDeclaration[] fieldDeclarations = this.member.getFields(astRoot); + FieldDeclaration[] fieldDeclarations = this.annotatedElement.getFields(astRoot); CounterMap counters = new CounterMap(fieldDeclarations.length); HashSet<JavaResourcePersistentAttribute> fieldsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.fields); for (FieldDeclaration fieldDeclaration : fieldDeclarations) { @@ -708,7 +708,7 @@ final class SourcePersistentType } private JavaResourcePersistentAttribute buildField(String fieldName, int occurrence, CompilationUnit astRoot) { - return SourcePersistentAttribute.newInstance(this, this.member, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot); + return SourcePersistentAttribute.newInstance(this, this.annotatedElement, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot); } // minimize scope of suppressed warnings @@ -759,7 +759,7 @@ final class SourcePersistentType } private void initializeMethods(CompilationUnit astRoot) { - MethodDeclaration[] methodDeclarations = this.member.getMethods(astRoot); + MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot); CounterMap counters = new CounterMap(methodDeclarations.length); for (MethodDeclaration methodDeclaration : methodDeclarations) { MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration); @@ -769,7 +769,7 @@ final class SourcePersistentType } private void syncMethods(CompilationUnit astRoot) { - MethodDeclaration[] methodDeclarations = this.member.getMethods(astRoot); + MethodDeclaration[] methodDeclarations = this.annotatedElement.getMethods(astRoot); CounterMap counters = new CounterMap(methodDeclarations.length); HashSet<JavaResourcePersistentAttribute> methodsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.methods); for (MethodDeclaration methodDeclaration : methodDeclarations) { @@ -788,7 +788,7 @@ final class SourcePersistentType } private JavaResourcePersistentAttribute buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) { - return SourcePersistentAttribute.newInstance(this, this.member, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot); + return SourcePersistentAttribute.newInstance(this, this.annotatedElement, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java index 65c7b71eca..592ed040af 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java @@ -10,8 +10,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.resource.java.JPA; @@ -49,11 +49,11 @@ public final class SourcePrimaryKeyJoinColumnAnnotation } public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) { - this(parent, member, daa, new MemberAnnotationAdapter(member, daa)); + this(parent, member, daa, new ElementAnnotationAdapter(member, daa)); } public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) { - this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa)); + this(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa)); } public String getAnnotationName() { @@ -145,7 +145,7 @@ public final class SourcePrimaryKeyJoinColumnAnnotation static SourcePrimaryKeyJoinColumnAnnotation createNestedPrimaryKeyJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, pkJoinColumnsAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa); return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java index e687955999..d98f7ffec0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java @@ -94,7 +94,7 @@ public final class SourcePrimaryKeyJoinColumnsAnnotation } private NestablePrimaryKeyJoinColumnAnnotation buildPrimaryKeyJoinColumn(int index) { - return SourcePrimaryKeyJoinColumnAnnotation.createNestedPrimaryKeyJoinColumn(this, this.member, index, this.daa); + return SourcePrimaryKeyJoinColumnAnnotation.createNestedPrimaryKeyJoinColumn(this, this.annotatedElement, index, this.daa); } public NestablePrimaryKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java index 4b5718b105..4bc6fcd8b8 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java @@ -11,8 +11,8 @@ package org.eclipse.jpt.core.internal.resource.java.source; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter; import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter; import org.eclipse.jpt.core.resource.java.JPA; import org.eclipse.jpt.core.resource.java.JavaResourceNode; @@ -44,7 +44,7 @@ public final class SourceQueryHintAnnotation public SourceQueryHintAnnotation(JavaResourceNode parent, Type type, IndexedDeclarationAnnotationAdapter idaa) { - super(parent, type, idaa, new MemberIndexedAnnotationAdapter(type, idaa)); + super(parent, type, idaa, new ElementIndexedAnnotationAdapter(type, idaa)); this.nameDeclarationAdapter = this.buildNameAdapter(idaa); this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter); this.valueDeclarationAdapter = this.buildValueAdapter(idaa); @@ -56,7 +56,7 @@ public final class SourceQueryHintAnnotation } private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter adapter) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java index 7877b36f0b..099b5e5e60 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java @@ -14,7 +14,7 @@ import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotation import org.eclipse.jpt.core.internal.utility.jdt.EnumArrayDeclarationAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.ASTTools; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter; import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation; import org.eclipse.jpt.core.resource.java.CascadeType; @@ -61,15 +61,15 @@ abstract class SourceRelationshipMappingAnnotation this.fetchDeclarationAdapter = this.getFetchAdapter(); this.fetchAdapter = this.buildAnnotationElementAdapter(this.fetchDeclarationAdapter); this.cascadeDeclarationAdapter = this.getCascadeAdapter(); - this.cascadeAdapter = new MemberAnnotationElementAdapter<String[]>(attribute, this.cascadeDeclarationAdapter); + this.cascadeAdapter = new AnnotatedElementAnnotationElementAdapter<String[]>(attribute, this.cascadeDeclarationAdapter); } protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) { - return new MemberAnnotationElementAdapter<String>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, daea); } protected AnnotationElementAdapter<Boolean> buildBooleanAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) { - return new MemberAnnotationElementAdapter<Boolean>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<Boolean>(this.annotatedElement, daea); } public void initialize(CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java index b7cf02e2ec..8ffda243dc 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java @@ -15,8 +15,8 @@ import java.util.Vector; import org.eclipse.jdt.core.dom.Annotation; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +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.resource.java.AnnotationContainer; @@ -140,7 +140,7 @@ public final class SourceSecondaryTableAnnotation } private NestablePrimaryKeyJoinColumnAnnotation buildPrimaryKeyJoinColumn(int index) { - return SourcePrimaryKeyJoinColumnAnnotation.createSecondaryTablePrimaryKeyJoinColumn(this.daa, this, this.member, index); + return SourcePrimaryKeyJoinColumnAnnotation.createSecondaryTablePrimaryKeyJoinColumn(this.daa, this, this.annotatedElement, index); } void pkJoinColumnAdded(int index, NestablePrimaryKeyJoinColumnAnnotation joinColumn) { @@ -192,12 +192,12 @@ public final class SourceSecondaryTableAnnotation // ********** static methods ********** public static SourceSecondaryTableAnnotation createSecondaryTable(JavaResourceNode parent, Member member) { - return new SourceSecondaryTableAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); + return new SourceSecondaryTableAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new ElementAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER)); } static SourceSecondaryTableAnnotation createNestedSecondaryTable(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter secondaryTablesAdapter) { IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, secondaryTablesAdapter); - IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa); + IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa); return new SourceSecondaryTableAnnotation(parent, member, idaa, annotationAdapter); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java index 4729ee7537..203e3a6cb5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java @@ -94,7 +94,7 @@ public final class SourceSecondaryTablesAnnotation } private NestableSecondaryTableAnnotation buildSecondaryTable(int index) { - return SourceSecondaryTableAnnotation.createNestedSecondaryTable(this, this.member, index, this.daa); + return SourceSecondaryTableAnnotation.createNestedSecondaryTable(this, this.annotatedElement, index, this.daa); } public NestableSecondaryTableAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java index fe519ded24..fa90f87b59 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java @@ -358,7 +358,7 @@ public final class SourceTableGeneratorAnnotation } NestableUniqueConstraintAnnotation buildUniqueConstraint(int index) { - return new SourceUniqueConstraintAnnotation(this, this.member, buildUniqueConstraintAnnotationAdapter(index)); + return new SourceUniqueConstraintAnnotation(this, this.annotatedElement, buildUniqueConstraintAnnotationAdapter(index)); } IndexedDeclarationAnnotationAdapter buildUniqueConstraintAnnotationAdapter(int index) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java index 474d351479..4429e169a5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java @@ -16,8 +16,8 @@ import java.util.Vector; import org.eclipse.jdt.core.dom.CompilationUnit; 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.MemberAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; +import org.eclipse.jpt.core.internal.utility.jdt.ElementIndexedAnnotationAdapter; import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.core.resource.java.JPA; import org.eclipse.jpt.core.resource.java.JavaResourceNode; @@ -49,7 +49,7 @@ public final class SourceUniqueConstraintAnnotation public SourceUniqueConstraintAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa)); + super(parent, member, idaa, new ElementIndexedAnnotationAdapter(member, idaa)); this.columnNamesDeclarationAdapter = buildArrayAnnotationElementAdapter(idaa, JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES); this.columnNamesAdapter = this.buildAnnotationElementAdapter(this.columnNamesDeclarationAdapter); } @@ -59,7 +59,7 @@ public final class SourceUniqueConstraintAnnotation } private AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) { - return new MemberAnnotationElementAdapter<String[]>(this.member, daea); + return new AnnotatedElementAnnotationElementAdapter<String[]>(this.annotatedElement, daea); } private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java index 09631dee2e..f68d59d8ba 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Oracle. All rights reserved. + * Copyright (c) 2006, 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. @@ -12,25 +12,25 @@ package org.eclipse.jpt.core.internal.utility.jdt; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.Annotation; import org.eclipse.jdt.core.dom.CompilationUnit; +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.Member; import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.utility.internal.StringTools; /** - * Adapt a member and a declaration annotation adapter. + * Adapt an annotated element and a declaration annotation adapter. */ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { - private final Member member; + private final AnnotatedElement annotatedElement; private final DeclarationAnnotationAdapter daa; // ********** constructor ********** - public AbstractAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) { + public AbstractAnnotationAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) { super(); - this.member = member; + this.annotatedElement = annotatedElement; this.daa = daa; } @@ -38,7 +38,7 @@ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { // ********** AnnotationAdapter implementation ********** public Annotation getAnnotation(CompilationUnit astRoot) { - return this.daa.getAnnotation(this.member.getModifiedDeclaration(astRoot)); + return this.daa.getAnnotation(this.annotatedElement.getModifiedDeclaration(astRoot)); } public void newMarkerAnnotation() { @@ -58,7 +58,7 @@ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { } public ASTNode getAstNode(CompilationUnit astRoot) { - return this.daa.getAstNode(this.member.getModifiedDeclaration(astRoot)); + return this.daa.getAstNode(this.annotatedElement.getModifiedDeclaration(astRoot)); } @Override @@ -69,33 +69,33 @@ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { // ********** internal methods ********** - protected void edit(Member.Editor editor) { - this.member.edit(editor); + protected void edit(AnnotatedElement.Editor editor) { + this.annotatedElement.edit(editor); } // ********** factory methods ********** - protected Member.Editor buildNewMarkerAnnotationEditor() { + protected AnnotatedElement.Editor buildNewMarkerAnnotationEditor() { return new NewMarkerAnnotationEditor(this.daa); } - protected Member.Editor buildNewSingleMemberAnnotationEditor() { + protected AnnotatedElement.Editor buildNewSingleMemberAnnotationEditor() { return new NewSingleMemberAnnotationEditor(this.daa); } - protected Member.Editor buildNewNormalAnnotationEditor() { + protected AnnotatedElement.Editor buildNewNormalAnnotationEditor() { return new NewNormalAnnotationEditor(this.daa); } - protected Member.Editor buildRemoveAnnotationEditor() { + protected AnnotatedElement.Editor buildRemoveAnnotationEditor() { return new RemoveAnnotationEditor(this.daa); } // ********** member classes ********** - protected static class NewMarkerAnnotationEditor implements Member.Editor { + protected static class NewMarkerAnnotationEditor implements AnnotatedElement.Editor { private final DeclarationAnnotationAdapter daa; NewMarkerAnnotationEditor(DeclarationAnnotationAdapter daa) { @@ -112,7 +112,7 @@ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { } - protected static class NewSingleMemberAnnotationEditor implements Member.Editor { + protected static class NewSingleMemberAnnotationEditor implements AnnotatedElement.Editor { private final DeclarationAnnotationAdapter daa; NewSingleMemberAnnotationEditor(DeclarationAnnotationAdapter daa) { @@ -129,7 +129,7 @@ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { } - protected static class NewNormalAnnotationEditor implements Member.Editor { + protected static class NewNormalAnnotationEditor implements AnnotatedElement.Editor { private final DeclarationAnnotationAdapter daa; NewNormalAnnotationEditor(DeclarationAnnotationAdapter daa) { @@ -146,7 +146,7 @@ public abstract class AbstractAnnotationAdapter implements AnnotationAdapter { } - protected static class RemoveAnnotationEditor implements Member.Editor { + protected static class RemoveAnnotationEditor implements AnnotatedElement.Editor { private final DeclarationAnnotationAdapter daa; RemoveAnnotationEditor(DeclarationAnnotationAdapter daa) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AnnotatedElementAnnotationElementAdapter.java index 89f854f2e5..5c7872d5d0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AnnotatedElementAnnotationElementAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Oracle. All rights reserved. + * Copyright (c) 2006, 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. @@ -12,27 +12,27 @@ package org.eclipse.jpt.core.internal.utility.jdt; 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.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.utility.internal.StringTools; /** - * Adapt a member and a declaration annotation element adapter. + * Adapt an annotated element and a declaration annotation element adapter. */ -public class MemberAnnotationElementAdapter<T> +public class AnnotatedElementAnnotationElementAdapter<T> implements AnnotationElementAdapter<T> { - private final Member member; + private final AnnotatedElement annotatedElement; private final DeclarationAnnotationElementAdapter<T> daea; // ********** constructor ********** - public MemberAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T> daea) { + public AnnotatedElementAnnotationElementAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationElementAdapter<T> daea) { super(); - this.member = member; + this.annotatedElement = annotatedElement; this.daea = daea; } @@ -40,11 +40,11 @@ public class MemberAnnotationElementAdapter<T> // ********** AnnotationElementAdapter implementation ********** public T getValue() { - return this.daea.getValue(this.member.getModifiedDeclaration()); + return this.daea.getValue(this.annotatedElement.getModifiedDeclaration()); } public T getValue(CompilationUnit astRoot) { - return this.daea.getValue(this.member.getModifiedDeclaration(astRoot)); + return this.daea.getValue(this.annotatedElement.getModifiedDeclaration(astRoot)); } public void setValue(T value) { @@ -52,11 +52,11 @@ public class MemberAnnotationElementAdapter<T> } public Expression getExpression(CompilationUnit astRoot) { - return this.daea.getExpression(this.member.getModifiedDeclaration(astRoot)); + return this.daea.getExpression(this.annotatedElement.getModifiedDeclaration(astRoot)); } public ASTNode getAstNode(CompilationUnit astRoot) { - return this.daea.getAstNode(this.member.getModifiedDeclaration(astRoot)); + return this.daea.getAstNode(this.annotatedElement.getModifiedDeclaration(astRoot)); } @Override @@ -67,18 +67,18 @@ public class MemberAnnotationElementAdapter<T> // ********** internal methods ********** - protected void edit(Member.Editor editor) { - this.member.edit(editor); + protected void edit(AnnotatedElement.Editor editor) { + this.annotatedElement.edit(editor); } - protected Member.Editor buildSetValueEditor(T value) { + protected AnnotatedElement.Editor buildSetValueEditor(T value) { return new SetValueEditor<T>(value, this.daea); } // ********** member classes ********** - protected static class SetValueEditor<T> implements Member.Editor { + protected static class SetValueEditor<T> implements AnnotatedElement.Editor { private final DeclarationAnnotationElementAdapter<T> daea; private final T value; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ElementAnnotationAdapter.java index 5b92fa57d8..172aef3cf5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationAdapter.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ElementAnnotationAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Oracle. All rights reserved. + * Copyright (c) 2006, 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. @@ -9,19 +9,19 @@ ******************************************************************************/ package org.eclipse.jpt.core.internal.utility.jdt; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; /** - * Adapt a member and a declaration annotation adapter. + * Adapt an annotated element and a declaration annotation adapter. */ -public class MemberAnnotationAdapter extends AbstractAnnotationAdapter { +public class ElementAnnotationAdapter extends AbstractAnnotationAdapter { // ********** constructor ********** - public MemberAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) { - super(member, daa); + public ElementAnnotationAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationAdapter daa) { + super(annotatedElement, daa); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberIndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ElementIndexedAnnotationAdapter.java index aceeb48616..3c025b11a2 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberIndexedAnnotationAdapter.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ElementIndexedAnnotationAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 Oracle. All rights reserved. + * Copyright (c) 2006, 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. @@ -9,16 +9,16 @@ ******************************************************************************/ package org.eclipse.jpt.core.internal.utility.jdt; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter; import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.utility.internal.StringTools; /** - * Adapt a member and an indexed declaration annotation adapter. + * Adapt an annotated element and an indexed declaration annotation adapter. */ -public class MemberIndexedAnnotationAdapter +public class ElementIndexedAnnotationAdapter extends AbstractAnnotationAdapter implements IndexedAnnotationAdapter { @@ -27,8 +27,8 @@ public class MemberIndexedAnnotationAdapter // ********** constructor ********** - public MemberIndexedAnnotationAdapter(Member member, IndexedDeclarationAnnotationAdapter idaa) { - super(member, idaa); + public ElementIndexedAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) { + super(annotatedElement, idaa); this.idaa = idaa; } @@ -46,14 +46,14 @@ public class MemberIndexedAnnotationAdapter // ********** factory methods ********** - protected Member.Editor buildMoveAnnotationEditor(int newIndex) { + protected AnnotatedElement.Editor buildMoveAnnotationEditor(int newIndex) { return new MoveAnnotationEditor(this.idaa, newIndex); } // ********** member classes ********** - protected static class MoveAnnotationEditor implements Member.Editor { + protected static class MoveAnnotationEditor implements AnnotatedElement.Editor { private final IndexedDeclarationAnnotationAdapter idaa; private int index; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAnnotatedElement.java new file mode 100644 index 0000000000..ef68d8e893 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAnnotatedElement.java @@ -0,0 +1,204 @@ +/******************************************************************************* + * 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.core.internal.utility.jdt; + +import org.eclipse.core.filebuffers.FileBuffers; +import org.eclipse.core.filebuffers.ITextFileBuffer; +import org.eclipse.core.filebuffers.LocationKind; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.Document; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter; +import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; +import org.eclipse.jpt.utility.Command; +import org.eclipse.jpt.utility.CommandExecutor; +import org.eclipse.jpt.utility.internal.StringTools; +import org.eclipse.text.edits.MalformedTreeException; +import org.eclipse.text.edits.TextEdit; + +/** + * Adapt and extend a JDT member with simplified annotation handling. + */ +public abstract class JDTAnnotatedElement + implements AnnotatedElement +{ + + /** the annotated element's name (duh) */ + private final String name; + + /** + * the compilation unit (file) containing the annotated element; + * used for building an AST when we modify the annotated element + */ + private final ICompilationUnit compilationUnit; + + /** + * this allows clients to provide a way to modify the compilation unit + * (file) when it is open in an editor and should be modified on the UI + * thread + */ + private final CommandExecutor modifySharedDocumentCommandExecutor; + + /** this will format the annotated element's annotations a bit */ + private final AnnotationEditFormatter annotationEditFormatter; + + + // ********** constructors ********** + + protected JDTAnnotatedElement( + String name, + ICompilationUnit compilationUnit, + CommandExecutor modifySharedDocumentCommandExecutor) { + this(name, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance()); + } + + protected JDTAnnotatedElement( + String name, + ICompilationUnit compilationUnit, + CommandExecutor modifySharedDocumentCommandExecutor, + AnnotationEditFormatter annotationEditFormatter) { + super(); + this.name = name; + this.compilationUnit = compilationUnit; + this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor; + this.annotationEditFormatter = annotationEditFormatter; + } + + + // ********** Member implementation ********** + + public abstract ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot); + + public ModifiedDeclaration getModifiedDeclaration() { + return this.getModifiedDeclaration(this.buildASTRoot()); + } + + @Override + public String toString() { + return StringTools.buildToStringFor(this, this.name); + } + + + // ********** internal ********** + + protected String getName_() { + return this.name; + } + + + // ********** editing ********** + + /** + * Edit the member with the specified editor. + * The editor will be invoked once the member's compilation unit + * is in an editable state. + */ + public void edit(Editor editor) { + try { + this.edit_(editor); + } catch (JavaModelException ex) { + throw new RuntimeException(ex); + } catch (BadLocationException ex) { + throw new RuntimeException(ex); + } + } + + /** + * NB: Be careful changing this method. + * Things to look out for: + * - when editing via the JavaEditor there is no need to create a working copy + * - when editing without an editor or via a simple text editor, a "working copy" must be created. + * (at least as far as I can tell ~kfm) + * - sharedDocument is only ever false in tests (headless mode). In the UI, even if the file + * is not open in an editor, sharedDocument is still true (buffer is not null) + * - if a working copy is created, then we must discard it + */ + protected void edit_(Editor editor) throws JavaModelException, BadLocationException { + boolean createWorkingCopy = ! this.compilationUnit.isWorkingCopy(); + if (createWorkingCopy) { + this.compilationUnit.becomeWorkingCopy(null); + } + + ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(this.compilationUnit.getResource().getFullPath(), LocationKind.NORMALIZE); + boolean sharedDocument = (buffer != null); // documents are typically shared when they are already open in an editor + IDocument doc = sharedDocument ? + buffer.getDocument() : + new Document(this.compilationUnit.getBuffer().getContents()); + + try { + CompilationUnit astRoot = this.buildASTRoot(); + astRoot.recordModifications(); + + editor.edit(this.getModifiedDeclaration(astRoot)); + + TextEdit edits = astRoot.rewrite(doc, this.compilationUnit.getJavaProject().getOptions(true)); + if (sharedDocument) { + this.modifySharedDocumentCommandExecutor.execute(new ModifySharedDocumentCommand(edits, doc)); + } else { + this.applyEdits(edits, doc); + } + } + finally { + if (createWorkingCopy) { + //discardWorkingCopy must be called every time becomeWorkingCopy is called. + this.compilationUnit.getBuffer().setContents(doc.get()); + this.compilationUnit.commitWorkingCopy(true, null); // true="force" + this.compilationUnit.discardWorkingCopy(); + } + } + } + + /** + * apply the specified edits to the specified document, + * reformatting the document if necessary + */ + protected void applyEdits(TextEdit edits, IDocument doc) throws MalformedTreeException, BadLocationException { + edits.apply(doc, TextEdit.UPDATE_REGIONS); + this.annotationEditFormatter.format(doc, edits); + } + + protected CompilationUnit buildASTRoot() { + return ASTTools.buildASTRoot(this.compilationUnit); + } + + + // ********** modify shared document command class ********** + + /** + * simple command that calls back to the member to apply the edits + * in the same way as if the document were not shared + */ + protected class ModifySharedDocumentCommand implements Command { + private final TextEdit edits; + private final IDocument doc; + + protected ModifySharedDocumentCommand(TextEdit edits, IDocument doc) { + super(); + this.edits = edits; + this.doc = doc; + } + + public void execute() { + try { + JDTAnnotatedElement.this.applyEdits(this.edits, this.doc); + } catch (MalformedTreeException ex) { + throw new RuntimeException(ex); + } catch (BadLocationException ex) { + throw new RuntimeException(ex); + } + } + + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java index 1c18f297cb..a349ef2666 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 Oracle. All rights reserved. + * Copyright (c) 2005, 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. @@ -10,7 +10,6 @@ package org.eclipse.jpt.core.internal.utility.jdt; import java.util.List; - import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.CompilationUnit; @@ -21,6 +20,7 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jpt.core.utility.TextRange; import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter; import org.eclipse.jpt.core.utility.jdt.FieldAttribute; +import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.core.utility.jdt.Type; import org.eclipse.jpt.utility.CommandExecutor; @@ -64,6 +64,10 @@ public class JDTFieldAttribute // ********** Member/Attribute/FieldAttribute implementation ********** + @Override + public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) { + return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot)); + } public IVariableBinding getBinding(CompilationUnit astRoot) { return this.getFragment(astRoot).resolveBinding(); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java index c7c5ebbdb6..a250509ee6 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java @@ -9,59 +9,28 @@ ******************************************************************************/ package org.eclipse.jpt.core.internal.utility.jdt; -import org.eclipse.core.filebuffers.FileBuffers; -import org.eclipse.core.filebuffers.ITextFileBuffer; -import org.eclipse.core.filebuffers.LocationKind; import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter; import org.eclipse.jpt.core.utility.jdt.Member; -import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.core.utility.jdt.Type; -import org.eclipse.jpt.utility.Command; import org.eclipse.jpt.utility.CommandExecutor; -import org.eclipse.jpt.utility.internal.StringTools; -import org.eclipse.text.edits.MalformedTreeException; -import org.eclipse.text.edits.TextEdit; /** * Adapt and extend a JDT member with simplified annotation handling. */ -public abstract class JDTMember +public abstract class JDTMember extends JDTAnnotatedElement implements Member { + /** this will be null for the primary type */ private final Type declaringType; - /** the member's name (duh) */ - private final String name; - /** * members can occur more than once in non-compiling source; * count starts at 1; the primary type will have occurrence 1 */ private final int occurrence; - /** - * the compilation unit (file) containing the member; - * used for building an AST when we modify the member - */ - private final ICompilationUnit compilationUnit; - - /** - * this allows clients to provide a way to modify the compilation unit - * (file) when it is open in an editor and should be modified on the UI - * thread - */ - private final CommandExecutor modifySharedDocumentCommandExecutor; - - /** this will format the member's annotations a bit */ - private final AnnotationEditFormatter annotationEditFormatter; - // ********** constructors ********** @@ -81,42 +50,21 @@ public abstract class JDTMember ICompilationUnit compilationUnit, CommandExecutor modifySharedDocumentCommandExecutor, AnnotationEditFormatter annotationEditFormatter) { - super(); + super(name, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter); this.declaringType = declaringType; - this.name = name; this.occurrence = occurrence; - this.compilationUnit = compilationUnit; - this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor; - this.annotationEditFormatter = annotationEditFormatter; } // ********** Member implementation ********** - public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) { - return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot)); - } - - public ModifiedDeclaration getModifiedDeclaration() { - return this.getModifiedDeclaration(this.buildASTRoot()); - } - public boolean matches(String memberName, int occur) { - return memberName.equals(this.name) && (occur == this.occurrence); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.name); + return memberName.equals(this.getName_()) && (occur == this.occurrence); } // ********** internal ********** - protected String getName_() { - return this.name; - } - protected int getOccurrence() { return this.occurrence; } @@ -128,109 +76,4 @@ public abstract class JDTMember return this.declaringType; } - - // ********** editing ********** - - /** - * Edit the member with the specified editor. - * The editor will be invoked once the member's compilation unit - * is in an editable state. - */ - public void edit(Editor editor) { - try { - this.edit_(editor); - } catch (JavaModelException ex) { - throw new RuntimeException(ex); - } catch (BadLocationException ex) { - throw new RuntimeException(ex); - } - } - - /** - * NB: Be careful changing this method. - * Things to look out for: - * - when editing via the JavaEditor there is no need to create a working copy - * - when editing without an editor or via a simple text editor, a "working copy" must be created. - * (at least as far as I can tell ~kfm) - * - sharedDocument is only ever false in tests (headless mode). In the UI, even if the file - * is not open in an editor, sharedDocument is still true (buffer is not null) - * - if a working copy is created, then we must discard it - */ - protected void edit_(Editor editor) throws JavaModelException, BadLocationException { - boolean createWorkingCopy = ! this.compilationUnit.isWorkingCopy(); - if (createWorkingCopy) { - this.compilationUnit.becomeWorkingCopy(null); - } - - ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(this.compilationUnit.getResource().getFullPath(), LocationKind.NORMALIZE); - boolean sharedDocument = (buffer != null); // documents are typically shared when they are already open in an editor - IDocument doc = sharedDocument ? - buffer.getDocument() : - new Document(this.compilationUnit.getBuffer().getContents()); - - try { - CompilationUnit astRoot = this.buildASTRoot(); - astRoot.recordModifications(); - - editor.edit(this.getModifiedDeclaration(astRoot)); - - TextEdit edits = astRoot.rewrite(doc, this.compilationUnit.getJavaProject().getOptions(true)); - if (sharedDocument) { - this.modifySharedDocumentCommandExecutor.execute(new ModifySharedDocumentCommand(edits, doc)); - } else { - this.applyEdits(edits, doc); - } - } - finally { - if (createWorkingCopy) { - //discardWorkingCopy must be called every time becomeWorkingCopy is called. - this.compilationUnit.getBuffer().setContents(doc.get()); - this.compilationUnit.commitWorkingCopy(true, null); // true="force" - this.compilationUnit.discardWorkingCopy(); - } - } - } - - /** - * apply the specified edits to the specified document, - * reformatting the document if necessary - */ - protected void applyEdits(TextEdit edits, IDocument doc) throws MalformedTreeException, BadLocationException { - edits.apply(doc, TextEdit.UPDATE_REGIONS); - this.annotationEditFormatter.format(doc, edits); - } - - protected CompilationUnit buildASTRoot() { - return ASTTools.buildASTRoot(this.compilationUnit); - } - - - // ********** modify shared document command class ********** - - /** - * simple command that calls back to the member to apply the edits - * in the same way as if the document were not shared - */ - protected class ModifySharedDocumentCommand implements Command { - private final TextEdit edits; - private final IDocument doc; - - protected ModifySharedDocumentCommand(TextEdit edits, IDocument doc) { - super(); - this.edits = edits; - this.doc = doc; - } - - public void execute() { - try { - JDTMember.this.applyEdits(this.edits, this.doc); - } catch (MalformedTreeException ex) { - throw new RuntimeException(ex); - } catch (BadLocationException ex) { - throw new RuntimeException(ex); - } - } - - } - } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java index 4316d6c198..7319389aa0 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java @@ -11,7 +11,6 @@ package org.eclipse.jpt.core.internal.utility.jdt; import java.util.Arrays; import java.util.List; - import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.IMethodBinding; @@ -21,6 +20,7 @@ import org.eclipse.jdt.core.dom.SingleVariableDeclaration; import org.eclipse.jpt.core.utility.TextRange; import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter; import org.eclipse.jpt.core.utility.jdt.MethodAttribute; +import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.core.utility.jdt.Type; import org.eclipse.jpt.utility.CommandExecutor; import org.eclipse.jpt.utility.JavaType; @@ -96,7 +96,11 @@ public class JDTMethodAttribute // ********** Member/Attribute/MethodAttribute implementation ********** - + @Override + public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) { + return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot)); + } + public IMethodBinding getBinding(CompilationUnit astRoot) { return this.getBodyDeclaration(astRoot).resolveBinding(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java index 96f2c739e7..ace750d340 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java @@ -12,7 +12,6 @@ package org.eclipse.jpt.core.internal.utility.jdt; import java.util.Iterator; import java.util.List; import java.util.ListIterator; - import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; @@ -24,6 +23,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.IExtendedModifier; import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jdt.core.dom.ImportDeclaration; +import org.eclipse.jdt.core.dom.PackageDeclaration; import org.eclipse.jdt.core.dom.SingleVariableDeclaration; import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; @@ -53,6 +53,10 @@ public class JDTModifiedDeclaration public JDTModifiedDeclaration(BodyDeclaration declaration) { this(new BodyDeclarationAdapter(declaration)); } + + public JDTModifiedDeclaration(PackageDeclaration declaration) { + this(new PackageDeclarationAdapter(declaration)); + } public JDTModifiedDeclaration(SingleVariableDeclaration declaration) { this(new SingleVariableDeclarationAdapter(declaration)); @@ -476,6 +480,49 @@ public class JDTModifiedDeclaration return StringTools.buildToStringFor(this, this.declaration.toString()); } } + + public static class PackageDeclarationAdapter implements Adapter { + private final PackageDeclaration declaration; + public PackageDeclarationAdapter(PackageDeclaration declaration) { + super(); + this.declaration = declaration; + } + public ASTNode getDeclaration() { + return this.declaration; + } + @SuppressWarnings("unchecked") + public List<IExtendedModifier> getModifiers() { + return this.declaration.annotations(); + } + @Override + public String toString() { + return StringTools.buildToStringFor(this, this.declaration.toString()); + } + } + + /*public static class ASTNodeAdapter implements Adapter { + private final ASTNode declaration; + public ASTNodeAdapter(ASTNode declaration) { + super(); + this.declaration = declaration; + } + public ASTNode getDeclaration() { + return this.declaration; + } + @SuppressWarnings("unchecked") + public List<IExtendedModifier> getModifiers() { + if (declaration instanceof BodyDeclaration) { + return ((BodyDeclaration) declaration).modifiers(); + } else if (declaration instanceof PackageDeclaration) { + return ((PackageDeclaration) declaration).annotations(); + } + return Collections.emptyList(); + } + @Override + public String toString() { + return StringTools.buildToStringFor(this, this.declaration.toString()); + } + }*/ public static class SingleVariableDeclarationAdapter implements Adapter { private final SingleVariableDeclaration declaration; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java index f3438cfe8f..95b6a82210 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java @@ -10,7 +10,6 @@ package org.eclipse.jpt.core.internal.utility.jdt; import java.util.List; - import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; @@ -21,6 +20,7 @@ import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jpt.core.utility.TextRange; import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter; +import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration; import org.eclipse.jpt.core.utility.jdt.Type; import org.eclipse.jpt.utility.CommandExecutor; @@ -87,7 +87,11 @@ public class JDTType // ********** Member/Type implementation ********** - + @Override + public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) { + return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot)); + } + public ITypeBinding getBinding(CompilationUnit astRoot) { TypeDeclaration td = this.getBodyDeclaration(astRoot); return (td == null) ? null : td.resolveBinding(); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java index 44c27535c8..7560f54ca3 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 Oracle. All rights reserved. + * Copyright (c) 2006, 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. @@ -12,9 +12,9 @@ package org.eclipse.jpt.core.internal.utility.jdt; 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.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; import org.eclipse.jpt.utility.internal.StringTools; /** @@ -30,8 +30,8 @@ public class ShortCircuitAnnotationElementAdapter<T> // ********** constructor ********** - public ShortCircuitAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T> daea) { - this(new MemberAnnotationElementAdapter<T>(member, daea)); + public ShortCircuitAnnotationElementAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationElementAdapter<T> daea) { + this(new AnnotatedElementAnnotationElementAdapter<T>(annotatedElement, daea)); } public ShortCircuitAnnotationElementAdapter(AnnotationElementAdapter<T> adapter) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java index 01952fe059..5eff405a48 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 Oracle. All rights reserved. + * 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. @@ -10,9 +10,9 @@ package org.eclipse.jpt.core.internal.utility.jdt; import java.util.Arrays; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter; import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.utility.jdt.Member; /** * Wrap another annotation element adapter and short-circuit the @@ -24,8 +24,8 @@ public class ShortCircuitArrayAnnotationElementAdapter<T> { // ********** constructor ********** - public ShortCircuitArrayAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T[]> daea) { - super(member, daea); + public ShortCircuitArrayAnnotationElementAdapter(AnnotatedElement annotatedElement, DeclarationAnnotationElementAdapter<T[]> daea) { + super(annotatedElement, daea); } public ShortCircuitArrayAnnotationElementAdapter(AnnotationElementAdapter<T[]> adapter) { diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java index fe2149d80e..46ac4f9213 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java @@ -10,7 +10,7 @@ package org.eclipse.jpt.core.resource.java; import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.core.utility.jdt.Member; +import org.eclipse.jpt.core.utility.jdt.AnnotatedElement; /** * Used to build Annotations discovered in the Java source code. @@ -27,7 +27,7 @@ import org.eclipse.jpt.core.utility.jdt.Member; * 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 + * @version 3.0 * @since 2.0 */ public interface AnnotationDefinition @@ -39,18 +39,18 @@ public interface AnnotationDefinition String getAnnotationName(); /** - * Build and return an annotation for the specified member. + * Build and return an annotation for the specified annotated element. */ - Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member); + Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement); /** * Build and return an annotation for the specified JDT annotation - * on the specified member. + * on the specified annotated element. */ - Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation); + Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation); /** - * Build and return a "null" annotation for the specified member. + * 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. @@ -60,6 +60,6 @@ public interface AnnotationDefinition * new state to it. This reduces the number of null checks in the context * model (hopefully). */ - Annotation buildNullAnnotation(JavaResourcePersistentMember parent); + Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceAnnotatedElement.java new file mode 100644 index 0000000000..81f4c83287 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceAnnotatedElement.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.core.resource.java; + +import java.util.Iterator; +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. + */ + Iterator<Annotation> annotations(); + + /** + * Return the number of annotations. + */ + int annotationsSize(); + + /** + * 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 + Iterator<NestableAnnotation> annotations(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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java index 83adbce63b..e646137fe8 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java @@ -9,9 +9,7 @@ ******************************************************************************/ package org.eclipse.jpt.core.resource.java; -import java.util.Iterator; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.core.utility.TextRange; /** * Java source code or binary persistent member. @@ -22,103 +20,23 @@ import org.eclipse.jpt.core.utility.TextRange; * pioneering adopters on the understanding that any code that uses this API * will almost certainly be broken (repeatedly) as the API evolves. * - * @version 2.3 + * @version 3.0 * @since 2.0 */ public interface JavaResourcePersistentMember - extends JavaResourceNode + extends JavaResourceAnnotatedElement { + // ********** 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. - */ - Iterator<Annotation> annotations(); - - /** - * Return the number of annotations. - */ - int annotationsSize(); - - /** - * 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 - Iterator<NestableAnnotation> annotations(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); - - /** * 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 ********** /** @@ -133,25 +51,14 @@ public interface JavaResourcePersistentMember */ boolean isFinal(); String FINAL_PROPERTY = "final"; //$NON-NLS-1$ - - /** - * Return whether the underlying JDT member is currently annotated with any recognized - * annotations. - */ - boolean isAnnotated(); /** * Return whether the Java resource persistent member is for the specified * member. */ boolean isFor(String memberName, int occurrence); - - /** - * Return the text range for the member's name. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - + + // ********** behavior ********** /** @@ -159,4 +66,5 @@ public interface JavaResourcePersistentMember * in the workspace. */ void resolveTypes(CompilationUnit astRoot); + } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotatedElement.java new file mode 100644 index 0000000000..2dd3d87b00 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotatedElement.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * 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.core.utility.jdt; + +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.IBinding; +import org.eclipse.jpt.core.utility.TextRange; + +/** + * Dali manipulates annotations on elements (packages, types, fields, and methods). + * This interface simplifies those manipulations. + * + * 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. + * + * This interface is not intended to be implemented by clients. + */ +public interface AnnotatedElement { + + /** + * Return the annotated element's body declaration from the specified AST. + * This can be null if the annotated element is no longer present in the AST + * because the source has been changed in another thread. + */ + ASTNode getBodyDeclaration(CompilationUnit astRoot); + + /** + * Return the annotated element's binding from the specified AST. + */ + IBinding getBinding(CompilationUnit astRoot); + + /** + * Return the annotated element's "modified" declaration from the specified AST. + */ + ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot); + + /** + * Return the annotated element's "modified" declaration from a newly-generated AST. + */ + ModifiedDeclaration getModifiedDeclaration(); + + /** + * Return the annotated element's name text range from the specified AST. + */ + TextRange getNameTextRange(CompilationUnit astRoot); + + /** + * Edit the annotated element's declaration using the specified editor. + */ + void edit(Editor editor); + + + // ********** "editor" interface ********** + + /** + * This interface defines a callback that is invoked when the annotated element's + * compilation unit/AST is in a state to be manipulated. + */ + public interface Editor { + + /** + * Edit the specified declaration. Any changes made to the declaration + * will be captured and applied to the annotated element's compilation unit. + */ + void edit(ModifiedDeclaration declaration); + + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java index d36bbf6862..78b1443051 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Oracle. All rights reserved. + * Copyright (c) 2008, 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. @@ -9,10 +9,7 @@ ******************************************************************************/ package org.eclipse.jpt.core.utility.jdt; -import org.eclipse.jdt.core.dom.BodyDeclaration; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.IBinding; -import org.eclipse.jpt.core.utility.TextRange; /** * Dali manipulates annotations on members (types, fields, and methods). @@ -26,29 +23,7 @@ import org.eclipse.jpt.core.utility.TextRange; * * This interface is not intended to be implemented by clients. */ -public interface Member { - - /** - * Return the member's body declaration from the specified AST. - * This can be null if the member is no longer present in the AST - * because the source has been changed in another thread. - */ - BodyDeclaration getBodyDeclaration(CompilationUnit astRoot); - - /** - * Return the member's binding from the specified AST. - */ - IBinding getBinding(CompilationUnit astRoot); - - /** - * Return the member's "modified" declaration from the specified AST. - */ - ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot); - - /** - * Return the member's "modified" declaration from a newly-generated AST. - */ - ModifiedDeclaration getModifiedDeclaration(); +public interface Member extends AnnotatedElement { /** * Return whether the attribute is a persistable field or property getter. @@ -61,31 +36,4 @@ public interface Member { */ boolean matches(String memberName, int occurrence); - /** - * Return the member's name text range from the specified AST. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - /** - * Edit the member's declaration using the specified editor. - */ - void edit(Editor editor); - - - // ********** "editor" interface ********** - - /** - * This interface defines a callback that is invoked when the member's - * compilation unit/AST is in a state to be manipulated. - */ - public interface Editor { - - /** - * Edit the specified declaration. Any changes made to the declaration - * will be captured and applied to the member's compilation unit. - */ - void edit(ModifiedDeclaration declaration); - - } - } |