org.databene.commons
Class ExceptionMapper

java.lang.Object
  extended by org.databene.commons.ExceptionMapper

public final class ExceptionMapper
extends java.lang.Object

Wraps checked exceptions as unchecked exceptions of type ConfigurationError.

Created: 02.07.2006 07:44:23

Author:
Volker Bergmann

Constructor Summary
ExceptionMapper()
           
 
Method Summary
static ConfigurationError configurationException(java.lang.Exception cause, java.lang.Class<?> type)
          Maps class reflection related exceptions to ConfigurationExceptions
static ConfigurationError configurationException(java.lang.Exception cause, java.lang.reflect.Constructor<?> constructor)
          Maps method reflection related exceptions to ConfigurationExceptions
static ConfigurationError configurationException(java.lang.Exception cause, java.lang.reflect.Field field)
          Maps attribute reflection related exceptions to ConfigurationExceptions
static ConfigurationError configurationException(java.lang.Exception cause, java.lang.reflect.Method method)
          Maps method reflection related exceptions to ConfigurationExceptions
static ConfigurationError configurationException(java.lang.Exception cause, java.lang.String name)
          Maps exceptions to ConfigurationExceptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionMapper

public ExceptionMapper()
Method Detail

configurationException

public static ConfigurationError configurationException(java.lang.Exception cause,
                                                        java.lang.reflect.Constructor<?> constructor)
Maps method reflection related exceptions to ConfigurationExceptions

Parameters:
cause - the exception that occurred
constructor - the constructor that was involved in the cause
Returns:
a ConfigurationError that maps the cause.

configurationException

public static ConfigurationError configurationException(java.lang.Exception cause,
                                                        java.lang.reflect.Method method)
Maps method reflection related exceptions to ConfigurationExceptions

Parameters:
cause - the exception that occurred
method - the method that was involved in the cause
Returns:
a ConfigurationError that maps the cause.

configurationException

public static ConfigurationError configurationException(java.lang.Exception cause,
                                                        java.lang.Class<?> type)
Maps class reflection related exceptions to ConfigurationExceptions

Parameters:
cause - the exception that occurred
type - the class that was involved in the cause
Returns:
a ConfigurationError that maps the cause.

configurationException

public static ConfigurationError configurationException(java.lang.Exception cause,
                                                        java.lang.reflect.Field field)
Maps attribute reflection related exceptions to ConfigurationExceptions

Parameters:
cause - the exception that occurred
field - the field that was involved in the cause
Returns:
a ConfigurationError that maps the cause.

configurationException

public static ConfigurationError configurationException(java.lang.Exception cause,
                                                        java.lang.String name)
Maps exceptions to ConfigurationExceptions

Parameters:
cause - the exception that occurred
name - a characteristic identifier that was involved in the cause
Returns:
a ConfigurationError that maps the cause.


Copyright © 2010. All Rights Reserved.