| java.lang.Object org.andromda.core.common.ExceptionUtils
ExceptionUtils | public class ExceptionUtils (Code) | | Contains Exception handling utilities.
author: Chad Brandon |
Method Summary | |
public static void | checkAssignable(String methodExecuteName, Class assignableToClass, String argumentName, Class argumentClass) Checks if the argumentClass is assignable to assignableToClass, and if not throws an IllegalArgumentException,
otherwise does nothing. | public static void | checkAssignable(Class assignableToClass, String argumentName, Class argumentClass) Checks if the argumentClass is assignable to assignableToClass, and if not throws an IllegalArgumentException,
otherwise does nothing. | public static void | checkEmpty(String methodExecuteName, String argumentName, String argument) Checks if the argument is null or an empty String throws an IllegalArgumentException if it is, does nothing if
not. | public static void | checkEmpty(String argumentName, String argument) Checks if the argument is null or an empty String throws an IllegalArgumentException if it is, does nothing if
not. | public static void | checkNull(String methodExecuteName, String argumentName, Object argument) Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not. | public static void | checkNull(String argumentName, Object argument) Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not. | public static Throwable | getRootCause(Throwable throwable) Attempts to retrieve the root cause of the exception, if it can not be
found, the throwable itself is returned.
Parameters: throwable - the exception from which to retrieve the root cause. |
checkAssignable | public static void checkAssignable(String methodExecuteName, Class assignableToClass, String argumentName, Class argumentClass)(Code) | | Checks if the argumentClass is assignable to assignableToClass, and if not throws an IllegalArgumentException,
otherwise does nothing.
Parameters: methodExecuteName - the method name of the method, this method is being executed within Parameters: assignableToClass - the Class that argumentClass must be assignable to Parameters: argumentClass - the argumentClass we are checking Parameters: argumentName - the name of the argument we are checkingExceptionUtils.checkAssignable(Class,String,Class) |
checkAssignable | public static void checkAssignable(Class assignableToClass, String argumentName, Class argumentClass)(Code) | | Checks if the argumentClass is assignable to assignableToClass, and if not throws an IllegalArgumentException,
otherwise does nothing.
Parameters: assignableToClass - the Class that argumentClass must be assignable to Parameters: argumentClass - the argumentClass we are checking Parameters: argumentName - the name of the argument we are checking |
checkEmpty | public static void checkEmpty(String methodExecuteName, String argumentName, String argument)(Code) | | Checks if the argument is null or an empty String throws an IllegalArgumentException if it is, does nothing if
not.
Parameters: methodExecuteName - the name of the method we are currently executing Parameters: argumentName - the name of the argument we are checking for null Parameters: argument - the argument we are checkingExceptionUtils.checkEmpty(String,String) |
checkEmpty | public static void checkEmpty(String argumentName, String argument)(Code) | | Checks if the argument is null or an empty String throws an IllegalArgumentException if it is, does nothing if
not.
Parameters: argumentName - the name of the argument we are checking for null Parameters: argument - the argument we are checking |
checkNull | public static void checkNull(String methodExecuteName, String argumentName, Object argument)(Code) | | Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not.
Parameters: methodExecuteName - the name of the method we are currently executing Parameters: argumentName - the name of the argument we are checking for null Parameters: argument - the argument we are checkingExceptionUtils.checkNull(String,Object) |
checkNull | public static void checkNull(String argumentName, Object argument)(Code) | | Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not.
Parameters: argumentName - the name of the argument we are checking for null Parameters: argument - the argument we are checking |
getRootCause | public static Throwable getRootCause(Throwable throwable)(Code) | | Attempts to retrieve the root cause of the exception, if it can not be
found, the throwable itself is returned.
Parameters: throwable - the exception from which to retrieve the root cause. the root cause of the exception |
|
|