Class IllegalInstanceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
be.gaudry.model.exception.IllegalInstanceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SingletonException

public class IllegalInstanceException extends RuntimeException
Thrown when trying to build a non instanciable class. Setting the visibility of the constructor to private is not enough to ensure than no instance will be created, because clients may invoke the private constructor after calling the setAccessible(true) and newInstance(Object ... initargs). Provided by the broldev.core.model project.
Since:
1.0 (Nov 21, 2010), broldev.core.model 0.0.1-SNAPSHOT dependency
Version:
1.0 (Nov 21, 2010)
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • IllegalInstanceException

      public IllegalInstanceException()
      Builds an instance of this exception without specifying the class that is at fault
    • IllegalInstanceException

      public IllegalInstanceException(Class<?> nonInstanciableClass)
      Builds an instance of the exception with the class that an instance is trying to be created
      Parameters:
      nonInstanciableClass - class than an instance may not be built