Class HookDescriptor
- java.lang.Object
-
- com.tonic.analysis.instrumentation.HookDescriptor
-
public class HookDescriptor extends Object
Describes a hook method to be called at instrumentation points.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHookDescriptor.BuilderBuilder for HookDescriptor instances.static classHookDescriptor.HookParameterTypes of parameters that can be passed to hooks.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HookDescriptor.Builderbuilder()Creates a new builder.StringgetDescriptor()InvokeTypegetInvokeType()StringgetName()StringgetOwner()List<HookDescriptor.HookParameter>getParameters()booleanisReplacesValue()static HookDescriptorstaticHook(String owner, String name, String descriptor)Creates a descriptor for a static hook method.
-
-
-
Method Detail
-
getOwner
public String getOwner()
- Returns:
- the owner class of the hook method (internal name, e.g.
"com/example/Hooks")
-
getName
public String getName()
- Returns:
- the name of the hook method
-
getDescriptor
public String getDescriptor()
- Returns:
- the hook method descriptor
-
getInvokeType
public InvokeType getInvokeType()
- Returns:
- the invocation type (typically STATIC)
-
getParameters
public List<HookDescriptor.HookParameter> getParameters()
- Returns:
- the parameters to pass to the hook method
-
isReplacesValue
public boolean isReplacesValue()
- Returns:
- whether the hook's return value should replace the original value
-
staticHook
public static HookDescriptor staticHook(String owner, String name, String descriptor)
Creates a descriptor for a static hook method.- Parameters:
owner- the hook class internal namename- the hook method namedescriptor- the hook method descriptor- Returns:
- the descriptor
-
builder
public static HookDescriptor.Builder builder()
Creates a new builder.- Returns:
- a new Builder
-
-