diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt')
14 files changed, 0 insertions, 782 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationAdapter.java deleted file mode 100644 index b0920c3816..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationAdapter.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Adapt a Java annotation with a simple-to-use interface. - * - * 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 AnnotationAdapter { - - /** - * Given the specified compilation unit, return the value of the - * adapter's annotation. - * @see #getAnnotation() - */ - Annotation getAnnotation(CompilationUnit astRoot); - - /** - * Build a new marker annotation, replacing the original annotation if present. - */ - void newMarkerAnnotation(); - - /** - * Build a new single member annotation, replacing the original annotation if present. - */ - void newSingleMemberAnnotation(); - - /** - * Build a new normal annotation, replacing the original annotation if present. - */ - void newNormalAnnotation(); - - /** - * Remove the annotation. - */ - void removeAnnotation(); - - /** - * Return the AST node corresponding to the annotation. - * If the annotation is missing, return the annotation's parent node. - * @see #getAstNode() - */ - ASTNode getAstNode(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationEditFormatter.java deleted file mode 100644 index f8c98a3984..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationEditFormatter.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 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.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.text.edits.MalformedTreeException; -import org.eclipse.text.edits.TextEdit; - -/** - * - * 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 AnnotationEditFormatter { - - /** - * Review the specified edits and format the specified document as needed. - */ - void format(IDocument doc, TextEdit editTree) throws MalformedTreeException, BadLocationException; - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationElementAdapter.java deleted file mode 100644 index 2a5d589e49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationElementAdapter.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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.Expression; - -/** - * Adapt a Java annotation element with a simple-to-use interface. - * - * 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 AnnotationElementAdapter<T> { - - /** - * Return the value of the adapter's annotation element. - * Return null if the element is not present. - * If the compilation unit is available, #value(CompilationUnit) - * might be more performant. - * @see #getValue(org.eclipse.jdt.core.dom.CompilationUnit) - */ - T getValue(); - - /** - * Given the specified compilation unit, return the value of the - * adapter's annotation element. - * Return null if the element is not present. - * @see #getValue() - */ - T getValue(CompilationUnit astRoot); - - /** - * Set the value of the adapter's annotation element. - * Setting the value of the element to null will cause - * the element to be removed from its annotation. - */ - void setValue(T value); - - /** - * Given the specified compilation unit, return the expression value of the - * adapter's annotation element. - * Return null if the element is not present. - * @see #getExpression() - */ - Expression getExpression(CompilationUnit astRoot); - - /** - * Return the AST node corresponding to the element. - * If the element is missing, return the annotation's node. - * @see #getAstNode() - */ - ASTNode getAstNode(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java deleted file mode 100644 index c4e917a82c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 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.CompilationUnit; -import org.eclipse.jdt.core.dom.ITypeBinding; - -/** - * Attributes are either represented by fields ('foo') or properties/method - * pairs ('getFoo()'/'setFoo()'). - * - * 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 Attribute extends Member { - - /** - * Return the attribute's name, as opposed to the member's name - * (e.g. "getFoo()" returns "foo"). - */ - // TODO rename to getName()? - String getAttributeName(); - - /** - * Return the type binding for the attribute's declared type, - * as opposed to its declaring type. - */ - ITypeBinding getTypeBinding(CompilationUnit astRoot); - - /** - * Return whether the attribute is a field. - */ - boolean isField(); - - /** - * Return whether the attribute is a property/method pair. - */ - // TODO rename to isProperty()? - boolean isMethod(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationAdapter.java deleted file mode 100644 index 290d389e4f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationAdapter.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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.Annotation; -import org.eclipse.jdt.core.dom.MarkerAnnotation; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jdt.core.dom.SingleMemberAnnotation; - -/** - * Provide clients with a pluggable way to manipulate an - * annotation modifying a "declaration". - * - * TODO specify how multiple annotations with the same name are to be handled - * - * 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 DeclarationAnnotationAdapter { - - /** - * Given the specified declaration, return the annotation. - */ - Annotation getAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, modify it with - * a new marker annotation, replacing the original annotation if present. - * Return the new annotation. - */ - MarkerAnnotation newMarkerAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, modify it with - * a new single member annotation, replacing the original annotation if present. - * Return the new annotation. - */ - SingleMemberAnnotation newSingleMemberAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, modify it with - * a new normal annotation, replacing the original annotation if present. - * Return the new annotation. - */ - NormalAnnotation newNormalAnnotation(ModifiedDeclaration declaration); - - /** - * Remove the annotation from the specified declaration. - */ - void removeAnnotation(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, return the AST node - * corresponding to the annotation. - * If the annotation is missing, return its parent node. - */ - ASTNode getAstNode(ModifiedDeclaration declaration); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationElementAdapter.java deleted file mode 100644 index 47868d6bd8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationElementAdapter.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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.Expression; - -/** - * Provide clients with a pluggable way to manipulate an - * annotation element modifying a "declaration". - * T is the type of the object to be passed to and returned by the adapter. - * - * 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 DeclarationAnnotationElementAdapter<T> { - - /** - * Given the specified declaration, return the value of the - * annotation element. Return null or an empty array - * if the element is not present. - */ - T getValue(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, set the value of the - * annotation element. Setting the value of the element - * to null will cause the element to be removed from its - * annotation. - */ - void setValue(T value, ModifiedDeclaration declaration); - - /** - * Given the specified declaration, return the element's value expression. - * Return null if the element is not present. - */ - Expression getExpression(ModifiedDeclaration declaration); - - /** - * Given the specified declaration, return the AST node - * corresponding to the element's value. - * If the element is missing, return the annotation's node. - */ - ASTNode getAstNode(ModifiedDeclaration declaration); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ExpressionConverter.java deleted file mode 100644 index d21d0c7a37..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ExpressionConverter.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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.AST; -import org.eclipse.jdt.core.dom.Expression; - -/** - * Define the protocol for converting an AST expression back and forth - * from an arbitrary type (e.g. StringLiteral <=> String). - * T is the type of the object to be converted to and from an expression. - * - * 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 ExpressionConverter<T> { - - /** - * Convert the specified object to an - * expression that is owned by the specified AST. - * The type of the object is determined by the - * contract specified by the client. - */ - Expression convert(T object, AST ast); - - /** - * Convert the specified expression to an object of some - * pre-determined type. - */ - T convert(Expression expression); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/FieldAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/FieldAttribute.java deleted file mode 100644 index 4046cf9f49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/FieldAttribute.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 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.CompilationUnit; -import org.eclipse.jdt.core.dom.FieldDeclaration; -import org.eclipse.jdt.core.dom.IVariableBinding; - -/** - * Field attribute: just some covariant overrides. - * - * 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 FieldAttribute extends Attribute { - - /** - * Covariant override. - */ - IVariableBinding getBinding(CompilationUnit astRoot); - - /** - * Covariant override. - */ - FieldDeclaration getBodyDeclaration(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedAnnotationAdapter.java deleted file mode 100644 index ba2209e3cc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedAnnotationAdapter.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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; - - -/** - * Adapt an indexed Java annotation with a simple-to-use interface. - * - * 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 IndexedAnnotationAdapter extends AnnotationAdapter { - - /** - * Return the the index at which the annotation is situated. - */ - int getIndex(); - - /** - * Move the annotation to the specified index, leaving its original - * position cleared out. - */ - void moveAnnotation(int newIndex); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java deleted file mode 100644 index 1336363bd6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 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; - - -/** - * Allow clients to manipulate an annotation within an array of annotations. - * - * Provisional API: This interface is part of an interim API that is still - * under development and expected to change significantly before reaching - * stability. It is available at this early stage to solicit feedback from - * pioneering adopters on the understanding that any code that uses this API - * will almost certainly be broken (repeatedly) as the API evolves. - * - * This interface is not intended to be implemented by clients. - */ -public interface IndexedDeclarationAnnotationAdapter extends DeclarationAnnotationAdapter { - - /** - * Return the the index at which the annotation is situated. - */ - int getIndex(); - - /** - * Move the annotation to the specified index, leaving its original - * position cleared out. - */ - void moveAnnotation(int newIndex, 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 deleted file mode 100644 index d36bbf6862..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 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.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). - * 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 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(); - - /** - * Return whether the attribute is a persistable field or property getter. - */ - boolean isPersistable(CompilationUnit astRoot); - - /** - * Return whether the member matches the specified member - * and occurrence. - */ - 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); - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java deleted file mode 100644 index 4637ab76cf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 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.CompilationUnit; -import org.eclipse.jdt.core.dom.IMethodBinding; -import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jpt.utility.MethodSignature; - -/** - * Property attribute: just some covariant overrides. - * - * 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. - */ -// TODO rename PropertyAttribute? -public interface MethodAttribute extends Attribute { - - /** - * Covariant override. - */ - IMethodBinding getBinding(CompilationUnit astRoot); - - /** - * Covariant override. - */ - MethodDeclaration getBodyDeclaration(CompilationUnit astRoot); - - /** - * This method must be used instead of Member#matches(String, int). - */ - boolean matches(MethodSignature signature, int occurrence); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ModifiedDeclaration.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ModifiedDeclaration.java deleted file mode 100644 index 682b2974e1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ModifiedDeclaration.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 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.AST; -import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.Annotation; - -/** - * Define a wrapper that provides a common protocol for all the various AST - * declarations that have modifiers (i.e. there are a number of AST node - * classes that implement the method #modifiers(), but they do not implement - * a common interface): - * BodyDeclaration - * SingleVariableDeclaration - * VariableDeclarationExpression - * VariableDeclarationStatement - * - * 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 ModifiedDeclaration { - - /** - * Return the "declaration" AST node. - */ - ASTNode getDeclaration(); - - /** - * Return the "declaration" AST. - */ - AST getAst(); - - /** - * Return the *first* annotation with the specified name. - * Return null if the declaration has no such annotation. - */ - Annotation getAnnotationNamed(String annotationName); - - /** - * Remove the *first* annotation with the specified name from the declaration. - */ - void removeAnnotationNamed(String annotationName); - - /** - * Replace the specified old annotation with the specified new annotation. - * If there is no annotation with the specified name, simply add the new - * annotation to the declaration's modifiers. - */ - void replaceAnnotationNamed(String oldAnnotationName, Annotation newAnnotation); - - /** - * Add the specified import to the declaration's compilation unit. - */ - void addImport(String importName); - - /** - * Add the specified static import to the declaration's compilation unit. - */ - void addStaticImport(String importName); - - /** - * Add the specified import to the declaration's compilation unit. - */ - void addImport(String importName, boolean static_); - - /** - * Return whether the specified annotation has the specified name. - */ - boolean annotationIsNamed(Annotation annotation, String name); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.java deleted file mode 100644 index 26726d98a7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 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.CompilationUnit; -import org.eclipse.jdt.core.dom.FieldDeclaration; -import org.eclipse.jdt.core.dom.ITypeBinding; -import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jdt.core.dom.TypeDeclaration; - -/** - * Type: just some covariant overrides. - * - * 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 Type extends Member { - - /** - * Covariant override. - */ - ITypeBinding getBinding(CompilationUnit astRoot); - - /** - * Covariant override. - */ - TypeDeclaration getBodyDeclaration(CompilationUnit astRoot); - - /** - * Return the type's nested types (does not include annotations or enums). - */ - TypeDeclaration[] getTypes(CompilationUnit astRoot); - - /** - * Return the type's fields. - */ - FieldDeclaration[] getFields(CompilationUnit astRoot); - - /** - * Return the type's methods. - */ - MethodDeclaration[] getMethods(CompilationUnit astRoot); - -} |