Package be.gaudry.model.exception
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
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 Summary
ConstructorDescriptionBuilds an instance of this exception without specifying the class that is at faultIllegalInstanceException(Class<?> nonInstanciableClass)
Builds an instance of the exception with the class that an instance is trying to be created -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IllegalInstanceException
public IllegalInstanceException()Builds an instance of this exception without specifying the class that is at fault -
IllegalInstanceException
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
-