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).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_cell
protected DocumentCell m_cell
m_lineDefined
protected boolean m_lineDefined
m_startLine
protected int m_startLine
m_lineCount
protected int m_lineCount
m_column
protected int m_column
m_offset
protected int m_offset
m_charCount
protected int m_charCount
m_breakpoints
protected java.util.Vector m_breakpoints
m_text
protected java.lang.StringBuffer m_text
m_units
protected java.util.Vector m_units
m_script
protected Script m_script
m_functionMap
protected java.util.Hashtable m_functionMap
FnOrScript
public FnOrScript(DocumentCell cell)
addBreakpoint
public BreakPoint addBreakpoint(BreakPoint bp)
removeBreakpoint
public BreakPoint removeBreakpoint(int bpid)
createBreakpoint
protected BreakPoint createBreakpoint(BreakPoint bp)
findBreakpointAtLine
public BreakPoint findBreakpointAtLine(int lineno)
throws BSFException
- Throws:
BSFException
findBreakpointAtOffset
public BreakPoint findBreakpointAtOffset(int offset)
throws BSFException
- Throws:
BSFException
getCharCount
public int getCharCount()
throws BSFException
- Throws:
BSFException
getDocument
public DocumentCell getDocument()
getFirstLine
public int getFirstLine()
throws BSFException
- Throws:
BSFException
getColumn
public int getColumn()
throws BSFException
- Throws:
BSFException
getFnOrScriptAsStringBuffer
public java.lang.StringBuffer getFnOrScriptAsStringBuffer()
getLineCount
public int getLineCount()
throws BSFException
- Throws:
BSFException
getOffset
public int getOffset()
throws BSFException
- Throws:
BSFException
specifyLinesPos
public void specifyLinesPos(java.io.Reader reader,
int startLine,
int column)
throws BSFException,
java.io.IOException
- Throws:
BSFException
java.io.IOException
specifyRange
public void specifyRange(java.io.Reader reader,
int offset)
throws BSFException,
java.io.IOException
- Throws:
BSFException
java.io.IOException
addCompilationUnit
public void addCompilationUnit(Context cx,
DebuggableScript dbgScript,
java.lang.StringBuffer source)
compile
public void compile(Context cx,
Scriptable global)
throws BSFException,
java.io.IOException
- Throws:
BSFException
java.io.IOException
getScript
public Script getScript()