KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > eval > CodeSnippetSuperReference


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.eval;
12
13 import org.eclipse.jdt.internal.compiler.ast.SuperReference;
14 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
15 import org.eclipse.jdt.internal.compiler.lookup.InvocationSite;
16 import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
17 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
18
19 /**
20  * A super reference inside a code snippet denotes a reference to the super type of
21  * the remote receiver object (that is, the receiver of the context in the stack frame). This is
22  * used to report an error through JavaModelException according to the fact that super
23  * reference are not supported in code snippet.
24  */

25 public class CodeSnippetSuperReference extends SuperReference implements EvaluationConstants, InvocationSite {
26     
27 public CodeSnippetSuperReference(int pos, int sourceEnd) {
28     super(pos, sourceEnd);
29 }
30
31 /**
32  * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments()
33  */

34 public TypeBinding[] genericTypeArguments() {
35     return null;
36 }
37
38 public TypeBinding resolveType(BlockScope scope) {
39     scope.problemReporter().cannotUseSuperInCodeSnippet(this.sourceStart, this.sourceEnd);
40     return null;
41 }
42 public boolean isSuperAccess(){
43     return false;
44 }
45 public boolean isTypeAccess(){
46     return false;
47 }
48 public void setActualReceiverType(ReferenceBinding receiverType) {
49     // ignored
50
}
51 public void setDepth(int depth){
52     // ignored
53
}
54 public void setFieldIndex(int index){
55     // ignored
56
}
57
58 }
59
60
Popular Tags