pt.digitalis.dif.exception
Class DIFException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by pt.digitalis.dif.exception.DIFException
All Implemented Interfaces:
Serializable, IContextException
Direct Known Subclasses:
AuthenticationManagerException, AuthorizationManagerException, ContentManagerException, ControllerException, DIFCodeGenerationException, DocumentRepositoryException, IdentityManagerException, InternalFrameworkException, ParameterException

public abstract class DIFException
extends Exception
implements IContextException

Base class for the framework Exceptions.

Author:
Rodrigo Gonçalves rgoncalves@digitalis.pt, Pedro Viegas pviegas@digitalis.pt
See Also:
Serialized Form
Created on:
2007/03/16

Constructor Summary
DIFException(Exception exception)
          Constructs a new DIFException that wraps a Java Exception.
DIFException(String reason)
          Constructs a new DIFException from a reason.
DIFException(String reason, Exception exception)
          Constructs a new DIFException from a reason and a Java Exception.
 
Method Summary
 void addToExceptionContext(String key, Object value)
          Adds a new element to the exception context.
 Map<String,Object> getExceptionContext()
          Returns the exception context.
 String getRenderedExceptionContext()
          Renders the exception context.
 void setExceptionContext(Map<String,Object> exceptionContext)
          Sets the exception context.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DIFException

public DIFException(Exception exception)
Constructs a new DIFException that wraps a Java Exception.

Parameters:
exception - the exception to encapsulate.

DIFException

public DIFException(String reason)
Constructs a new DIFException from a reason.

Parameters:
reason - the exception reason.

DIFException

public DIFException(String reason,
                    Exception exception)
Constructs a new DIFException from a reason and a Java Exception.

Parameters:
reason - the exception reason.
exception - the exception to encapsulate.
Method Detail

addToExceptionContext

public void addToExceptionContext(String key,
                                  Object value)
Description copied from interface: IContextException
Adds a new element to the exception context.

Specified by:
addToExceptionContext in interface IContextException
Parameters:
key - the element's key
value - the element's value
See Also:
IContextException.addToExceptionContext(String, Object)

getExceptionContext

public Map<String,Object> getExceptionContext()
Description copied from interface: IContextException
Returns the exception context.

Specified by:
getExceptionContext in interface IContextException
Returns:
the exception context
See Also:
IContextException.getExceptionContext()

getRenderedExceptionContext

public String getRenderedExceptionContext()
Description copied from interface: IContextException
Renders the exception context.

Specified by:
getRenderedExceptionContext in interface IContextException
Returns:
a String with the rendered context.
See Also:
IContextException.getRenderedExceptionContext()

setExceptionContext

public void setExceptionContext(Map<String,Object> exceptionContext)
Description copied from interface: IContextException
Sets the exception context.

Specified by:
setExceptionContext in interface IContextException
Parameters:
exceptionContext - a pre-built exception context
See Also:
IContextException.setExceptionContext(Map)


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.