Class SpringApplicationContextDependencyResolver<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    DependencyResolver<T>

    public class SpringApplicationContextDependencyResolver<T>
    extends java.lang.Object
    implements DependencyResolver<T>
    Resolves dependencies based on Spring Application Context and injects them to non-spring beans.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void injectDependencies​(T obj)
      Injects spring dependencies to object which does not have to be spring-managed bean.
      • Methods inherited from class java.lang.Object

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

      • SpringApplicationContextDependencyResolver

        public SpringApplicationContextDependencyResolver​(org.springframework.context.ApplicationContext context)
        Parameters:
        context - - spring application context to search for dependencies in it
    • Method Detail

      • injectDependencies

        public void injectDependencies​(T obj)
        Injects spring dependencies to object which does not have to be spring-managed bean. Dependencies are provided for well known annotations like: Resource, Autowired.
        Specified by:
        injectDependencies in interface DependencyResolver<T>
        Parameters:
        obj - - object to inject dependencies