org.apache.bsf.engines.javascript
Class FnOrScript
java.lang.Object
org.apache.bsf.engines.javascript.FnOrScript
public class FnOrScript
extends java.lang.Object
This class represents a function or script, that is,
a piece of a document that is provided to the JavaScript
engine for evaluation, execution, or simply compilation.
A FnOrScript represents a range of lines or characters
in its document. For now, Rhino only supports ranges
of lines, really, but the code for offsets is there anyway.
Warning: Offsets have never been quite tested yet...
A FnOrScript has compilation units. When Rhino compiles
a function or a script, even in interpreted mode where the
compilation is done to JavaScript bytecode, it calls back
its debugger with different compilation units; see
Debugger::handleCompilationDone method on the RhinoEngineDebugger
class.
A FnOrScript also keeps track of the known breakpoints
in its range of lines or characters. It makes sure
that they are propagated to the underlying Rhino
engine (i.e. set) as well as unpropagated (i.e. unset).
m_breakpoints
protected Vector m_breakpoints
m_charCount
protected int m_charCount
m_column
protected int m_column
m_functionMap
protected Hashtable m_functionMap
m_lineCount
protected int m_lineCount
m_lineDefined
protected boolean m_lineDefined
m_offset
protected int m_offset
m_script
protected Script m_script
m_startLine
protected int m_startLine
m_text
protected StringBuffer m_text
m_units
protected Vector m_units
addCompilationUnit
public void addCompilationUnit(Context cx,
DebuggableScript dbgScript,
StringBuffer source)
compile
public void compile(Context cx,
Scriptable global)
throws BSFException,
IOException
getFnOrScriptAsStringBuffer
public StringBuffer getFnOrScriptAsStringBuffer()
getScript
public Script getScript()
removeBreakpoint
public BreakPoint removeBreakpoint(int bpid)
specifyLinesPos
public void specifyLinesPos(Reader reader,
int startLine,
int column)
throws BSFException,
IOException
specifyRange
public void specifyRange(Reader reader,
int offset)
throws BSFException,
IOException