1 19 20 package org.netbeans.modules.debugger.jpda.expr; 21 22 import com.sun.jdi.StackFrame; 23 24 import java.util.*; 25 26 import org.netbeans.modules.debugger.jpda.JPDADebuggerImpl; 27 28 35 public class EvaluationContext { 36 37 40 private StackFrame frame; 41 private List<String > sourceImports; 42 private List<String > staticImports; 43 private boolean canInvokeMethods; 44 private Runnable methodInvokePreproc; 45 private JPDADebuggerImpl debugger; 46 47 54 public EvaluationContext(StackFrame frame, List<String > imports, List<String > staticImports, 55 boolean canInvokeMethods, Runnable methodInvokePreproc, 56 JPDADebuggerImpl debugger) { 57 if (frame == null) throw new IllegalArgumentException ("Frame argument must not be null"); 58 if (imports == null) throw new IllegalArgumentException ("Imports argument must not be null"); 59 if (staticImports == null) throw new IllegalArgumentException ("Static imports argument must not be null"); 60 this.frame = frame; 61 this.sourceImports = imports; 62 this.staticImports = staticImports; 63 this.canInvokeMethods = canInvokeMethods; 64 this.methodInvokePreproc = methodInvokePreproc; 65 this.debugger = debugger; 66 } 67 68 public List<String > getStaticImports() { 69 return staticImports; 70 } 71 72 public List<String > getImports() { 73 return sourceImports; 74 } 75 76 public StackFrame getFrame() { 77 return frame; 78 } 79 80 public boolean canInvokeMethods() { 81 return canInvokeMethods; 82 } 83 84 void setCanInvokeMethods(boolean canInvokeMethods) { 85 this.canInvokeMethods = canInvokeMethods; 86 } 87 88 void methodToBeInvoked() { 89 if (methodInvokePreproc != null) { 90 methodInvokePreproc.run(); 91 } 92 } 93 94 JPDADebuggerImpl getDebugger() { 95 return debugger; 96 } 97 98 } 99 100 | Popular Tags |