gr.uoa.di.madgik.grs.record.exception
Class GRS2ThrowableWrapper

java.lang.Object
  extended by gr.uoa.di.madgik.grs.record.exception.GRS2ThrowableWrapper
All Implemented Interfaces:
Serializable

public class GRS2ThrowableWrapper
extends Object
implements Serializable

Author:
alex
See Also:
Serialized Form

Constructor Summary
GRS2ThrowableWrapper()
           
 
Method Summary
static Throwable convertToException(Class<?> exClass, Throwable th)
          Converts a throwable in a specific class type exClass.
static Throwable convertToGenaralException(Throwable th)
          Converts a throwable in GRS2Exception.class
static Throwable createFromGRS2ThrowableWrapper(GRS2ThrowableWrapper tw, Class<?> genericException)
          Creates a Throwable from a GRS2ThrowableWrapper.
static GRS2ThrowableWrapper createFromThrowable(Throwable th)
          Creates a GRS2ThrowableWrapper from a Throwable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GRS2ThrowableWrapper

public GRS2ThrowableWrapper()
Method Detail

convertToGenaralException

public static Throwable convertToGenaralException(Throwable th)
                                           throws GRS2ThrowableWrapperException
Converts a throwable in GRS2Exception.class

Parameters:
th -
Returns:
Throws:
GRS2ThrowableWrapperException

convertToException

public static Throwable convertToException(Class<?> exClass,
                                           Throwable th)
                                    throws GRS2ThrowableWrapperException
Converts a throwable in a specific class type exClass. If exClass is not subClass of Throwable an exception will be thrown

Parameters:
exClass -
th -
Returns:
Throws:
GRS2ThrowableWrapperException

createFromThrowable

public static GRS2ThrowableWrapper createFromThrowable(Throwable th)
                                                throws GRS2ThrowableWrapperException
Creates a GRS2ThrowableWrapper from a Throwable

Parameters:
th -
Returns:
Throws:
GRS2ThrowableWrapperException

createFromGRS2ThrowableWrapper

public static Throwable createFromGRS2ThrowableWrapper(GRS2ThrowableWrapper tw,
                                                       Class<?> genericException)
                                                throws GRS2ThrowableWrapperException
Creates a Throwable from a GRS2ThrowableWrapper. genericException needs to be given in order to specify the most generic of each Exception if the real class of the Exception is not available.

Parameters:
tw -
genericException -
Returns:
Throws:
GRS2ThrowableWrapperException


Copyright © 2012. All Rights Reserved.