KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > compiler > base > ast > NotFoundType


1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * This file is part of the compiler and core tools for the AspectJ(tm)
4  * programming language; see http://aspectj.org
5  *
6  * The contents of this file are subject to the Mozilla Public License
7  * Version 1.1 (the "License"); you may not use this file except in
8  * compliance with the License. You may obtain a copy of the License at
9  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is AspectJ.
17  *
18  * The Initial Developer of the Original Code is Xerox Corporation. Portions
19  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
20  * All Rights Reserved.
21  *
22  * Contributor(s):
23  */

24
25 package org.aspectj.compiler.base.ast;
26
27 import java.util.*;
28
29 import org.aspectj.compiler.base.bcg.CodeBuilder;
30 import org.aspectj.compiler.base.*;
31 import java.io.IOException JavaDoc;
32
33 //ASPECT use introduction from crosscuts package
34
import org.aspectj.compiler.crosscuts.ast.*;
35 import org.aspectj.compiler.crosscuts.joinpoints.*;
36
37
38 /**
39  * This Type should never appear in a correct program
40  * It is used to represent types that are not found in order to provide
41  * better error messages as processing continues
42  */

43 public class NotFoundType extends NameType {
44     public NotFoundType(TypeDec notFoundTypeDec) {
45         super(notFoundTypeDec);
46     }
47
48     public boolean isCoercableTo(Type other) {
49         return true;
50     }
51
52     public boolean dominates(Type other) {
53         return false;
54     }
55
56
57     public Expr getClassExpr() {
58         return getAST().makeNull();
59     }
60
61     public Expr makeObject(Expr expr) { return expr; }
62
63     public Expr fromObject(Expr expr) {
64         return getAST().makeCast(this, expr);
65     }
66
67     public Expr getNullExpr() {
68         return getAST().makeNull();
69     }
70
71     public Type getRefType() { return this; }
72
73     public Type getOutermostType() {
74         return this;
75     }
76
77     synchronized public void ensureBuiltTypeGraph() { return; }
78     synchronized public void ensureFinishedSignature() { return; }
79
80     public PointcutSO getPointcut(String JavaDoc id, ASTObject fromWhere, boolean showError) {
81         return null;
82     }
83
84     public Field getField(String JavaDoc id, ASTObject fromWhere, boolean showError) {
85         return null;
86     }
87
88     public Type getInnerType(String JavaDoc id, ASTObject fromWhere, boolean showError) {
89         return getTypeManager().TYPE_NOT_FOUND;
90     }
91
92     public Method getMethod(String JavaDoc id, ASTObject fromWhere, Exprs params, boolean showError) {
93         return null;
94     }
95
96     // currently only used by ReceptionsPointcut and by TypeScope.findMethodLookupType
97
public boolean hasMethodNamed(String JavaDoc id) {
98         return false;
99     }
100
101     public Constructor getConstructor(ASTObject fromWhere, Exprs params, boolean showError) {
102         return null;
103     }
104
105     public SemanticObject findMatchingSemanticObject(SemanticObject o) {
106         return null;
107     }
108
109     public NameType getSuperClassType() {
110         return getTypeManager().TYPE_NOT_FOUND;
111     }
112
113     public Type getDeclaringType() {
114         return getTypeManager().TYPE_NOT_FOUND;
115     }
116
117     //private String prettyString = null;
118
public String JavaDoc getPrettyString() {
119         return "*";
120     }
121
122     private String JavaDoc makeLegalString() {
123         return "*";
124     }
125
126     public String JavaDoc getSourceString() {
127         return "*";
128     }
129
130     public String JavaDoc getExtendedId() {
131         return "*";
132     }
133
134     public String JavaDoc getId() {
135         return "*";
136     }
137
138     public String JavaDoc getExternalName() {
139         return "*";
140     }
141
142     public String JavaDoc getClassName() {
143         return "*";
144     }
145
146     public String JavaDoc getPackageName() {
147         return null;
148     }
149
150     //!!! name should change to getPrettyClassName
151
public String JavaDoc toShortString() {
152         return "*";
153     }
154
155     public String JavaDoc toString() {
156         return "NotFoundType()";
157     }
158
159     public boolean isEquivalent(Type other) {
160         return true;
161     }
162
163     public boolean isMissing() { return true; }
164
165     public boolean isInterface() { return false; }
166     public boolean isClass() { return true; }
167     public boolean isAspect() { return false; }
168
169     public boolean isInnerType() { return false; }
170
171     public boolean isAnonymous() { return false; }
172
173     public boolean isAbstract() { return false; }
174     public boolean isFinal() { return false; }
175
176     public Type getOutermostLexicalType() { return getTypeManager().TYPE_NOT_FOUND; }
177
178     // ------------------------------
179
// Dealing with non-package-level types
180
public boolean isInner() {
181         return false;
182     }
183     public NameType getEnclosingInstanceType() {
184         return getTypeManager().TYPE_NOT_FOUND;
185     }
186
187     public boolean isLocal() {
188         return false;
189     }
190     public CodeDec getEnclosingCodeDec() {
191         return null;
192     }
193
194     public boolean isPackageMember() {
195         return true;
196     }
197     public NameType getEnclosingType() {
198         return getTypeManager().TYPE_NOT_FOUND;
199     }
200 }
201
Popular Tags