org.formulacompiler.runtime
Class FormulaCompilerException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.formulacompiler.runtime.FormulaCompilerException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CompilerException, EngineException

public class FormulaCompilerException
extends java.lang.Exception

Base class for all exceptions thrown by AFC. Augments the basic Exception class with support for message context information. The idea is that handlers further up the chain can add context information to the existing exception, then rethrow it. This makes the exception mutable, but avoids having to wrap it repeatedly for no other reason that to provide a bit of source location context.

Author:
peo
See Also:
Serialized Form

Constructor Summary
FormulaCompilerException()
           
FormulaCompilerException(java.lang.String _message)
           
FormulaCompilerException(java.lang.String _message, java.lang.Throwable _cause)
           
FormulaCompilerException(java.lang.Throwable _cause)
           
 
Method Summary
 void addMessageContext(java.lang.String _messageContext)
          Appends to the current message context.
 java.lang.String getMessage()
          Override that appends the current message context to the message.
 java.lang.String getMessageContext()
          Returns the current message context.
 java.lang.String getPureMessage()
          Returns the pure, unchanged message.
 void setMessageContext(java.lang.String _messageContext)
          Sets the current message context.
 
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
 

Constructor Detail

FormulaCompilerException

public FormulaCompilerException()

FormulaCompilerException

public FormulaCompilerException(java.lang.String _message,
                                java.lang.Throwable _cause)

FormulaCompilerException

public FormulaCompilerException(java.lang.String _message)

FormulaCompilerException

public FormulaCompilerException(java.lang.Throwable _cause)
Method Detail

getMessage

public java.lang.String getMessage()
Override that appends the current message context to the message.

Overrides:
getMessage in class java.lang.Throwable
Returns:
the message plus the context.
See Also:
getPureMessage(), getMessageContext()

getPureMessage

public java.lang.String getPureMessage()
Returns the pure, unchanged message.

See Also:
getMessage()

getMessageContext

public java.lang.String getMessageContext()
Returns the current message context. It is automatically appended to the normal getMessage().


setMessageContext

public void setMessageContext(java.lang.String _messageContext)
Sets the current message context.

Parameters:
_messageContext - is the new message context.
See Also:
addMessageContext(String)

addMessageContext

public void addMessageContext(java.lang.String _messageContext)
Appends to the current message context.

Parameters:
_messageContext - is the context to append.