KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > model > JDIClassObjectValue


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.core.model;
12
13  
14 import org.eclipse.jdt.debug.core.IJavaClassObject;
15 import org.eclipse.jdt.debug.core.IJavaType;
16
17 import com.sun.jdi.ClassObjectReference;
18
19 /**
20  * An object on the target VM that is an instance of
21  * <code>java.lang.Class</code>.
22  *
23  * @see IJavaClassObject
24  */

25 public class JDIClassObjectValue extends JDIObjectValue implements IJavaClassObject {
26
27     /**
28      * Constructs a reference to a class object.
29      */

30     public JDIClassObjectValue(JDIDebugTarget target, ClassObjectReference object) {
31         super(target, object);
32     }
33     
34
35     /**
36      * @see IJavaClassObject#getInstanceType()
37      */

38     public IJavaType getInstanceType() {
39         return JDIType.createType((JDIDebugTarget)getDebugTarget(),getUnderlyingClassObject().reflectedType());
40     }
41
42     /**
43      * Returns the underlying class object
44      */

45     protected ClassObjectReference getUnderlyingClassObject() {
46         return (ClassObjectReference)getUnderlyingValue();
47     }
48 }
49
50
Popular Tags