public class VaniContext extends Object
| Constructor and Description |
|---|
VaniContext() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createBean(Class<T> beanClass)
method to instantiate specified class and resolve all annotated
dependencies.
|
org.openqa.selenium.WebDriver |
createDefaultDriver()
method to generate and register
FirefoxDriver. |
org.springframework.context.ApplicationContext |
getAppContext() |
org.springframework.core.env.Environment |
getEnvironment() |
org.reflections.Reflections |
getReflections() |
<T> TypeHandler<T,?> |
getTypeHandlerFor(Class<T> targetType)
This method will look for a registered
TypeHandler, which is able
to handle provided type. |
protected void |
initJsTypeHandler()
This method will look for all classes annotated with
JsTypeHandler and instantiates and registers found classes to
VaniContext. |
boolean |
isProfileEnabled(org.springframework.context.annotation.Profile profileAnnotation)
method to check whether at least one profile of provided profile
annotation is active.
|
protected void |
registerJavaScripts()
This method will scan classpath for all classes annotated with
JavaScript.The corresponding source of each found interface will
be loaded and the dependencies (specified by JavaScriptDependency
and plugins will also be assigned. |
void |
registerTypeHandler(TypeHandler typeHandler)
This method will register provided
TypeHandler to
VaniContext. |
String |
resolveExpression(String expr)
method tries to resolve given SpEl-expression.
|
void |
setAppContext(org.springframework.context.ApplicationContext appContext) |
void |
setConfigurableBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableBeanFactory) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
void |
setJsLoader(JavaScriptLoader jsLoader) |
void |
setJsProxyFactory(JavaScriptProxyFactory jsProxyFactory) |
void |
setReflections(org.reflections.Reflections reflections) |
void |
shutdownWebDrivers() |
public org.reflections.Reflections getReflections()
public void setReflections(org.reflections.Reflections reflections)
public org.springframework.core.env.Environment getEnvironment()
public void setEnvironment(org.springframework.core.env.Environment environment)
public org.springframework.context.ApplicationContext getAppContext()
public void setAppContext(org.springframework.context.ApplicationContext appContext)
public void setConfigurableBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory configurableBeanFactory)
public boolean isProfileEnabled(org.springframework.context.annotation.Profile profileAnnotation)
profileAnnotation - profileAnnotation is NULL false will be returned.public String resolveExpression(String expr)
expr - expression with SpEl-expressionspublic org.openqa.selenium.WebDriver createDefaultDriver()
FirefoxDriver.FirefoxDriver)@PostConstruct protected void registerJavaScripts()
This method will scan classpath for all classes annotated with
JavaScript.The corresponding source of each found interface will
be loaded and the dependencies (specified by JavaScriptDependency
and plugins will also be assigned.
For each js-interface, a proxy will be created and registered as singelton spring bean. The registered bean name is equal to uncapitalized class name.
After that, all available TypeHandler annotated with
JsTypeHandler are registered.
protected void initJsTypeHandler()
JsTypeHandler and instantiates and registers found classes to
VaniContext.
The dependencies of the handler instance will also be resolved by spring during instantiation.
public <T> T createBean(Class<T> beanClass)
beanClass - public void registerTypeHandler(TypeHandler typeHandler)
TypeHandler to
VaniContext.
If there is already a registered handler for the target type of given handler, it will be replaced with specified one.
typeHandler - TypeHandler for registration (if you provide
NULL, value will be skipped)public <T> TypeHandler<T,?> getTypeHandlerFor(Class<T> targetType)
TypeHandler, which is able
to handle provided type.targetType - type, which should be handledTypeHandler for provided type or
NULL if no appropriate handler is registered.@PreDestroy public void shutdownWebDrivers()
@Autowired public void setJsLoader(JavaScriptLoader jsLoader)
@Autowired public void setJsProxyFactory(JavaScriptProxyFactory jsProxyFactory)
Copyright © 2016. All rights reserved.