com.ugos.JIProlog.engine
Class JIPRuntimeException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.ugos.JIProlog.engine.JIPRuntimeException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JIPInvalidHandleException, JIPIsRunningException, JIPJVMException, JIPParameterTypeException, JIPParameterUnboundedException, JIPQueryClosedException, JIPSyntaxErrorException

public class JIPRuntimeException
extends java.lang.RuntimeException

JIPRuntimeException is the base class af all exceptions raised by JIProlog.
All runtime errors and exceptions are translated in JIPRuntimeException except JIPSyntaxErrorException.

Version:
3.0
Author:
Ugo Chirico 2005
Home Page: http://www.ugosweb.com/jiprolog
See Also:
JIPEngine, Serialized Form

Field Summary
static int ID_UNKNOWN_EXCEPTION
           
static int ID_USER_EXCEPTION
           
 
Constructor Summary
JIPRuntimeException(int nErrorNum, java.lang.String strMsg)
          Constructs a new JIPRuntimeException
JIPRuntimeException(java.lang.String strMsg)
          Constructs a new JIPRuntimeException with unknown error number
 
Method Summary
 int getErrorNumber()
          Gets the error number
 java.lang.String getFileName()
          Gets the file name where the exception was raised
 int getLineNumber()
          Gets the line number where the exception was raised
 java.lang.String getMessage()
          Gets the error message
 int getPosition()
          Gets the position where the exception was raised
 JIPTerm getTerm()
          Gets the eerror term associated to this exception
 void printPrologStackTrace()
          Write the stack trace of goals to the default print stream
 void printPrologStackTrace(java.io.PrintStream ps)
          Write the stack trace of goals to the given print stream
 void printPrologStackTrace(java.io.PrintWriter pw)
          Write the stack trace of goals to the given print writer
 void setTerm(com.ugos.JIProlog.engine.PrologObject term)
          Sets the error term associated to this exception
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_UNKNOWN_EXCEPTION

public static final int ID_UNKNOWN_EXCEPTION
See Also:
Constant Field Values

ID_USER_EXCEPTION

public static final int ID_USER_EXCEPTION
See Also:
Constant Field Values
Constructor Detail

JIPRuntimeException

public JIPRuntimeException(int nErrorNum,
                           java.lang.String strMsg)
Constructs a new JIPRuntimeException

Parameters:
nErrorNum - number of the error
strMsg - message associated to this exception

JIPRuntimeException

public JIPRuntimeException(java.lang.String strMsg)
Constructs a new JIPRuntimeException with unknown error number

Parameters:
strMsg - message associated to this exception
Method Detail

getErrorNumber

public final int getErrorNumber()
Gets the error number

Returns:
error number

getTerm

public JIPTerm getTerm()
Gets the eerror term associated to this exception

Returns:
JIPTerm object associated to this exception

setTerm

public void setTerm(com.ugos.JIProlog.engine.PrologObject term)
Sets the error term associated to this exception

Parameters:
term - the term of this exception

getFileName

public java.lang.String getFileName()
Gets the file name where the exception was raised

Returns:
the file name where the exception was raised

getLineNumber

public int getLineNumber()
Gets the line number where the exception was raised

Returns:
the line number where the exception was raised

getPosition

public int getPosition()
Gets the position where the exception was raised

Returns:
the position where the exception was raised

getMessage

public java.lang.String getMessage()
Gets the error message

Overrides:
getMessage in class java.lang.Throwable
Returns:
the error message

printPrologStackTrace

public void printPrologStackTrace()
Write the stack trace of goals to the default print stream


printPrologStackTrace

public void printPrologStackTrace(java.io.PrintStream ps)
Write the stack trace of goals to the given print stream

Parameters:
ps - print stream that receive the stack trace

printPrologStackTrace

public void printPrologStackTrace(java.io.PrintWriter pw)
Write the stack trace of goals to the given print writer

Parameters:
pw - printwriter that receive the stack trace