001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.debug.core;
011:
012: import org.eclipse.debug.core.DebugException;
013:
014: /**
015: * The class of an object on a Java debug target.
016: * <p>
017: * Clients are not intended to implement this interface.
018: * </p>
019: * @see IJavaValue
020: * @since 2.0
021: */
022: public interface IJavaClassType extends IJavaReferenceType {
023:
024: /**
025: * Returns a new instance of this class by invoking the
026: * constructor with the given signature and arguments in
027: * the specified thread. The given thread is resumed to perform this
028: * method invocation and suspends in its original location when
029: * this method invocation is complete. This method does not return
030: * until the method invocation is complete. Resuming the specified thread
031: * can result in breakpoints being hit, infinite loops, and deadlock.
032: *
033: * @param signature the JNI style signature of the method to be invoked
034: * @param args the arguments of the constructor, which can be
035: * <code>null</code> or empty if there are none
036: * @param thread the thread in which to invoke the constructor
037: * @return the result of invoking the constructor
038: * @exception DebugException if this method fails. Reasons include:<ul>
039: * <li>Failure communicating with the VM. The DebugException's
040: * status code contains the underlying exception responsible for
041: * the failure.</li>
042: * <li>This type does not implement the specified constructor</li>
043: * <li>An exception occurs while invoking the specified constructor</li>
044: * <li>The given thread is already performing a message send,
045: * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
046: * <li>The given thread is not currently suspended
047: * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
048: * <li>The given thread was explicitly suspended
049: * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
050: * </ul>
051: */
052: public IJavaObject newInstance(String signature, IJavaValue[] args,
053: IJavaThread thread) throws DebugException;
054:
055: /**
056: * Returns the result of sending the specified message to this class
057: * with the given arguments in the specified thread (invokes a static
058: * method on this type). The given thread is resumed to perform this
059: * method invocation and suspends in its original location when this
060: * method invocation is complete. This method does not return until the
061: * method invocation is complete. Resuming the specified thread can
062: * result in breakpoints being hit, infinite loops, and deadlock.
063: *
064: * @param selector the selector of the method to be invoked
065: * @param signature the JNI style signature of the method to be invoked
066: * @param args the arguments of the method, which can be
067: * <code>null</code> or empty if there are none
068: * @param thread the thread in which to invoke the method
069: * @return the result of invoking the method
070: * @exception DebugException if this method fails. Reasons include:<ul>
071: * <li>Failure communicating with the VM. The DebugException's
072: * status code contains the underlying exception responsible for
073: * the failure.</li>
074: * <li>This object does not implement the specified method</li>
075: * <li>An exception occurs while invoking the specified method</li>
076: * <li>The given thread is already performing a message send,
077: * (status code <code>IJavaThread.ERR_NESTED_METHOD_INVOCATION</code>)</li>
078: * <li>The given thread is not currently suspended
079: * (status code <code>IJavaThread.ERR_THREAD_NOT_SUSPENDED</code>)</li>
080: * <li>The given thread was explicitly suspended
081: * (status code <code>IJavaThread.ERR_INCOMPATIBLE_THREAD_STATE</code>)</li>
082: * </ul>
083: */
084: public IJavaValue sendMessage(String selector, String signature,
085: IJavaValue[] args, IJavaThread thread)
086: throws DebugException;
087:
088: /**
089: * Returns the superclass of this class type, or <code>null</code>
090: * if no such class exists.
091: *
092: * @return the superclass of this class type, or <code>null</code>
093: * @exception DebugException if this method fails. Reasons include:
094: * <ul><li>Failure communicating with the VM. The DebugException's
095: * status code contains the underlying exception responsible for
096: * the failure.</li>
097: * </ul>
098: */
099: public IJavaClassType getSuperclass() throws DebugException;
100:
101: /**
102: * Returns the interface objects associated with the interfaces this class directly implements.
103: * Only those interfaces declared in the <code>implements</code> clause for this class are included.
104: *
105: * @return the interface objects associated with the interfaces this class directly implements
106: * @exception DebugException if this method fails. Reasons include:
107: * <ul><li>Failure communicating with the VM. The DebugException's
108: * status code contains the underlying exception responsible for
109: * the failure.</li>
110: * </ul>
111: * @since 3.0
112: */
113: public IJavaInterfaceType[] getInterfaces() throws DebugException;
114:
115: /**
116: * Returns the interface objects associated with <em>all</em> interfaces this class implements,
117: * directly or indirectly.
118: *
119: * @return the interface objects associated with the interfaces this class directly implements,
120: * directly or indirectly
121: * @exception DebugException if this method fails. Reasons include:
122: * <ul><li>Failure communicating with the VM. The DebugException's
123: * status code contains the underlying exception responsible for
124: * the failure.</li>
125: * </ul>
126: * @since 3.0
127: */
128: public IJavaInterfaceType[] getAllInterfaces()
129: throws DebugException;
130:
131: /**
132: * Returns whether this type is declared as a type safe enumeration.
133: *
134: * @return <code>true</code> if this type is a type safe enumeration,
135: * <code>false</code> otherwise.
136: * @exception DebugException if this method fails. Reasons include:
137: * <ul><li>Failure communicating with the VM. The DebugException's
138: * status code contains the underlying exception responsible for
139: * the failure.</li>
140: * </ul>
141: * @since 3.1
142: */
143: public boolean isEnum() throws DebugException;
144: }
|