Class DependencyMetaData

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getTypeQualifier()
      Obtains the type qualifier for the dependency.
      static java.lang.String getTypeQualifier​(java.lang.String dependencyName, java.util.Collection<java.lang.annotation.Annotation> annotations)
      Obtains the qualifier from the set of Annotation instances.
      void injectDependency​(java.lang.Object object, java.lang.Object dependency)
      Injects the dependency into the object.
      • Methods inherited from class java.lang.Object

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

      • DependencyMetaData

        public DependencyMetaData​(java.lang.String name,
                                  int index,
                                  java.lang.reflect.Field field)
        Initiate.
        Parameters:
        name - Name of the dependency.
        index - Index of the dependency within the ObjectRegistry.
        field - Field to receive the injected dependency.
    • Method Detail

      • getTypeQualifier

        public static java.lang.String getTypeQualifier​(java.lang.String dependencyName,
                                                        java.util.Collection<java.lang.annotation.Annotation> annotations)
                                                 throws java.lang.Exception
        Obtains the qualifier from the set of Annotation instances.
        Parameters:
        dependencyName - Name of the dependency.
        annotations - Annotation instances to interrogate for qualification.
        Returns:
        Qualfiier. May be null if no qualifier.
        Throws:
        java.lang.Exception
      • getTypeQualifier

        public java.lang.String getTypeQualifier()
                                          throws java.lang.Exception
        Obtains the type qualifier for the dependency.
        Returns:
        Type qualifier. May be null if no type qualifier.
        Throws:
        java.lang.Exception - If fails to obtain the type qualifier.
      • injectDependency

        public void injectDependency​(java.lang.Object object,
                                     java.lang.Object dependency)
                              throws java.lang.Exception
        Injects the dependency into the object.
        Parameters:
        object - Object to receive the dependency.
        dependency - Dependency to inject.
        Throws:
        java.lang.Exception - If fails to inject the dependency.