Class FieldReadHook
- java.lang.Object
-
- com.tonic.analysis.instrumentation.hook.FieldReadHook
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldReadHook.BuilderFluent builder forFieldReadHookinstances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FieldReadHook.Builderbuilder()Creates a builder for a field read hook.List<InstrumentationFilter>getFilters()HookDescriptorgetHookDescriptor()intgetPriority()Gets the priority for ordering multiple hooks at the same point.InstrumentationTargetgetTarget()booleanisEnabled()booleanisInstrumentInstance()booleanisInstrumentStatic()booleanisPassFieldName()booleanisPassOwner()booleanisPassReadValue()static FieldReadHooksimple(String hookOwner, String hookName, String hookDescriptor)Creates a field read hook that invokes the given static hook method.
-
-
-
Method Detail
-
getHookDescriptor
public HookDescriptor getHookDescriptor()
- Specified by:
getHookDescriptorin interfaceHook- Returns:
- the hook descriptor
-
getFilters
public List<InstrumentationFilter> getFilters()
- Specified by:
getFiltersin interfaceHook- Returns:
- the filters
-
isEnabled
public boolean isEnabled()
-
getPriority
public int getPriority()
Description copied from interface:HookGets the priority for ordering multiple hooks at the same point.- Specified by:
getPriorityin interfaceHook- Returns:
- the priority
-
isPassOwner
public boolean isPassOwner()
- Returns:
- whether the field's owning object (null for static fields) is passed to the hook
-
isPassFieldName
public boolean isPassFieldName()
- Returns:
- whether the field name is passed to the hook
-
isPassReadValue
public boolean isPassReadValue()
- Returns:
- whether the value that was read (boxed if primitive) is passed to the hook
-
isInstrumentStatic
public boolean isInstrumentStatic()
- Returns:
- whether static field reads are instrumented
-
isInstrumentInstance
public boolean isInstrumentInstance()
- Returns:
- whether instance field reads are instrumented
-
getTarget
public InstrumentationTarget getTarget()
-
simple
public static FieldReadHook simple(String hookOwner, String hookName, String hookDescriptor)
Creates a field read hook that invokes the given static hook method.- Parameters:
hookOwner- the hook method's owning class (internal name)hookName- the hook method namehookDescriptor- the hook method descriptor- Returns:
- the new hook
-
builder
public static FieldReadHook.Builder builder()
Creates a builder for a field read hook.- Returns:
- a new builder
-
-