|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.cobertura.metrics.api.location.SourceLocationFilter
public class SourceLocationFilter
Filter separating valid from invalid SourceLocation instances.
| Constructor Summary | |
|---|---|
SourceLocationFilter()
Creates a SourceLocationFilter instance which accepts all SourceLocations. |
|
SourceLocationFilter(String packagePattern)
Creates a SourceLocationFilter instance with the supplied Java regular expression to be applied within package scope. |
|
SourceLocationFilter(String packagePattern,
String classPattern)
Creates a SourceLocationFilter instance with the supplied Java regular expressions to be applied within the appropriate scope. |
|
SourceLocationFilter(String packagePattern,
String classPattern,
String methodPattern)
Creates a SourceLocationFilter instance with the supplied Java regular expressions to be applied within the appropriate scope. |
|
SourceLocationFilter(String packagePattern,
String classPattern,
String methodPattern,
String lineNumberPattern)
Creates a SourceLocationFilter instance with the supplied Java regular expressions to be applied within the appropriate scope. |
|
SourceLocationFilter(String packagePattern,
String classPattern,
String methodPattern,
String lineNumberPattern,
String branchSegmentPattern)
Creates a SourceLocationFilter instance with the supplied Java regular expressions to be applied within the appropriate scope. |
|
| Method Summary | |
|---|---|
boolean |
accept(SourceLocation candidate)
|
static String |
escapeDots(String patternWithDots)
Convenience method which translates a string containing dots (" ."), such as a
java package name, to a valid Java Regular Expressions where the dots are interpreted
literally. |
static String |
getPattern(Package thePackage,
boolean includeSubPackages)
Convenience method to generate a Java Regular Expression pattern string which includes the supplied Package, and optionally all subpackages to it. |
LocationScope |
getScope()
Retrieves the lowest LocationScope used to filter incoming SourceLocations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SourceLocationFilter()
public SourceLocationFilter(String packagePattern)
null or empty.
packagePattern - The regexp to be matched to SourceLocation package properties.
public SourceLocationFilter(String packagePattern,
String classPattern)
null or empty.
packagePattern - The regexp to be matched to SourceLocation package properties.classPattern - The regexp to be matched to SourceLocation class properties.
public SourceLocationFilter(String packagePattern,
String classPattern,
String methodPattern)
null or empty.
packagePattern - The regexp to be matched to SourceLocation package properties.classPattern - The regexp to be matched to SourceLocation class properties.methodPattern - The regexp to be matched to SourceLocation method properties.
public SourceLocationFilter(String packagePattern,
String classPattern,
String methodPattern,
String lineNumberPattern)
null or empty.
packagePattern - The regexp to be matched to SourceLocation package properties.classPattern - The regexp to be matched to SourceLocation class properties.methodPattern - The regexp to be matched to SourceLocation method properties.lineNumberPattern - The regexp to be matched to SourceLocation line number properties.
public SourceLocationFilter(String packagePattern,
String classPattern,
String methodPattern,
String lineNumberPattern,
String branchSegmentPattern)
null or empty.
packagePattern - The regexp to be matched to SourceLocation package properties.classPattern - The regexp to be matched to SourceLocation class properties.methodPattern - The regexp to be matched to SourceLocation method properties.lineNumberPattern - The regexp to be matched to SourceLocation line number properties.branchSegmentPattern - The regexp to be matched to SourceLocation branch segment index properties.| Method Detail |
|---|
public final LocationScope getScope()
LocationScope.CLASS , then
package name and class name attributes are used to filter SourceLocations (but
method, lineNumber and segment attributes are not).
public boolean accept(SourceLocation candidate)
public static String escapeDots(String patternWithDots)
."), such as a
java package name, to a valid Java Regular Expressions where the dots are interpreted
literally.
patternWithDots - The pattern containing verbatim dots (such as "com.foo.bar.some.package").
"com.foo.bar.some.package" would be transformed into
"com\\.foo\\.bar\\.some\\.package"
public static String getPattern(Package thePackage,
boolean includeSubPackages)
thePackage - The Package to acquire a filter for. Cannot be null.includeSubPackages - if true, generates a pattern string which accepts/hits
subpackages of the supplied Package in addition to the given Package.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||