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

      • InjectionException

        public InjectionException()
        Creates a new instance of InjectionException
      • InjectionException

        public InjectionException​(String msg)
        Creates a new instance of InjectionException and initializes it with an error message.
        Parameters:
        msg - the error message
      • InjectionException

        public InjectionException​(Throwable cause)
        Creates a new instance of InjectionException and initializes it with a root cause.
        Parameters:
        cause - the root cause of this exception
      • InjectionException

        public InjectionException​(String msg,
                                  Throwable cause)
        Creates a new instance of InjectionException and initializes it with both an error message and a root cause.
        Parameters:
        msg - the error message
        cause - the root cause of this exception