Package com.consol.citrus.context
Class SpringBeanReferenceResolver
- java.lang.Object
-
- com.consol.citrus.context.SpringBeanReferenceResolver
-
- All Implemented Interfaces:
com.consol.citrus.spi.ReferenceRegistry
,com.consol.citrus.spi.ReferenceResolver
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class SpringBeanReferenceResolver extends Object implements com.consol.citrus.spi.ReferenceResolver, org.springframework.context.ApplicationContextAware
Spring bean reference resolver operates on given application context to resolve bean references.- Since:
- 2.5
- Author:
- Christoph Deppisch
-
-
Constructor Summary
Constructors Constructor Description SpringBeanReferenceResolver()
Default constructor.SpringBeanReferenceResolver(org.springframework.context.ApplicationContext applicationContext)
Constructor initializes with given application context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(String name, Object value)
org.springframework.context.ApplicationContext
getApplicationContext()
Obtains the applicationContext.boolean
isResolvable(Class<?> type)
boolean
isResolvable(String name)
boolean
isResolvable(String name, Class<?> type)
<T> T
resolve(Class<T> requiredType)
Object
resolve(String name)
<T> T
resolve(String name, Class<T> type)
<T> Map<String,T>
resolveAll(Class<T> requiredType)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setFallback(com.consol.citrus.spi.ReferenceResolver fallback)
Specifies the fallback.SpringBeanReferenceResolver
withFallback(com.consol.citrus.spi.ReferenceResolver fallback)
Specifies the fallback.
-
-
-
Constructor Detail
-
SpringBeanReferenceResolver
public SpringBeanReferenceResolver()
Default constructor.
-
SpringBeanReferenceResolver
public SpringBeanReferenceResolver(org.springframework.context.ApplicationContext applicationContext)
Constructor initializes with given application context.- Parameters:
applicationContext
-
-
-
Method Detail
-
resolve
public <T> T resolve(Class<T> requiredType)
- Specified by:
resolve
in interfacecom.consol.citrus.spi.ReferenceResolver
-
resolve
public <T> T resolve(String name, Class<T> type)
- Specified by:
resolve
in interfacecom.consol.citrus.spi.ReferenceResolver
-
resolve
public Object resolve(String name)
- Specified by:
resolve
in interfacecom.consol.citrus.spi.ReferenceResolver
-
resolveAll
public <T> Map<String,T> resolveAll(Class<T> requiredType)
- Specified by:
resolveAll
in interfacecom.consol.citrus.spi.ReferenceResolver
-
isResolvable
public boolean isResolvable(String name)
- Specified by:
isResolvable
in interfacecom.consol.citrus.spi.ReferenceResolver
-
isResolvable
public boolean isResolvable(Class<?> type)
- Specified by:
isResolvable
in interfacecom.consol.citrus.spi.ReferenceResolver
-
isResolvable
public boolean isResolvable(String name, Class<?> type)
- Specified by:
isResolvable
in interfacecom.consol.citrus.spi.ReferenceResolver
-
withFallback
public SpringBeanReferenceResolver withFallback(com.consol.citrus.spi.ReferenceResolver fallback)
Specifies the fallback.- Parameters:
fallback
-
-
bind
public void bind(String name, Object value)
- Specified by:
bind
in interfacecom.consol.citrus.spi.ReferenceRegistry
-
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
-
setFallback
public void setFallback(com.consol.citrus.spi.ReferenceResolver fallback)
Specifies the fallback.- Parameters:
fallback
-
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
Obtains the applicationContext.- Returns:
-
-