T - self typepublic class HookControlImpl<T> extends Object implements HookControl<T>
| Constructor and Description |
|---|
HookControlImpl(T self,
Object proxy,
FluentControl control,
ComponentInstantiator instantiator,
com.google.common.base.Supplier<T> noHookInstanceSupplier)
Creates a new control implementation for hooks.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyHooks(Object proxy,
HookChainBuilder hookChainBuilder,
List<HookDefinition<?>> hookDefinitions)
Apply defined hooks on the proxy.
|
List<HookDefinition<?>> |
getHookDefinitions()
Get hook definitions.
|
Stack<List<HookDefinition<?>>> |
getHookRestoreStack()
Get hook restore stack.
|
T |
noHook()
Disable all hooks from actual element.
|
T |
noHook(Class<? extends FluentHook>... hooks)
Disable given hook from actual element.
|
<R> R |
noHook(Class<? extends FluentHook> hook,
com.google.common.base.Function<T,R> function)
Invoke a function with no hook.
|
<R> R |
noHook(com.google.common.base.Function<T,R> function)
Invoke a function with no hook.
|
T |
noHookInstance()
Creates a new element locator instance with all hooks disabled.
|
T |
noHookInstance(Class<? extends FluentHook>... hooks)
Creates a new element locator instance with given hook disabled.
|
static void |
removeHooksFromDefinitions(Collection<HookDefinition<?>> definitions,
Class<? extends FluentHook>... hooksToRemove)
Removes hooks from definitions.
|
T |
restoreHooks()
Retore hooks that were defined initially.
|
void |
setHookRestoreStack(Stack<List<HookDefinition<?>>> hookRestoreStack)
Set the hook restore stack.
|
<O,H extends FluentHook<O>> |
withHook(Class<H> hook)
Enable a hook with default options.
|
<O,H extends FluentHook<O>> |
withHook(Class<H> hook,
O options)
Enable a hook with given options.
|
public HookControlImpl(T self, Object proxy, FluentControl control, ComponentInstantiator instantiator, com.google.common.base.Supplier<T> noHookInstanceSupplier)
self - reference to object returned by chainnable callsproxy - proxy object to apply hooks oncontrol - control interfaceinstantiator - components instantiatornoHookInstanceSupplier - supplier of new instance without any hook.public List<HookDefinition<?>> getHookDefinitions()
public Stack<List<HookDefinition<?>>> getHookRestoreStack()
public void setHookRestoreStack(Stack<List<HookDefinition<?>>> hookRestoreStack)
hookRestoreStack - hook restore stackpublic static void removeHooksFromDefinitions(Collection<HookDefinition<?>> definitions, Class<? extends FluentHook>... hooksToRemove)
definitions - hook definitionshooksToRemove - hooks to removepublic T restoreHooks()
HookControlrestoreHooks in interface HookControl<T>public <O,H extends FluentHook<O>> T withHook(Class<H> hook)
HookControlwithHook in interface HookControl<T>O - Type of the hookH - Type of the hook optionshook - hook class to enablepublic <O,H extends FluentHook<O>> T withHook(Class<H> hook, O options)
HookControlwithHook in interface HookControl<T>O - Type of the hookH - Type of the hook optionshook - hook class to enableoptions - hook options to applypublic T noHook()
HookControlnoHook in interface HookControl<T>public T noHook(Class<? extends FluentHook>... hooks)
HookControlnoHook in interface HookControl<T>hooks - hook classes to disableprotected void applyHooks(Object proxy, HookChainBuilder hookChainBuilder, List<HookDefinition<?>> hookDefinitions)
proxy - proxyhookChainBuilder - hook chain builderhookDefinitions - hook definitionspublic <R> R noHook(com.google.common.base.Function<T,R> function)
HookControlnoHook in interface HookControl<T>R - return typefunction - function to invokepublic <R> R noHook(Class<? extends FluentHook> hook, com.google.common.base.Function<T,R> function)
HookControlnoHook in interface HookControl<T>R - return typehook - hook class to disablefunction - function to invokepublic T noHookInstance()
HookControlnoHookInstance in interface HookControl<T>public T noHookInstance(Class<? extends FluentHook>... hooks)
HookControlnoHookInstance in interface HookControl<T>hooks - hook classes to disableCopyright © 2016 FluentLenium. All Rights Reserved.