Class ClassInstantiationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.github.mjeanroy.dbunit.exception.ClassInstantiationException
-
- All Implemented Interfaces:
Serializable
public class ClassInstantiationException extends RuntimeException
Exception thrown when a class cannot be instantiated because of:- Missing empty public constructor.
- The empty constructor is not public.
- Etc.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getKlass()
Class that cannot be instantiated.static ClassInstantiationException
instantiationException(Class<?> klass, Exception cause)
Create exception with given original cause.static ClassInstantiationException
missingDefaultConstructor(Class<?> klass)
Create exception with a message saying that the empty public constructor is missing on given class.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
getKlass
public Class<?> getKlass()
Class that cannot be instantiated.- Returns:
- The class.
-
missingDefaultConstructor
public static ClassInstantiationException missingDefaultConstructor(Class<?> klass)
Create exception with a message saying that the empty public constructor is missing on given class.- Parameters:
klass
- The class.- Returns:
- The exception.
-
instantiationException
public static ClassInstantiationException instantiationException(Class<?> klass, Exception cause)
Create exception with given original cause.- Parameters:
klass
- The class.cause
- The original exception.- Returns:
- The exception.
-
-