javax.script
Class ScriptException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.script.ScriptException
All Implemented Interfaces:
java.io.Serializable

public class ScriptException
extends java.lang.Exception

See Javadoc of Java Scripting API

See Also:
Serialized Form

Field Summary
protected  int columnNumber
          Stores the column number of the script in which the error has occured
protected  java.lang.String fileName
          Stroes the file name of the script
protected  int lineNumber
          Stores the line number of the script in which the error has occured
protected  java.lang.String message
          Stores the message which describes the cause of error
 
Constructor Summary
ScriptException(java.lang.Exception exception)
          Constructs a new exception with the specified cause.
ScriptException(java.lang.String message)
          Constructs a new exception with the specified detailed message.
ScriptException(java.lang.String message, java.lang.String fileName, int lineNumber)
          Constructs a new exception with the spcified detailed message of cause, the file name of the source of script and the line number of the script where the error has occured.
ScriptException(java.lang.String message, java.lang.String fileName, int lineNumber, int columnNumber)
          Constructs a new exception using the detailed message of cause, file name which contains the script, line number and column number in which the error has occured.
 
Method Summary
 int getColumnNumber()
          Retrieves the column number of the script where the error has occured.
 java.lang.String getFileName()
          Retrieves the file name in which the script is contained.
 int getLineNumber()
          Retrieves the line number of the script where the error has occured.
 java.lang.String getMessage()
          Retrieves a String describing the cause of error.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileName

protected java.lang.String fileName
Stroes the file name of the script


lineNumber

protected int lineNumber
Stores the line number of the script in which the error has occured


columnNumber

protected int columnNumber
Stores the column number of the script in which the error has occured


message

protected java.lang.String message
Stores the message which describes the cause of error

Constructor Detail

ScriptException

public ScriptException(java.lang.Exception exception)
Constructs a new exception with the specified cause.

Parameters:
exception - the cause of exception

ScriptException

public ScriptException(java.lang.String message)
Constructs a new exception with the specified detailed message.

Parameters:
message - the datailed message which caused the exception

ScriptException

public ScriptException(java.lang.String message,
                       java.lang.String fileName,
                       int lineNumber)
Constructs a new exception with the spcified detailed message of cause, the file name of the source of script and the line number of the script where the error has occured.

Parameters:
message - the detailed message of cause of exception
fileName - the file name which contains the script
lineNumber - the line number of the script where the error has occured

ScriptException

public ScriptException(java.lang.String message,
                       java.lang.String fileName,
                       int lineNumber,
                       int columnNumber)
Constructs a new exception using the detailed message of cause, file name which contains the script, line number and column number in which the error has occured.

Parameters:
message - the detailed message of the cause of exception
fileName - the name of the file which contains the script
lineNumber - the line number of the script where the error has occured
columnNumber - the column number of the script where the error has occured
Method Detail

getFileName

public java.lang.String getFileName()
Retrieves the file name in which the script is contained.

Returns:
Returns the file name in which the script is contained

getColumnNumber

public int getColumnNumber()
Retrieves the column number of the script where the error has occured. If the information is not available, returns -1.

Returns:
Returns the column number of the script where the error has occured

getLineNumber

public int getLineNumber()
Retrieves the line number of the script where the error has occured. If the information is not available, returns -1.

Returns:
Returns the line number of the script where the error has occured

getMessage

public java.lang.String getMessage()
Retrieves a String describing the cause of error.

Overrides:
getMessage in class java.lang.Throwable
Returns:
a String describing the cause of error


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.