KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > compiler > lookup > MissingBinaryTypeBinding


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.compiler.lookup;
12
13 import org.eclipse.jdt.core.compiler.CharOperation;
14 import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
15 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
16
17 public class MissingBinaryTypeBinding extends BinaryTypeBinding {
18
19 /**
20  * Special constructor for constructing proxies of missing binary types (114349)
21  * @param packageBinding
22  * @param compoundName
23  * @param environment
24  */

25 public MissingBinaryTypeBinding(PackageBinding packageBinding, char[][] compoundName, LookupEnvironment environment) {
26     this.compoundName = compoundName;
27     computeId();
28     this.tagBits |= TagBits.IsBinaryBinding | TagBits.HierarchyHasProblems;
29     this.environment = environment;
30     this.fPackage = packageBinding;
31     this.fileName = CharOperation.concatWith(compoundName, '/');
32     this.sourceName = compoundName[compoundName.length - 1]; // [java][util][Map$Entry]
33
this.modifiers = ClassFileConstants.AccPublic;
34     this.superclass = null; // will be fixed up using #setMissingSuperclass(...)
35
this.superInterfaces = Binding.NO_SUPERINTERFACES;
36     this.typeVariables = Binding.NO_TYPE_VARIABLES;
37     this.memberTypes = Binding.NO_MEMBER_TYPES;
38     this.fields = Binding.NO_FIELDS;
39     this.methods = Binding.NO_METHODS;
40 }
41     
42 /**
43  * Missing binary type will answer <code>false</code> to #isValidBinding()
44  * @see org.eclipse.jdt.internal.compiler.lookup.Binding#problemId()
45  */

46 public int problemId() {
47     return ProblemReasons.NotFound;
48 }
49
50 /**
51  * Only used to fixup the superclass hierarchy of proxy binary types
52  * @param missingSuperclass
53  * @see LookupEnvironment#cacheMissingBinaryType(char[][], CompilationUnitDeclaration)
54  */

55 void setMissingSuperclass(ReferenceBinding missingSuperclass) {
56     this.superclass = missingSuperclass;
57 }
58 }
59
Popular Tags