Class ArrayStoreHook.Builder
- java.lang.Object
-
- com.tonic.analysis.instrumentation.hook.ArrayStoreHook.Builder
-
- Enclosing class:
- ArrayStoreHook
public static class ArrayStoreHook.Builder extends Object
Fluent builder forArrayStoreHookinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayStoreHook.BuilderarrayTypeFilter(String arrayTypeFilter)Sets the array element type filter; null instruments all array types.ArrayStoreHookbuild()Builds the configured array store hook.ArrayStoreHook.BuildercanModifyValue(boolean canModifyValue)Sets whether the hook's return value replaces the stored value.ArrayStoreHook.Builderenabled(boolean enabled)Sets whether the hook is active.ArrayStoreHook.Builderfilters(List<InstrumentationFilter> filters)Sets the filters that restrict which code is instrumented.ArrayStoreHook.BuilderhookDescriptor(HookDescriptor hookDescriptor)Sets the hook method invoked at each instrumented array store.ArrayStoreHook.BuilderpassArray(boolean passArray)Sets whether the array reference is passed to the hook.ArrayStoreHook.BuilderpassIndex(boolean passIndex)Sets whether the array index is passed to the hook.ArrayStoreHook.BuilderpassValue(boolean passValue)Sets whether the stored value is passed to the hook.ArrayStoreHook.Builderpriority(int priority)Sets the ordering priority relative to other hooks.
-
-
-
Method Detail
-
hookDescriptor
public ArrayStoreHook.Builder hookDescriptor(HookDescriptor hookDescriptor)
Sets the hook method invoked at each instrumented array store.- Parameters:
hookDescriptor- the hook method descriptor- Returns:
- this builder
-
filters
public ArrayStoreHook.Builder filters(List<InstrumentationFilter> filters)
Sets the filters that restrict which code is instrumented.- Parameters:
filters- the instrumentation filters- Returns:
- this builder
-
enabled
public ArrayStoreHook.Builder enabled(boolean enabled)
Sets whether the hook is active.- Parameters:
enabled- true to enable the hook- Returns:
- this builder
-
priority
public ArrayStoreHook.Builder priority(int priority)
Sets the ordering priority relative to other hooks.- Parameters:
priority- the priority value- Returns:
- this builder
-
passArray
public ArrayStoreHook.Builder passArray(boolean passArray)
Sets whether the array reference is passed to the hook.- Parameters:
passArray- true to pass the array reference- Returns:
- this builder
-
passIndex
public ArrayStoreHook.Builder passIndex(boolean passIndex)
Sets whether the array index is passed to the hook.- Parameters:
passIndex- true to pass the index- Returns:
- this builder
-
passValue
public ArrayStoreHook.Builder passValue(boolean passValue)
Sets whether the stored value is passed to the hook.- Parameters:
passValue- true to pass the stored value- Returns:
- this builder
-
canModifyValue
public ArrayStoreHook.Builder canModifyValue(boolean canModifyValue)
Sets whether the hook's return value replaces the stored value.- Parameters:
canModifyValue- true to let the hook substitute the value- Returns:
- this builder
-
arrayTypeFilter
public ArrayStoreHook.Builder arrayTypeFilter(String arrayTypeFilter)
Sets the array element type filter; null instruments all array types.- Parameters:
arrayTypeFilter- the array type descriptor to match- Returns:
- this builder
-
build
public ArrayStoreHook build()
Builds the configured array store hook.- Returns:
- the new hook
-
-