T - public class DefaultPageHandler<T> extends Object implements PageHandler<T>
| Modifier and Type | Field and Description |
|---|---|
protected T |
handler |
protected org.apache.commons.logging.Log |
logger |
protected Map<Pattern,Method> |
methodMap |
protected RegionFactory |
regionFactory |
protected VaniContext |
vaniContext |
| Constructor and Description |
|---|
DefaultPageHandler(T handler,
VaniContext vaniContext) |
| Modifier and Type | Method and Description |
|---|---|
protected Method |
getApplicable(String url)
This method looks for the best matching url pattern.
|
Set<String> |
getUrlPatterns() |
void |
handle(String url,
org.openqa.selenium.WebDriver webDriver)
This method will look for the best matching handler and invoke it.
|
boolean |
isApplicable(String url)
Method checks whether underlying handler has a handler method for
provided url.
|
protected void |
setMethodMap(Map<Pattern,Method> methodMap)
This method will set the method mapping between url mappings and its
handler methods.
|
protected org.apache.commons.logging.Log logger
protected T handler
protected VaniContext vaniContext
protected RegionFactory regionFactory
public DefaultPageHandler(T handler, VaniContext vaniContext)
protected void setMethodMap(Map<Pattern,Method> methodMap)
If you provide NULL as parameter, current map will only be
cleared
methodMap - mapping between url pattern and handler methodpublic boolean isApplicable(String url)
PageHandlerisApplicable in interface PageHandler<T>protected Method getApplicable(String url)
Matcher.group() and use the group with the max length.url - NULL if no match could be found.public void handle(String url, org.openqa.selenium.WebDriver webDriver)
PageHandlerhandle in interface PageHandler<T>public Set<String> getUrlPatterns()
getUrlPatterns in interface PageHandler<T>Copyright © 2016. All rights reserved.