public abstract class RhinoException
extends java.lang.RuntimeException
Modifier and Type | Method and Description |
---|---|
int |
columnNumber()
The column number of the location of the error, or zero if unknown.
|
java.lang.String |
details() |
java.lang.String |
getMessage() |
ScriptStackElement[] |
getScriptStack()
Get the script stack of this exception as an array of
ScriptStackElement s. |
java.lang.String |
getScriptStackTrace()
Get a string representing the script stack of this exception.
|
java.lang.String |
getScriptStackTrace(java.io.FilenameFilter filter)
Deprecated.
the filter argument is ignored as we are able to
recognize script stack elements by our own. Use
#getScriptStackTrace() instead.
|
void |
initColumnNumber(int columnNumber)
Initialize the column number of the script statement causing the error.
|
void |
initLineNumber(int lineNumber)
Initialize the line number of the script statement causing the error.
|
void |
initLineSource(java.lang.String lineSource)
Initialize the text of the source line containing the error.
|
void |
initSourceName(java.lang.String sourceName)
Initialize the uri of the script source containing the error.
|
int |
lineNumber()
Returns the line number of the statement causing the error,
or zero if not available.
|
java.lang.String |
lineSource()
The source text of the line causing the error, or null if unknown.
|
void |
printStackTrace(java.io.PrintStream s) |
void |
printStackTrace(java.io.PrintWriter s) |
java.lang.String |
sourceName()
Get the uri of the script source containing the error, or null
if that information is not available.
|
static void |
useMozillaStackStyle(boolean flag)
Tell subclasses of
RhinoException whether to
use the Mozilla/Firefox style of rendering script stacks
(functionName()@fileName:lineNumber )
instead of Rhino's own Java-inspired format
( at fileName:lineNumber (functionName) ) |
static boolean |
usesMozillaStackStyle()
Returns true if subclasses of
RhinoException
use the Mozilla/Firefox style of rendering script stacks
(functionName()@fileName:lineNumber )
instead of Rhino's own Java-inspired format
( at fileName:lineNumber (functionName) ). |
public final java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String details()
public final java.lang.String sourceName()
public final void initSourceName(java.lang.String sourceName)
sourceName
- the uri of the script source responsible for the error.
It should not be null.java.lang.IllegalStateException
- if the method is called more then once.public final int lineNumber()
public final void initLineNumber(int lineNumber)
lineNumber
- the line number in the script source.
It should be positive number.java.lang.IllegalStateException
- if the method is called more then once.public final int columnNumber()
public final void initColumnNumber(int columnNumber)
columnNumber
- the column number in the script source.
It should be positive number.java.lang.IllegalStateException
- if the method is called more then once.public final java.lang.String lineSource()
public final void initLineSource(java.lang.String lineSource)
lineSource
- the text of the source line responsible for the error.
It should not be null.java.lang.IllegalStateException
- if the method is called more then once.public java.lang.String getScriptStackTrace()
public java.lang.String getScriptStackTrace(java.io.FilenameFilter filter)
filter
- ignoredpublic ScriptStackElement[] getScriptStack()
ScriptStackElement
s.
If optimization is enabled, this includes java stack elements
whose source and method names suggest they have been generated
by the Rhino script compiler.public void printStackTrace(java.io.PrintWriter s)
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream s)
printStackTrace
in class java.lang.Throwable
public static boolean usesMozillaStackStyle()
RhinoException
use the Mozilla/Firefox style of rendering script stacks
(functionName()@fileName:lineNumber
)
instead of Rhino's own Java-inspired format
( at fileName:lineNumber (functionName)
).ScriptStackElement
public static void useMozillaStackStyle(boolean flag)
RhinoException
whether to
use the Mozilla/Firefox style of rendering script stacks
(functionName()@fileName:lineNumber
)
instead of Rhino's own Java-inspired format
( at fileName:lineNumber (functionName)
)flag
- whether to render stacks in Mozilla/Firefox styleScriptStackElement