Package org.eclipse.jdt.debug.eval
Interface IClassFileEvaluationEngine
- All Superinterfaces:
IEvaluationEngine
An evaluation engine that performs evaluations by deploying and executing
class files locally.
- Since:
- 2.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
evaluate
(String snippet, IJavaThread thread, IEvaluationListener listener, boolean hitBreakpoints) Asynchronously evaluates the given snippet in the specified target thread, reporting the result back to the given listener.String[]
Returns the import declarations for this evaluation context.void
setImports
(String[] imports) Sets the import declarations for this evaluation context.Methods inherited from interface org.eclipse.jdt.debug.eval.IEvaluationEngine
dispose, evaluate, evaluate, getDebugTarget, getJavaProject
-
Method Details
-
getImports
String[] getImports()Returns the import declarations for this evaluation context. An empty list indicates there are no imports. The syntax for the import corresponds to a fully qualified type name, or to an on-demand package name as defined by ImportDeclaration (JLS2 7.5). For example,"java.util.Hashtable"
or"java.util.*"
.- Returns:
- the list of import names
-
setImports
Sets the import declarations for this evaluation context. An empty list indicates there are no imports. The syntax for the import corresponds to a fully qualified type name, or to an on-demand package name as defined by ImportDeclaration (JLS2 7.5). For example,"java.util.Hashtable"
or"java.util.*"
.- Parameters:
imports
- the list of import names
-
evaluate
void evaluate(String snippet, IJavaThread thread, IEvaluationListener listener, boolean hitBreakpoints) throws org.eclipse.debug.core.DebugException Asynchronously evaluates the given snippet in the specified target thread, reporting the result back to the given listener. The snippet is evaluated in the context of the Java project this evaluation engine was created on. If the snippet is determined to be a valid expression, the expression is evaluated in the specified thread, which resumes its execution from the location at which it is currently suspended. When the evaluation completes, the thread will be suspened at this original location. Compilation and runtime errors are reported in the evaluation result.- Parameters:
snippet
- code snippet to evaluatethread
- the thread in which to run the evaluation, which must be suspendedlistener
- the listener that will receive notification when/if the evalaution completeshitBreakpoints
- whether or not breakpoints should be honored in the evaluation thread during the evaluation. Iffalse
, breakpoints hit in the evaluation thread will be ignored.- Throws:
org.eclipse.debug.core.DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- The specified thread is not currently suspended
- The specified thread is not contained in the debug target associated with this evaluation engine
- The specified thread is suspended in the middle of an evaluation that has not completed. It is not possible to perform nested evaluations
-