Package net.sf.jguiraffe.di
Class InjectionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- net.sf.jguiraffe.di.InjectionException
-
- All Implemented Interfaces:
Serializable
public class InjectionException extends RuntimeException
An exception class for reporting exceptions related to dependency injection.
When working with reflection naturally a whole bunch of exceptions can be thrown. This library wraps these exceptions in a generic
InjectionException
. Note that this is a runtime exception, so there is no need for explicit catch blocks. (If dependency injection causes exceptions, this is typically due to a wrong configuration; so there is nothing the application itself can do about.)- Version:
- $Id: InjectionException.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InjectionException()
Creates a new instance ofInjectionException
InjectionException(String msg)
Creates a new instance ofInjectionException
and initializes it with an error message.InjectionException(String msg, Throwable cause)
Creates a new instance ofInjectionException
and initializes it with both an error message and a root cause.InjectionException(Throwable cause)
Creates a new instance ofInjectionException
and initializes it with a root cause.
-
Method Summary
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
InjectionException
public InjectionException()
Creates a new instance ofInjectionException
-
InjectionException
public InjectionException(String msg)
Creates a new instance ofInjectionException
and initializes it with an error message.- Parameters:
msg
- the error message
-
InjectionException
public InjectionException(Throwable cause)
Creates a new instance ofInjectionException
and initializes it with a root cause.- Parameters:
cause
- the root cause of this exception
-
-