KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > debugger > jpda > ObjectVariable


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.api.debugger.jpda;
21
22
23 /**
24  * Represents instance of some object in debugged JVM. This interface can
25  * be optionally inplemented by a implementation of {@link LocalVariable} or
26  * {@link Field} interfaces.
27  *
28  * <pre style="background-color: rgb(255, 255, 102);">
29  * Since JDI interfaces evolve from one version to another, it's strongly recommended
30  * not to implement this interface in client code. New methods can be added to
31  * this interface at any time to keep up with the JDI functionality.</pre>
32  *
33  * @see LocalVariable
34  * @see Field
35  * @see This
36  * @see Super
37  * @see JPDAThread#getContendedMonitor
38  * @see JPDAThread#getOwnedMonitors
39  *
40  * @author Jan Jancura
41  */

42 public interface ObjectVariable extends Variable {
43
44     /**
45      * Calls {@link java.lang.Object#toString} in debugged JVM and returns
46      * its value.
47      *
48      * @return toString () value of this instance
49      */

50     public abstract String JavaDoc getToStringValue () throws InvalidExpressionException;
51     
52     /**
53      * Calls given method in debugged JVM on this instance and returns
54      * its value.
55      *
56      * @param methodName a name of method to be called
57      * @param signature a signature of method to be called
58      * @param arguments a arguments to be used
59      *
60      * @return value of given method call on this instance
61      */

62     public abstract Variable invokeMethod (
63         String JavaDoc methodName,
64         String JavaDoc signature,
65         Variable[] arguments
66     ) throws NoSuchMethodException JavaDoc, InvalidExpressionException;
67
68     /**
69      * Number of fields defined in this object.
70      *
71      * @return number of fields defined in this object
72      */

73     public abstract int getFieldsCount ();
74
75     /**
76      * Returns field defined in this object.
77      *
78      * @param name a name of field to be returned
79      *
80      * @return field defined in this object
81      */

82     public abstract Field getField (String JavaDoc name);
83
84     /**
85      * Returns non static fields defined in this object.
86      *
87      * @param from the index of first field to be returned
88      * @param to the index of last field, exclusive
89      *
90      * @return fields defined in this object that are greater then or equal to
91      * <code>from</code> index and less then <code>to</code> index.
92      */

93     public abstract Field[] getFields (int from, int to);
94
95     /**
96      * Return all static fields.
97      *
98      * @return all static fields
99      */

100     public abstract Field[] getAllStaticFields (int from, int to);
101
102     /**
103      * Return all inherited fields.
104      *
105      * @return all inherited fields
106      */

107     public abstract Field[] getInheritedFields (int from, int to);
108     
109     /**
110      * Returns representation of super class of this object.
111      *
112      * @return representation of super class of this object
113      */

114     public abstract Super getSuper ();
115 }
116
Popular Tags