/** Gets the node. * @return the node */ SimpleNode getNode() { if (this.callerInfoNode != null) return this.callerInfoNode; if (this.parent != null) return this.parent.getNode(); else return null; }
/** */ SimpleNode getNode() { if ( callerInfoNode != null ) return callerInfoNode; if ( parent != null ) return parent.getNode(); else return null; }
/** Gets the invocation line. * @return the invocation line */ public int getInvocationLine() { final SimpleNode node = this.getNode(); if (node != null) return node.getLineNumber(); else return -1; }
public int getInvocationLine() { SimpleNode node = getNode(); if ( node != null ) return node.getLineNumber(); else return -1; } public String getInvocationText() {
/** Gets the invocation text. * @return the invocation text */ public String getInvocationText() { final SimpleNode node = this.getNode(); if (node != null) return node.getText(); else return "<invoked from Java code>"; }
public String getInvocationText() { SimpleNode node = getNode(); if ( node != null ) return node.getText(); else return "<invoked from Java code>"; }
/** Simplified method for class generated method stubs. Uses This.namespace and declaringInterpreter and retains callerInfo from namespace.getNode(). Also unwraps Primitives for convenience. */ public Object invokeMethod( String methodName, Object [] args, boolean declaredOnly ) throws EvalError { CallStack callstack = new CallStack(namespace); SimpleNode node = namespace.getNode(); namespace.setNode(null); try { return Primitive.unwrap(invokeMethod( methodName, args, declaringInterpreter, callstack, node, declaredOnly)); } catch (Exception e) { throw new EvalError(e.getMessage(), node, callstack, e); } }
public String getScriptStackTrace() { if ( callstack == null ) return "<Unknown>"; String trace = ""; CallStack stack = callstack.copy(); while ( stack.depth() > 0 ) { NameSpace ns = stack.pop(); SimpleNode node = ns.getNode(); if ( ns.isMethod ) { trace = trace + "\nCalled from method: " + ns.getName(); if ( node != null ) trace += " : at Line: "+ node.getLineNumber() + " : in file: "+ node.getSourceFile() + " : "+node.getText(); } } return trace; }
public String getScriptStackTrace() { if ( callstack == null ) return "<Unknown>"; String trace = ""; CallStack stack = callstack.copy(); while ( stack.depth() > 0 ) { NameSpace ns = stack.pop(); SimpleNode node = ns.getNode(); if ( ns.isMethod ) { trace = trace + "\nCalled from method: " + ns.getName(); if ( node != null ) trace += " : at Line: "+ node.getLineNumber() + " : in file: "+ node.getSourceFile() + " : "+node.getText(); } } return trace; }