|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--edu.ucsb.ccs.jcontractor.PackageLevelInstrumentationFilter
An instrumentation filter that assigns instrumentation level by package (or class, if desired). The filter is given a package name, a class name, and an instrumentation level. The class name may be "*" to match any class in the package or a subpackage. Note that this differs a little from how Java import statements work.
The filter level is how many levels down the package is, so "edu.*" has filter level 1, and "edu.ucsb.ccs.*" has filter level 3. This way, more specific filters override more general filters.
To match classes in the default package, but no other packages, use the "magic" package name "<default>".
| Field Summary |
| Fields inherited from interface edu.ucsb.ccs.jcontractor.InstrumentationFilter |
ALL, NONE, POST, PRE |
| Constructor Summary | |
PackageLevelInstrumentationFilter(java.lang.String classAndPackageName,
int instrumentationLevel)
Create a filter from a class and package string. |
|
PackageLevelInstrumentationFilter(java.lang.String packagename,
java.lang.String classname,
int instrumentationLevel)
Create a new filter. |
|
| Method Summary | |
boolean |
appliesTo(java.lang.String theclass)
Determine if this filter applies to a given class. |
java.lang.String |
getClassName()
Get the name of the class matched by this filter. |
int |
getFilterLevel()
Get the level of this filter. |
int |
getInstrumentationLevel()
Get the instrumentation level assigned to classes that match the filter criteria. |
int |
getInstrumentationLevel(java.lang.String theclass)
Get the instrumentation level to assign to a class that matches the filter criteria. |
java.lang.String |
getPackageName()
Get the name of the package matched by this filter. |
void |
setClassName(java.lang.String name)
Set the name of the class matched by this filter. |
void |
setInstrumentationLevel(int level)
Set the instrumentation level assigned to classes that match the filter criteria. |
void |
setPackageAndClass(java.lang.String packageAndClass)
Set the package and class from a full class name (including package). |
void |
setPackageName(java.lang.String name)
Set the name of the package to match. |
java.lang.String |
toString()
Get a string representation of the filter, for debugging. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PackageLevelInstrumentationFilter(java.lang.String packagename,
java.lang.String classname,
int instrumentationLevel)
packagename - the name of the package to match. If both
package and class are "*", all classes match.classname - the name of the class to match, or "*" to match
any class in any subpackage.instrumentationLevel - the instrumentation level to assign
to classes that match.
public PackageLevelInstrumentationFilter(java.lang.String classAndPackageName,
int instrumentationLevel)
classAndPackageName - the name of the class and package to
match, for example
"edu.ucsb.ccs.jcontractor.jInstrument"
or "edu.ccs.*".instrumentationLevel - the instrumentation level to assign
to classes that match.| Method Detail |
public boolean appliesTo(java.lang.String theclass)
appliesTo in interface InstrumentationFiltertheclass - the name of a class to test (including package
name).
theclass matches the criteria.public int getInstrumentationLevel(java.lang.String theclass)
getInstrumentationLevel in interface InstrumentationFiltertheclass - the name of the class to get the instrumentation
level for.
theclass.setInstrumentationLevel(int),
getInstrumentationLevel()public void setPackageName(java.lang.String name)
name - the new package name.getPackageName()public java.lang.String getPackageName()
setPackageName(String)public void setClassName(java.lang.String name)
name - the name of the class to match.getClassName()public java.lang.String getClassName()
setClassName(String)public void setPackageAndClass(java.lang.String packageAndClass)
public void setInstrumentationLevel(int level)
level - the instrumentation level.getInstrumentationLevel(),
getInstrumentationLevel(String)public int getInstrumentationLevel()
setInstrumentationLevel(int),
getInstrumentationLevel(String)public int getFilterLevel()
getFilterLevel in interface InstrumentationFilterpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||