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. (Possibly wrapping a Java exception.)
- Author:
- Mike McCabe
- See Also:
- Serialized Form
Constructor Summary |
JavaScriptException(java.lang.Object value)
Create a JavaScript exception wrapping the given JavaScript value. |
Method Summary |
java.lang.String |
getMessage()
Get the exception message. |
java.lang.Object |
getValue()
Get the exception value originally thrown. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JavaScriptException
public JavaScriptException(java.lang.Object value)
- Create a JavaScript exception wrapping the given JavaScript value.
Instances of this class are thrown by the JavaScript 'throw' keyword.
- Parameters:
value
- the JavaScript value thrown.
getMessage
public java.lang.String getMessage()
- Get the exception message.
Will just convert the wrapped exception to a string.
- Overrides:
getMessage
in class java.lang.Throwable
getValue
public java.lang.Object getValue()
- Get the exception value originally thrown. This may be a
JavaScript value (null, undefined, Boolean, Number, String,
Scriptable or Function) or a Java exception value thrown from a
host object or from Java called through LiveConnect.
- Returns:
- the value wrapped by this exception