public static class Rule.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(java.lang.String classMatchString) |
Modifier and Type | Method and Description |
---|---|
Rule.Builder |
atField(java.lang.String name,
boolean read,
int occurrence)
This method is used to define a field to instrument.
|
Rule.Builder |
atLineNumber(int lineNum)
This method is used to define a specific line number in the file to instrument.
|
Rule.Builder |
atLocalVariable(java.lang.String name,
boolean read,
int occurrence)
This method is used to define a local variable to instrument.
|
Rule.Builder |
atMethodInvocation(java.lang.String name,
int occurrence)
This method is used to define a method invocation to instrument.
|
Rule |
build()
The method that returns a
Rule object |
Rule.Builder |
classMatchType(SDKClassMatchType type) |
Rule.Builder |
classStringMatchType(SDKStringMatchType type) |
Rule.Builder |
collectLocalVariables(java.lang.String[] vars)
This method is used to define what local variables you want to collect.
|
Rule.Builder |
isAbsoluteLineNumber(boolean isAbsLineNum)
This method is used to define whether the line number specified by
atLineNumber(int) is an
absolute line number or a relative line number relative to the start of the method. |
Rule.Builder |
isInstrumentBefore(boolean before)
This method is used to define whether you are instrumenting before or after the specified point.
|
Rule.Builder |
methodMatchString(java.lang.String string) |
Rule.Builder |
methodStringMatchType(SDKStringMatchType type) |
Rule.Builder |
withParams(java.lang.String... classNames)
Specify the exact parameters to match.
|
public Rule.Builder classMatchType(SDKClassMatchType type)
public Rule.Builder classStringMatchType(SDKStringMatchType type)
public Rule.Builder methodStringMatchType(SDKStringMatchType type)
public Rule.Builder methodMatchString(java.lang.String string)
public Rule.Builder withParams(java.lang.String... classNames)
classNames
- The fully qualified classnames of the parameters for the method being instrumentedRule.Builder
NOTE: If withParams(String...)
is called for the builder, method match type is ignored
and behave as though SDKStringMatchType.EQUALS
is set.public Rule.Builder atLineNumber(int lineNum)
isAbsoluteLineNumber(boolean)
lineNum
- the line numberisAbsoluteLineNumber(boolean)
public Rule.Builder isAbsoluteLineNumber(boolean isAbsLineNum)
atLineNumber(int)
is an
absolute line number or a relative line number relative to the start of the method.
Note that the start of the method is the first "meaningful" instruction. Variable declaration,
as opposed to instantiation, is not a "meaningful" instruction.isAbsLineNum
- true if the line number is absolutepublic Rule.Builder atLocalVariable(java.lang.String name, boolean read, int occurrence)
name
- the name of the local variable.read
- true if we are matching a local variable read, false for write.occurrence
- the number of occurrences of the local variable read or write.public Rule.Builder atField(java.lang.String name, boolean read, int occurrence)
name
- the name of the field.read
- true if we are matching a field read, false for write.occurrence
- the number of occurrences of the field read or write.public Rule.Builder atMethodInvocation(java.lang.String name, int occurrence)
name
- the name of the method invoked.occurrence
- the number of times the method was invoked.public Rule.Builder isInstrumentBefore(boolean before)
before
- true if you are instrumenting before the pointpublic Rule.Builder collectLocalVariables(java.lang.String[] vars)
vars
- the array of local variable names