public class NamePattern extends Object implements Comparable<NamePattern>
Class.getName()
. Thus
$ is the only inner-type separator supported.Sample | Description |
---|---|
sample.Foo | Matches only sample.Foo |
sample.Foo* | Matches all types in sample starting with "Foo" and all inner-types of Foo |
sample.bar|baz.* | Matches all types in sample.bar and sample.baz |
sample.Foo$* | Matches only inner-types of Foo |
..Foo | Matches all Foo in any package (incl. root package) |
*.*..Foo | Matches all Foo nested in a sub-package |
* | Matches all types in the root package |
..* | Matches all types |
Modifier and Type | Field and Description |
---|---|
static NamePattern |
ANY_NAME |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(NamePattern other)
Make sure name patterns are evaluated in the most useful order
|
boolean |
isAllClasses() |
boolean |
isAny() |
boolean |
isMoreConcreteThan(NamePattern other)
Use a heuristic to check whether this or the other name pattern should be evaluated first.
|
ShortNameMatcher |
matcher() |
boolean |
matches(String name)
Matches 'name' against the pattern.
|
static NamePattern |
of(String pattern) |
String |
toString() |
public static final NamePattern ANY_NAME
public static NamePattern of(String pattern)
public boolean isAny()
public boolean isAllClasses()
public boolean matches(String name)
name
- the identifier to matchpublic ShortNameMatcher matcher()
public boolean isMoreConcreteThan(NamePattern other)
other
- the other patternpublic int compareTo(NamePattern other)
compareTo
in interface Comparable<NamePattern>
other
- the object to be compared.Copyright © 2017–2023 Hans Jörg Heßmann. All rights reserved.