KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > ResolvedBinaryType


1 /*******************************************************************************
2  * Copyright (c) 2004, 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.core;
12
13 import org.eclipse.jdt.core.JavaModelException;
14
15 /**
16  * Handle representing a binary type that is resolved.
17  * The uniqueKey contains the genericTypeSignature of the resolved type. Use BindingKey to decode it.
18  */

19 public class ResolvedBinaryType extends BinaryType {
20     
21     private String JavaDoc uniqueKey;
22     
23     /*
24      * See class comments.
25      */

26     public ResolvedBinaryType(JavaElement parent, String JavaDoc name, String JavaDoc uniqueKey) {
27         super(parent, name);
28         this.uniqueKey = uniqueKey;
29     }
30
31     public String JavaDoc getFullyQualifiedParameterizedName() throws JavaModelException {
32         return getFullyQualifiedParameterizedName(getFullyQualifiedName(), this.uniqueKey);
33     }
34     
35     /* (non-Javadoc)
36      * @see org.eclipse.jdt.internal.core.BinaryType#getKey()
37      */

38     public String JavaDoc getKey() {
39         return this.uniqueKey;
40     }
41     
42     /* (non-Javadoc)
43      * @see org.eclipse.jdt.internal.core.BinaryType#isResolved()
44      */

45     public boolean isResolved() {
46         return true;
47     }
48     
49     /**
50      * @private Debugging purposes
51      */

52     protected void toStringInfo(int tab, StringBuffer JavaDoc buffer, Object JavaDoc info, boolean showResolvedInfo) {
53         super.toStringInfo(tab, buffer, info, showResolvedInfo);
54         if (showResolvedInfo) {
55             buffer.append(" {key="); //$NON-NLS-1$
56
buffer.append(this.uniqueKey);
57             buffer.append("}"); //$NON-NLS-1$
58
}
59     }
60     
61     public JavaElement unresolved() {
62         SourceRefElement handle = new BinaryType(this.parent, this.name);
63         handle.occurrenceCount = this.occurrenceCount;
64         return handle;
65     }
66 }
67
Popular Tags