Class Instrumenter.FieldReadHookBuilder
- java.lang.Object
-
- com.tonic.analysis.instrumentation.Instrumenter.FieldReadHookBuilder
-
- Enclosing class:
- Instrumenter
public static class Instrumenter.FieldReadHookBuilder extends Object
Fluent builder for a field read hook.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instrumenter.FieldReadHookBuildercallStatic(String owner, String name, String descriptor)Sets the static method the hook dispatches to.Instrumenter.FieldReadHookBuilderforField(String fieldName)Restricts this hook to one field name.Instrumenter.FieldReadHookBuilderinClass(String className)Restricts this hook to a single class.Instrumenter.FieldReadHookBuilderinPackage(String packagePrefix)Restricts this hook to classes under a package.Instrumenter.FieldReadHookBuilderinstanceOnly()Instruments instance field reads only.Instrumenter.FieldReadHookBuilderpriority(int priority)Sets the ordering priority of this hook against others at the same site.Instrumenterregister()Attaches the collected filters and registers the hook.Instrumenter.FieldReadHookBuilderstaticOnly()Instruments static field reads only.Instrumenter.FieldReadHookBuilderwithFieldName()Passes the field name as a hook argument.Instrumenter.FieldReadHookBuilderwithOwner()Passes the field owner as a hook argument.Instrumenter.FieldReadHookBuilderwithReadValue()Passes the value read as a hook argument.
-
-
-
Method Detail
-
inClass
public Instrumenter.FieldReadHookBuilder inClass(String className)
Restricts this hook to a single class.- Parameters:
className- the internal class name- Returns:
- this builder
-
inPackage
public Instrumenter.FieldReadHookBuilder inPackage(String packagePrefix)
Restricts this hook to classes under a package.- Parameters:
packagePrefix- the internal package name prefix- Returns:
- this builder
-
forField
public Instrumenter.FieldReadHookBuilder forField(String fieldName)
Restricts this hook to one field name.- Parameters:
fieldName- the field name- Returns:
- this builder
-
staticOnly
public Instrumenter.FieldReadHookBuilder staticOnly()
Instruments static field reads only.- Returns:
- this builder
-
instanceOnly
public Instrumenter.FieldReadHookBuilder instanceOnly()
Instruments instance field reads only.- Returns:
- this builder
-
callStatic
public Instrumenter.FieldReadHookBuilder callStatic(String owner, String name, String descriptor)
Sets the static method the hook dispatches to.- Parameters:
owner- internal name of the class declaring the hook methodname- the hook method namedescriptor- the hook method descriptor- Returns:
- this builder
-
withOwner
public Instrumenter.FieldReadHookBuilder withOwner()
Passes the field owner as a hook argument.- Returns:
- this builder
-
withFieldName
public Instrumenter.FieldReadHookBuilder withFieldName()
Passes the field name as a hook argument.- Returns:
- this builder
-
withReadValue
public Instrumenter.FieldReadHookBuilder withReadValue()
Passes the value read as a hook argument.- Returns:
- this builder
-
priority
public Instrumenter.FieldReadHookBuilder priority(int priority)
Sets the ordering priority of this hook against others at the same site.- Parameters:
priority- the priority value- Returns:
- this builder
-
register
public Instrumenter register()
Attaches the collected filters and registers the hook.- Returns:
- the instrumenter this builder came from
-
-