Class SpringApplicationContextInjectableObjectFactory<T>

  • Type Parameters:
    T -
    Direct Known Subclasses:
    Editor.CockpitEditorRendererFactory

    public class SpringApplicationContextInjectableObjectFactory<T>
    extends java.lang.Object
    Factory enables create an object of a certain type T and inject spring dependencies to the created object
    • Constructor Detail

      • SpringApplicationContextInjectableObjectFactory

        public SpringApplicationContextInjectableObjectFactory​(org.springframework.context.ApplicationContext context,
                                                               java.lang.Class<T> clazz)
        Parameters:
        context - - spring application context to search for dependencies in it
        clazz - - type of new object
    • Method Detail

      • create

        protected T create()
        Creates new object
        Returns:
      • injectDependencies

        protected void injectDependencies​(T obj)
        Injects dependencies to obj
        Parameters:
        obj -
      • createAndInjectDependencies

        public T createAndInjectDependencies()
        Creates new object and then injects dependencies
        Returns: