KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > eval > ast > engine > JavaObjectRuntimeContext


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.debug.eval.ast.engine;
12
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.jdt.core.IJavaProject;
16 import org.eclipse.jdt.debug.core.IJavaDebugTarget;
17 import org.eclipse.jdt.debug.core.IJavaObject;
18 import org.eclipse.jdt.debug.core.IJavaReferenceType;
19 import org.eclipse.jdt.debug.core.IJavaThread;
20 import org.eclipse.jdt.debug.core.IJavaVariable;
21
22 public class JavaObjectRuntimeContext extends AbstractRuntimeContext {
23     
24     /**
25      * <code>this</code> object or this context.
26      */

27     private IJavaObject fThisObject;
28     
29     /**
30      * The thread for this context.
31      */

32     private IJavaThread fThread;
33     
34     /**
35      * ObjectValueRuntimeContext constructor.
36      *
37      * @param thisObject <code>this</code> object of this context.
38      * @param javaProject the project for this context.
39      * @param thread the thread for this context.
40      */

41     public JavaObjectRuntimeContext(IJavaObject thisObject, IJavaProject javaProject, IJavaThread thread) {
42         super(javaProject);
43         fThisObject= thisObject;
44         fThread= thread;
45     }
46
47     /**
48      * @see IRuntimeContext#getVM()
49      */

50     public IJavaDebugTarget getVM() {
51         return (IJavaDebugTarget)fThisObject.getDebugTarget();
52     }
53
54     /**
55      * @see IRuntimeContext#getThis()
56      */

57     public IJavaObject getThis() {
58         return fThisObject;
59     }
60
61     /**
62      * @see IRuntimeContext#getReceivingType()
63      */

64     public IJavaReferenceType getReceivingType() throws CoreException {
65         return (IJavaReferenceType)getThis().getJavaType();
66     }
67
68     /**
69      * @see IRuntimeContext#getLocals()
70      */

71     public IJavaVariable[] getLocals() {
72         return new IJavaVariable[0];
73     }
74
75     /**
76      * @see IRuntimeContext#getThread()
77      */

78     public IJavaThread getThread() {
79         return fThread;
80     }
81
82     /**
83      * @see IRuntimeContext#isConstructor()
84      */

85     public boolean isConstructor() {
86         return false;
87     }
88
89 }
90
Popular Tags