Class ApplicationContextAccessor

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class ApplicationContextAccessor
    extends Object
    implements org.springframework.context.ApplicationContextAware
    Wraps an instance of ApplicationContext and provides simple access to beans for Groovy & Freemarker
    Since:
    4.0
    Author:
    joseross
    • Constructor Detail

      • ApplicationContextAccessor

        public ApplicationContextAccessor()
      • ApplicationContextAccessor

        public ApplicationContextAccessor​(org.springframework.context.ApplicationContext actualApplicationContext)
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • get

        public <T> T get​(String beanName,
                         Class<T> requiredType)
      • getApplicationContext

        protected org.springframework.context.ApplicationContext getApplicationContext()