public class ExceptionUtils extends Object
| Constructor and Description |
|---|
ExceptionUtils() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
static void |
checkAssignable(String methodExecuteName,
Class assignableToClass,
String argumentName,
Class argumentClass)
Deprecated.
use
checkAssignable(Class, String, Class) since we can detect the method name. |
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.
|
static void |
checkEmpty(String methodExecuteName,
String argumentName,
String argument)
Deprecated.
use
checkEmpty(String, String) instead since we can detect the method name. |
static void |
checkNull(String argumentName,
Object argument)
Checks if the argument is null, and if so, throws an IllegalArgumentException, does nothing if not.
|
static void |
checkNull(String methodExecuteName,
String argumentName,
Object argument)
Deprecated.
used
checkNull(String, Object) instead since we can detect the method name. |
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. |
public ExceptionUtils()
@Deprecated public static void checkNull(String methodExecuteName, String argumentName, Object argument)
checkNull(String, Object) instead since we can detect the method name.methodExecuteName - the name of the method we are currently executingargumentName - the name of the argument we are checking for nullargument - the argument we are checkingpublic static void checkNull(String argumentName, Object argument)
argumentName - the name of the argument we are checking for nullargument - the argument we are checking@Deprecated public static void checkEmpty(String methodExecuteName, String argumentName, String argument)
checkEmpty(String, String) instead since we can detect the method name.methodExecuteName - the name of the method we are currently executingargumentName - the name of the argument we are checking for nullargument - the argument we are checkingpublic static void checkEmpty(String argumentName, String argument)
argumentName - the name of the argument we are checking for nullargument - the argument we are checking@Deprecated public static void checkAssignable(String methodExecuteName, Class assignableToClass, String argumentName, Class argumentClass)
checkAssignable(Class, String, Class) since we can detect the method name.methodExecuteName - the method name of the method, this method is being executed withinassignableToClass - the Class that argumentClass must be assignable toargumentClass - the argumentClass we are checkingargumentName - the name of the argument we are checkingpublic static void checkAssignable(Class assignableToClass, String argumentName, Class argumentClass)
assignableToClass - the Class that argumentClass must be assignable toargumentClass - the argumentClass we are checkingargumentName - the name of the argument we are checkingpublic static Throwable getRootCause(Throwable throwable)
throwable itself is returned.throwable - the exception from which to retrieve the root cause.Copyright © 2003–2014 AndroMDA.org. All rights reserved.