Class PackageNameMatcher
- java.lang.Object
-
- org.eclipse.tycho.extras.docbundle.PackageNameMatcher
-
public class PackageNameMatcher extends java.lang.ObjectAn utility class for filtering package names.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringdescriptionprivate java.util.List<java.util.regex.Pattern>patterns
-
Constructor Summary
Constructors Modifier Constructor Description privatePackageNameMatcher(java.util.List<java.util.regex.Pattern> patterns)Constructs a new object which matches against the given patterns.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringbuildDescription()private static java.util.regex.PatternbuildPattern(java.lang.String spec)static PackageNameMatchercompile(java.util.List<java.lang.String> specs)Compiles the given list of package name specification strings into a matching object.booleanmatches(java.lang.String packageName)Returns true if the given package name matches against any of the patterns in this matcher.java.lang.StringtoString()
-
-
-
Method Detail
-
compile
public static PackageNameMatcher compile(java.util.List<java.lang.String> specs)
Compiles the given list of package name specification strings into a matching object.If the list is empty, the resulting object will never match any package name, which means that
matches(String)will always returnfalse.- Parameters:
specs- The list of package name specifications. For details on specification syntax see#compile(String).- Returns:
- A new matching object.
- Throws:
java.lang.IllegalArgumentException- Thrown if the given argument isnullor if any of the strings in the list is an invalid package name specification.
-
buildPattern
private static java.util.regex.Pattern buildPattern(java.lang.String spec)
-
buildDescription
private java.lang.String buildDescription()
-
matches
public boolean matches(java.lang.String packageName)
Returns true if the given package name matches against any of the patterns in this matcher.- Returns:
- Always
falseif the given package name isnullor an empty string.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-