org.mozilla.javascript
Class JavaScriptException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.mozilla.javascript.JavaScriptException
All Implemented Interfaces:
java.io.Serializable

public class JavaScriptException
extends java.lang.Exception

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

Author:
Mike McCabe
See Also:
Serialized Form

Constructor Summary
JavaScriptException(java.lang.Object value)
          Deprecated. Use EvaluatorException.EvaluatorException(String) to report exceptions in Java code.
JavaScriptException(java.lang.Object value, java.lang.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.
 java.lang.String getSourceName()
          Get the name of the source containing the error, or null if that information is not available.
 java.lang.Object getValue()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaScriptException

public JavaScriptException(java.lang.Object value)
Deprecated. Use EvaluatorException.EvaluatorException(String) to report exceptions in Java code.


JavaScriptException

public JavaScriptException(java.lang.Object value,
                           java.lang.String sourceName,
                           int lineNumber)
Create a JavaScript exception wrapping the given JavaScript value
Parameters:
value - the JavaScript value thrown.
Method Detail

getValue

public java.lang.Object getValue()
Returns:
the value wrapped by this exception

getSourceName

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

getLineNumber

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