T - self typepublic class HookControlImpl<T> extends java.lang.Object implements HookControl<T>
| Constructor and Description |
|---|
HookControlImpl(T self,
java.lang.Object proxy,
FluentControl control,
ComponentInstantiator instantiator,
java.util.function.Supplier<T> noHookInstanceSupplier)
Creates a new control implementation for hooks.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyHooks(java.lang.Object proxy,
HookChainBuilder hookChainBuilder,
java.util.List<HookDefinition<?>> hookDefinitions)
Apply defined hooks on the proxy.
|
java.util.List<HookDefinition<?>> |
getHookDefinitions()
Get hook definitions.
|
java.util.Stack<java.util.List<HookDefinition<?>>> |
getHookRestoreStack()
Get hook restore stack.
|
T |
noHook()
Disable all hooks from actual element.
|
T |
noHook(java.lang.Class<? extends FluentHook>... hooks)
Disable given hook from actual element.
|
<R> R |
noHook(java.lang.Class<? extends FluentHook> hook,
java.util.function.Function<T,R> function)
Invoke a function with no hook.
|
<R> R |
noHook(java.util.function.Function<T,R> function)
Invoke a function with no hook.
|
T |
noHookInstance()
Creates a new element locator instance with all hooks disabled.
|
T |
noHookInstance(java.lang.Class<? extends FluentHook>... hooks)
Creates a new element locator instance with given hook disabled.
|
static void |
removeHooksFromDefinitions(java.util.Collection<HookDefinition<?>> definitions,
java.lang.Class<? extends FluentHook>... hooksToRemove)
Removes hooks from definitions.
|
T |
restoreHooks()
Retore hooks that were defined initially.
|
void |
setHookRestoreStack(java.util.Stack<java.util.List<HookDefinition<?>>> hookRestoreStack)
Set the hook restore stack.
|
<O,H extends FluentHook<O>> |
withHook(java.lang.Class<H> hook)
Enable a hook with default options.
|
<O,H extends FluentHook<O>> |
withHook(java.lang.Class<H> hook,
O options)
Enable a hook with given options.
|
public HookControlImpl(T self, java.lang.Object proxy, FluentControl control, ComponentInstantiator instantiator, java.util.function.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 java.util.List<HookDefinition<?>> getHookDefinitions()
public java.util.Stack<java.util.List<HookDefinition<?>>> getHookRestoreStack()
public void setHookRestoreStack(java.util.Stack<java.util.List<HookDefinition<?>>> hookRestoreStack)
hookRestoreStack - hook restore stackpublic static void removeHooksFromDefinitions(java.util.Collection<HookDefinition<?>> definitions, java.lang.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(java.lang.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(java.lang.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(java.lang.Class<? extends FluentHook>... hooks)
HookControlnoHook in interface HookControl<T>hooks - hook classes to disableprotected void applyHooks(java.lang.Object proxy,
HookChainBuilder hookChainBuilder,
java.util.List<HookDefinition<?>> hookDefinitions)
proxy - proxyhookChainBuilder - hook chain builderhookDefinitions - hook definitionspublic <R> R noHook(java.util.function.Function<T,R> function)
HookControlnoHook in interface HookControl<T>R - return typefunction - function to invokepublic <R> R noHook(java.lang.Class<? extends FluentHook> hook, java.util.function.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(java.lang.Class<? extends FluentHook>... hooks)
HookControlnoHookInstance in interface HookControl<T>hooks - hook classes to disableCopyright © 2018 FluentLenium. All Rights Reserved.