public final class PackageMatcher
extends java.lang.Object
'..pack..'
matches 'a.pack'
, 'a.pack.b'
or 'a.b.pack.c.d'
,
but not 'a.packa.b'
'*.pack.*'
matches 'a.pack.b'
, but not 'a.b.pack.c'
'..*pack*..'
matches 'a.prepackfix.b'
'*.*.pack*..'
matches 'a.b.packfix.c.d'
,
but neither 'a.packfix.b'
nor 'a.b.prepack.d'
'..service.(*)..'
matches 'a.service.hello.b'
and group 1 would be 'hello'
'..service.(**)'
matches 'a.service.hello.more'
and group 1 would be 'hello.more'
'my.(*)..service.(**)'
matches 'my.company.some.service.hello.more'
and group 1 would be 'company'
, while group 2 would be 'hello.more'
PackageMatcher.of(packageIdentifier)
Modifier and Type | Class and Description |
---|---|
static class |
PackageMatcher.Result |
Modifier and Type | Field and Description |
---|---|
static Function<PackageMatcher.Result,java.util.List<java.lang.String>> |
TO_GROUPS |
Modifier and Type | Method and Description |
---|---|
Optional<PackageMatcher.Result> |
match(java.lang.String aPackage)
Returns a matching
Result
against the provided package name. |
boolean |
matches(java.lang.String aPackage) |
static PackageMatcher |
of(java.lang.String packageIdentifier)
Creates a new
PackageMatcher |
java.lang.String |
toString() |
public static final Function<PackageMatcher.Result,java.util.List<java.lang.String>> TO_GROUPS
public static PackageMatcher of(java.lang.String packageIdentifier)
PackageMatcher
packageIdentifier
- The package literal to match against (e.g. 'some*..pk*'
--> 'somewhere.in.some.pkg'
)PackageMatcher
to match packages against the supplied literal
supporting AspectJ syntaxpublic boolean matches(java.lang.String aPackage)
public Optional<PackageMatcher.Result> match(java.lang.String aPackage)
Result
against the provided package name. If the package identifier of this PackageMatcher
does not match the
given package name, then Optional.absent()
is returned.aPackage
- The package name to match againstResult
if the package name matches,
otherwise Optional.absent()
public java.lang.String toString()
toString
in class java.lang.Object