net.sourceforge.cobertura.instrument
Class ClassPattern
java.lang.Object
net.sourceforge.cobertura.instrument.ClassPattern
This class represents a collection of regular expressions that will be used to see
if a classname matches them.
Regular expressions are specified by calling add methods. If no add methods are
called, this class will match any classname.
(package private) void | addExcludeClassesRegex(String regex) - Add a regex to the list of class regexes to exclude.
|
(package private) void | addIncludeClassesRegex(String regex) - Add a regex to the list of class regexes to include.
|
(package private) boolean | isSpecified() - Returns true if any regular expressions have been specified by calling the
add methods.
|
(package private) boolean | matches(String filename) - Check to see if a class matches this ClassPattern
If a pattern has not been specified, this matches anything.
|
private String | removeAnyWebInfClassesString(String filename)
|
addExcludeClassesRegex
(package private) void addExcludeClassesRegex(String regex)
Add a regex to the list of class regexes to exclude.
addIncludeClassesRegex
(package private) void addIncludeClassesRegex(String regex)
Add a regex to the list of class regexes to include.
regex
- A regular expression to add.
isSpecified
(package private) boolean isSpecified()
Returns true if any regular expressions have been specified by calling the
add methods. If none are specified, this class matches anything.
- true if any regular expressions have been specified
matches
(package private) boolean matches(String filename)
Check to see if a class matches this ClassPattern
If a pattern has not been specified, this matches anything.
This method also looks for "WEB-INF/classes" at the beginning of the
classname. It is removed before checking for a match.
filename
- Either a full classname or a full class filename
- true if the classname matches this ClassPattern or if this ClassPattern
has not been specified.