Class ApplicationContextAccessor
- java.lang.Object
-
- org.craftercms.commons.spring.context.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 ofApplicationContext
and provides simple access to beans for Groovy & Freemarker- Since:
- 4.0
- Author:
- joseross
-
-
Constructor Summary
Constructors Constructor Description ApplicationContextAccessor()
ApplicationContextAccessor(org.springframework.context.ApplicationContext actualApplicationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get(String beanName)
<T> T
get(String beanName, Class<T> requiredType)
protected org.springframework.context.ApplicationContext
getApplicationContext()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
getApplicationContext
protected org.springframework.context.ApplicationContext getApplicationContext()
-
-