KickJava   Java API By Example, From Geeks To Geeks.

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


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
15 public final class MemberTypeBinding extends NestedTypeBinding {
16 public MemberTypeBinding(char[][] compoundName, ClassScope scope, SourceTypeBinding enclosingType) {
17     super(compoundName, scope, enclosingType);
18     this.tagBits |= TagBits.MemberTypeMask;
19 }
20 void checkSyntheticArgsAndFields() {
21     if (this.isStatic()) return;
22     if (this.isInterface()) return;
23     this.addSyntheticArgumentAndField(this.enclosingType);
24 }
25 /* Answer the receiver's constant pool name.
26 *
27 * NOTE: This method should only be used during/after code gen.
28 */

29
30 public char[] constantPoolName() /* java/lang/Object */ {
31     if (constantPoolName != null)
32         return constantPoolName;
33
34     return constantPoolName = CharOperation.concat(enclosingType().constantPoolName(), sourceName, '$');
35 }
36
37 /**
38  * @see org.eclipse.jdt.internal.compiler.lookup.Binding#initializeDeprecatedAnnotationTagBits()
39  */

40 public void initializeDeprecatedAnnotationTagBits() {
41     if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) {
42         super.initializeDeprecatedAnnotationTagBits();
43         if ((this.tagBits & TagBits.AnnotationDeprecated) == 0) {
44             // check enclosing type
45
ReferenceBinding enclosing;
46             if (((enclosing = this.enclosingType()).tagBits & TagBits.DeprecatedAnnotationResolved) == 0) {
47                 enclosing.initializeDeprecatedAnnotationTagBits();
48             }
49             if (enclosing.isViewedAsDeprecated()) {
50                 this.modifiers |= ExtraCompilerModifiers.AccDeprecatedImplicitly;
51             }
52         }
53     }
54 }
55 public String JavaDoc toString() {
56     return "Member type : " + new String JavaDoc(sourceName()) + " " + super.toString(); //$NON-NLS-2$ //$NON-NLS-1$
57
}
58 }
59
Popular Tags