org.mozilla.javascript

Class JavaScriptException


public class JavaScriptException
extends Exception

Java reflection of JavaScript exceptions. Instances of this class are thrown by the JavaScript 'throw' keyword.

Author:
Mike McCabe

Constructor Summary

JavaScriptException(Object value)
Deprecated. Use EvaluatorException.EvaluatorException(String) to report exceptions in Java code.
JavaScriptException(Object value, String sourceName, int lineNumber)
Create a JavaScript exception wrapping the given JavaScript value

Method Summary

int
getLineNumber()
Returns the line number of the statement causing the error, or zero if not available.
String
getSourceName()
Get the name of the source containing the error, or null if that information is not available.
Object
getValue()

Constructor Details

JavaScriptException

public JavaScriptException(Object value)

Deprecated. Use EvaluatorException.EvaluatorException(String) to report exceptions in Java code.


JavaScriptException

public JavaScriptException(Object value,
                           String sourceName,
                           int lineNumber)
Create a JavaScript exception wrapping the given JavaScript value

Parameters:
value - the JavaScript value thrown.

Method Details

getLineNumber

public int getLineNumber()
Returns the line number of the statement causing the error, or zero if not available.


getSourceName

public String getSourceName()
Get the name of the source containing the error, or null if that information is not available.


getValue

public Object getValue()

Returns:
the value wrapped by this exception