Class 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 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.