KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
14  * Handle representing a source method that is resolved.
15  * The uniqueKey contains the genericSignature of the resolved method. Use BindingKey to decode it.
16  */

17 public class ResolvedSourceMethod extends SourceMethod {
18     
19     private String JavaDoc uniqueKey;
20     
21     /*
22      * See class comments.
23      */

24     public ResolvedSourceMethod(JavaElement parent, String JavaDoc name, String JavaDoc[] parameterTypes, String JavaDoc uniqueKey) {
25         super(parent, name, parameterTypes);
26         this.uniqueKey = uniqueKey;
27     }
28     
29     /* (non-Javadoc)
30      * @see org.eclipse.jdt.internal.core.SourceMethod#getKey()
31      */

32     public String JavaDoc getKey() {
33         return this.uniqueKey;
34     }
35     /* (non-Javadoc)
36      * @see org.eclipse.jdt.core.IMethod#isResolved()
37      */

38     public boolean isResolved() {
39         return true;
40     }
41     
42     /**
43      * @private Debugging purposes
44      */

45     protected void toStringInfo(int tab, StringBuffer JavaDoc buffer, Object JavaDoc info, boolean showResolvedInfo) {
46         super.toStringInfo(tab, buffer, info, showResolvedInfo);
47         if (showResolvedInfo) {
48             buffer.append(" {key="); //$NON-NLS-1$
49
buffer.append(this.uniqueKey);
50             buffer.append("}"); //$NON-NLS-1$
51
}
52     }
53
54     public JavaElement unresolved() {
55         SourceRefElement handle = new SourceMethod(this.parent, this.name, this.parameterTypes);
56         handle.occurrenceCount = this.occurrenceCount;
57         return handle;
58     }
59 }
60
Popular Tags