diff options
author | nhauge | 2008-08-18 15:46:07 +0000 |
---|---|---|
committer | nhauge | 2008-08-18 15:46:07 +0000 |
commit | 0fc02d4b54e725f832b00bef0b47e3d905e9ae13 (patch) | |
tree | 3fc92f27d04dc063e777a93422af4a24bb7aef36 /jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java | |
parent | 51f3e2bf3dfc6d4a7ffc01c0b2dd830a4fedb964 (diff) | |
parent | 6a7ab73ae0d63dfafc02bb15f5d115a8d6f75e86 (diff) | |
download | webtools.dali-200808170000.tar.gz webtools.dali-200808170000.tar.xz webtools.dali-200808170000.zip |
This commit was manufactured by cvs2svn to create tag 'v200808170000'.v200808170000
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java | 99 |
1 files changed, 0 insertions, 99 deletions
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/MemberAnnotationElementAdapter.java deleted file mode 100644 index 89f854f2e5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java +++ /dev/null @@ -1,99 +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.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.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. - */ -public class MemberAnnotationElementAdapter<T> - implements AnnotationElementAdapter<T> -{ - private final Member member; - private final DeclarationAnnotationElementAdapter<T> daea; - - - // ********** constructor ********** - - public MemberAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T> daea) { - super(); - this.member = member; - this.daea = daea; - } - - - // ********** AnnotationElementAdapter implementation ********** - - public T getValue() { - return this.daea.getValue(this.member.getModifiedDeclaration()); - } - - public T getValue(CompilationUnit astRoot) { - return this.daea.getValue(this.member.getModifiedDeclaration(astRoot)); - } - - public void setValue(T value) { - this.edit(this.buildSetValueEditor(value)); - } - - public Expression getExpression(CompilationUnit astRoot) { - return this.daea.getExpression(this.member.getModifiedDeclaration(astRoot)); - } - - public ASTNode getAstNode(CompilationUnit astRoot) { - return this.daea.getAstNode(this.member.getModifiedDeclaration(astRoot)); - } - - @Override - public String toString() { - return StringTools.buildToStringFor(this, this.daea); - } - - - // ********** internal methods ********** - - protected void edit(Member.Editor editor) { - this.member.edit(editor); - } - - protected Member.Editor buildSetValueEditor(T value) { - return new SetValueEditor<T>(value, this.daea); - } - - - // ********** member classes ********** - - protected static class SetValueEditor<T> implements Member.Editor { - private final DeclarationAnnotationElementAdapter<T> daea; - private final T value; - - SetValueEditor(T value, DeclarationAnnotationElementAdapter<T> daea) { - super(); - this.value = value; - this.daea = daea; - } - public void edit(ModifiedDeclaration declaration) { - this.daea.setValue(this.value, declaration); - } - @Override - public String toString() { - return StringTools.buildToStringFor(this); - } - } - -} |