Class AbstractInjector.AmbiguousComponentResolutionException

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    AbstractInjector<T>

    public static final class AbstractInjector.AmbiguousComponentResolutionException
    extends PicoCompositionException
    Exception that is thrown as part of the introspection. Raised if a PicoContainer cannot resolve a type dependency because the registered ComponentAdapters are not distinct.
    Author:
    Paul Hammant, Aslak Hellesøy, Jon Tirsén
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AmbiguousComponentResolutionException​(java.lang.Class<?> ambiguousDependency, java.lang.String[] componentKeys)
      Construct a new exception with the ambiguous class type and the ambiguous component keys.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getAmbiguousComponentKeys()  
      java.lang.String getMessage()  
      void setComponent​(java.lang.String component)  
      void setMember​(java.lang.reflect.AccessibleObject accessibleObject)  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AmbiguousComponentResolutionException

        public AmbiguousComponentResolutionException​(java.lang.Class<?> ambiguousDependency,
                                                     java.lang.String[] componentKeys)
        Construct a new exception with the ambiguous class type and the ambiguous component keys.
        Parameters:
        ambiguousDependency - the unresolved dependency type
        componentKeys - the ambiguous keys.
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        Returns a string containing the unresolved class type and the ambiguous keys.
      • getAmbiguousComponentKeys

        public java.lang.String[] getAmbiguousComponentKeys()
        Returns:
        Returns the ambiguous component keys as array.
      • setComponent

        public void setComponent​(java.lang.String component)
      • setMember

        public void setMember​(java.lang.reflect.AccessibleObject accessibleObject)