public class InstrumentationDescriptor extends Object
InstrumentationDescriptor holds those Instrumentations which use the same Rules. Rules define which classes is to be instrumented.
Constructor and Description |
---|
InstrumentationDescriptor() |
Modifier and Type | Method and Description |
---|---|
void |
addExclusionRule(String rule)
Adds an exclusion rule to this descriptor.
|
void |
addInclusionRule(String rule)
Adds a rule to this descriptor.
|
void |
addInstrumentor(Instrumentor instrumentor)
Adds a new Instrumentor
|
Set<Rule> |
getExclusionsRules()
Gets the inclusion rules of this descriptor.
|
Set<Rule> |
getInclusionsRules()
Gets the inclusion rules of this descriptor.
|
List<Instrumentor> |
getInstrumentors()
Gets all the Instrumentors.
|
boolean |
match(String className)
Check whether the given className matches any of given rules.
|
String |
toString() |
public void addInstrumentor(Instrumentor instrumentor)
instrumentor
- Instrumentor that is used in instrumentingpublic List<Instrumentor> getInstrumentors()
public void addInclusionRule(String rule) throws JiapiException
Format of the rule is the same, as fully qualified Java package/class/method names. For example, following are valid rules:
rule
- A Inclusion rule, that is to be added to this descriptorJiapiException
- thrown if there's a syntax error in rulepublic Set<Rule> getInclusionsRules()
public void addExclusionRule(String rule) throws JiapiException
In general Exclusion rules are more powerful than inclusion rules. That is, if for some reason two similar rules are assigned to both exclusion and inclusion rules, exclusion rule will win.
rule
- A Exclusion rule, that is to be added to this descriptorJiapiException
- thrown if there's a syntax error in rulepublic Set<Rule> getExclusionsRules()
public boolean match(String className)
className
- a class nameCopyright © 2017. All rights reserved.