pnuts.lang
Class PnutsException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by pnuts.lang.PnutsException
All Implemented Interfaces:
java.io.Serializable

public class PnutsException
extends java.lang.RuntimeException

This is a wrapper class for Exception to be thrown.

Author:
Toyokazu Tomatsu
See Also:
Serialized Form

Nested Class Summary
static class PnutsException.TraceInfo
          A node of a call-chain, which represents a position of a certain function call
 
Field Summary
protected  int column
           
protected  java.lang.String contextName
           
protected  java.lang.Object file
           
protected  int line
           
protected  java.lang.Object operation
           
protected  java.lang.Throwable throwable
           
protected  java.util.Vector trace
           
 
Constructor Summary
PnutsException()
          Constructor
PnutsException(java.lang.String msg)
          Constructor
PnutsException(java.lang.String msg, Context context)
          Constructor
PnutsException(java.lang.String key, java.lang.Object[] param, Context context)
          This constructor creates a PnutsException using i18n resources in pnuts.properties.
PnutsException(java.lang.String bundleName, java.lang.String key, java.lang.Object[] param, Context context)
          This constructor creates a PnutsException using i18n resources in pnuts.properties.
PnutsException(java.lang.Throwable t)
          Deprecated. replaced by PnutsException(Throwable, Context)
PnutsException(java.lang.Throwable t, Context context)
          Constructor
PnutsException(java.lang.Throwable t, java.lang.Object operation, Context context)
          Deprecated.  
 
Method Summary
 java.util.Enumeration getBackTrace()
          Returns an enumeration of PnutsException.TraceInfo objects
 int getColumn()
          Returns the column number where the error occured.
 int getLine()
          Returns the line number where the error occured.
 java.lang.String getMessage()
           
 java.lang.Object getScriptSource()
          Returns the script source (usually a URL) where the error occured.
 java.lang.Throwable getThrowable()
          Returns the root cause
 void printStackTrace(java.io.PrintStream ps)
           
 void printStackTrace(java.io.PrintWriter writer)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

line

protected int line

column

protected int column

file

protected java.lang.Object file

throwable

protected java.lang.Throwable throwable

contextName

protected java.lang.String contextName

trace

protected transient java.util.Vector trace

operation

protected transient java.lang.Object operation
Constructor Detail

PnutsException

public PnutsException()
Constructor


PnutsException

public PnutsException(java.lang.String msg)
Constructor

Parameters:
msg - the error message

PnutsException

public PnutsException(java.lang.String msg,
                      Context context)
Constructor

Parameters:
msg - the error message
context - the context in which the error occurs

PnutsException

public PnutsException(java.lang.String key,
                      java.lang.Object[] param,
                      Context context)
This constructor creates a PnutsException using i18n resources in pnuts.properties.


PnutsException

public PnutsException(java.lang.String bundleName,
                      java.lang.String key,
                      java.lang.Object[] param,
                      Context context)
This constructor creates a PnutsException using i18n resources in pnuts.properties.


PnutsException

public PnutsException(java.lang.Throwable t)
Deprecated. replaced by PnutsException(Throwable, Context)


PnutsException

public PnutsException(java.lang.Throwable t,
                      Context context)
Constructor

Parameters:
t - a Throwable
context - the context

PnutsException

public PnutsException(java.lang.Throwable t,
                      java.lang.Object operation,
                      Context context)
Deprecated. 

Constructor

Parameters:
t - a Throwable
operation - a Method or a Constructor
context - the context
Method Detail

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable

getThrowable

public java.lang.Throwable getThrowable()
Returns the root cause


getBackTrace

public java.util.Enumeration getBackTrace()
Returns an enumeration of PnutsException.TraceInfo objects


printStackTrace

public void printStackTrace(java.io.PrintWriter writer)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Overrides:
printStackTrace in class java.lang.Throwable

getLine

public int getLine()
Returns the line number where the error occured.


getColumn

public int getColumn()
Returns the column number where the error occured. -1: unknown


getScriptSource

public java.lang.Object getScriptSource()
Returns the script source (usually a URL) where the error occured.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable