diff options
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt')
19 files changed, 0 insertions, 988 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java deleted file mode 100644 index 8be7a07d97..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AbstractType.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * 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. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.core.utility.jdt; - -import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.ITypeBinding; - -/** - * AbstractType: 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 AbstractType extends Member { - - /** - * Covariant override. - */ - ITypeBinding getBinding(CompilationUnit astRoot); - - /** - * Covariant override. - */ - AbstractTypeDeclaration getBodyDeclaration(CompilationUnit astRoot); -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java deleted file mode 100644 index 8ce99cf49c..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedElement.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * 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.common.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.common.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 { - - String getName(); - - /** - * 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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java deleted file mode 100644 index c0a3ccc098..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotatedPackage.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributor: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.core.utility.jdt; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.IPackageBinding; -import org.eclipse.jdt.core.dom.PackageDeclaration; - -/** - * @author Dmitry Geraskov - * - * 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 AnnotatedPackage extends AnnotatedElement { - - /** - * Covariant override. - */ - IPackageBinding getBinding(CompilationUnit astRoot); - - /** - * Covariant override. - */ - PackageDeclaration getBodyDeclaration(CompilationUnit astRoot); - -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationAdapter.java deleted file mode 100644 index b0b04c4938..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationEditFormatter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationEditFormatter.java deleted file mode 100644 index 77b3ac0682..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/AnnotationElementAdapter.java deleted file mode 100644 index 3fc6e95434..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java deleted file mode 100644 index cce19d5abc..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Attribute.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.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"). - */ - 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(); - -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationAdapter.java deleted file mode 100644 index 9f93a16ffd..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.java deleted file mode 100644 index 1d5e4ff250..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/DeclarationAnnotationElementAdapter.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.common.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> { - - /** - * Reduce the number of NLS warnings. - */ - String VALUE = "value"; //$NON-NLS-1$ - - /** - * 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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java deleted file mode 100644 index da690b148b..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Enum.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * 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.common.core.utility.jdt; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.EnumConstantDeclaration; -import org.eclipse.jdt.core.dom.EnumDeclaration; - -/** - * Enum: some covariant overrides plus enumConstants - * - * 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 Enum extends AbstractType { - - /** - * Covariant override. - */ - EnumDeclaration getBodyDeclaration(CompilationUnit astRoot); - - /** - * Return the enum's constants - */ - EnumConstantDeclaration[] getEnumConstants(CompilationUnit astRoot); - -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java deleted file mode 100644 index 88693d415a..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/EnumConstant.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * 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.common.core.utility.jdt; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.EnumConstantDeclaration; -import org.eclipse.jdt.core.dom.IVariableBinding; - -/** - * Enum constants are part of Enums - * - * 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 EnumConstant extends Member { - - String getName(); - - /** - * Covariant override. - */ - IVariableBinding getBinding(CompilationUnit astRoot); - - /** - * Covariant override. - */ - EnumConstantDeclaration getBodyDeclaration(CompilationUnit astRoot); - -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ExpressionConverter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ExpressionConverter.java deleted file mode 100644 index c5d7ed10e2..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/FieldAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/FieldAttribute.java deleted file mode 100644 index 4e014ac72b..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedAnnotationAdapter.java deleted file mode 100644 index a55e9cbc77..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java deleted file mode 100644 index 438f21e1e6..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/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.common.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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java deleted file mode 100644 index 8b9f398ea0..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Member.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * 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. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.core.utility.jdt; - -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * 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 extends AnnotatedElement { - - /** - * Return whether the member is persistable. - */ - boolean isPersistable(CompilationUnit astRoot); - - /** - * Return whether the member matches the specified member - * and occurrence. - */ - boolean matches(String memberName, int occurrence); - -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java deleted file mode 100644 index 2eca93d773..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/MethodAttribute.java +++ /dev/null @@ -1,45 +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.common.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.common.utility.MethodSignature; - -/** - * Method 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 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/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java deleted file mode 100644 index 331e5391a0..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/ModifiedDeclaration.java +++ /dev/null @@ -1,105 +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.common.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. - * Return whether the appropriate import was added to or already present in - * the declaration's compilation unit (i.e. the specified class can be - * subsequently referenced using a "short" name). - * Also return true if an import was unnecessary (i.e. the specified class - * is part of the "default" package). - * This does not support adding a "wildcard" import (e.g. "java.util.*"). - */ - boolean addImport(String className); - - /** - * Add the specified static import to the declaration's compilation unit. - * Return whether the appropriate import was added to or already present in - * the declaration's compilation unit (i.e. the specified constant can be - * subsequently referenced using a "short" name). - * Also return true if an import was unnecessary (i.e. the specified enum - * is part of the "default" package). - * This does not support adding a "wildcard" import (e.g. "java.lang.annotation.ElementType.*"). - */ - boolean addStaticImport(String enumConstantName); - - /** - * Add the specified import to the declaration's compilation unit. - * Return whether the appropriate import was added to or already present in - * the declaration's compilation unit (i.e. the specified name can be - * subsequently referenced using a "short" name). - * Also return true if an import was unnecessary (i.e. the specified class - * or enum is part of the "default" package). - * This does not support adding a "wildcard" import (e.g. "java.util.*"). - */ - boolean addImport(String importName, boolean static_); - - /** - * Return whether the specified annotation has the specified - * (fully-qualified) name within the declaration's context; i.e. attempt - * to resolve the annotation's name (using imports etc.) and return - * whether it matches the specified name. - */ - boolean annotationIsNamed(Annotation annotation, String name); - -} diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java deleted file mode 100644 index 5a3a6a5a98..0000000000 --- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/utility/jdt/Type.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * 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. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.core.utility.jdt; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.EnumDeclaration; -import org.eclipse.jdt.core.dom.FieldDeclaration; -import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jdt.core.dom.TypeDeclaration; - -/** - * Type: nestedTypes, nestedEnums, fields, and methods. - * - * 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 AbstractType { - - /** - * 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 nested enums. - */ - EnumDeclaration[] getEnums(CompilationUnit astRoot); - - /** - * Return the type's fields. - */ - FieldDeclaration[] getFields(CompilationUnit astRoot); - - /** - * Return the type's methods. - */ - MethodDeclaration[] getMethods(CompilationUnit astRoot); - -} |