Class AbstractStrictPatternArtifactFilter
- java.lang.Object
-
- org.apache.maven.shared.artifact.filter.AbstractStrictPatternArtifactFilter
-
- All Implemented Interfaces:
org.apache.maven.artifact.resolver.filter.ArtifactFilter
- Direct Known Subclasses:
StrictPatternExcludesArtifactFilter,StrictPatternIncludesArtifactFilter
public abstract class AbstractStrictPatternArtifactFilter extends java.lang.Object implements org.apache.maven.artifact.resolver.filter.ArtifactFilterFilter to include or exclude artifacts from a list of patterns. The artifact pattern syntax is of the form:[groupId]:[artifactId]:[type]:[version]
Where each pattern segment is optional and supports full and partial
*wildcards. An empty pattern segment is treated as an implicit wildcard.For example,
org.apache.*would match all artifacts whose group id started withorg.apache., and:::*-SNAPSHOTwould match all snapshot artifacts.
-
-
Constructor Summary
Constructors Constructor Description AbstractStrictPatternArtifactFilter(java.util.List<java.lang.String> patterns, boolean include)Creates a new filter that matches the specified artifact patterns and includes or excludes them according to the specified flag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaninclude(org.apache.maven.artifact.Artifact artifact)private booleaninclude(org.apache.maven.artifact.Artifact artifact, java.lang.String pattern)Gets whether the specified artifact matches the specified pattern.private booleanisVersionIncludedInRange(java.lang.String version, java.lang.String range)private booleanmatches(java.lang.String token, java.lang.String pattern)Gets whether the specified token matches the specified pattern segment.
-
-
-
Constructor Detail
-
AbstractStrictPatternArtifactFilter
public AbstractStrictPatternArtifactFilter(java.util.List<java.lang.String> patterns, boolean include)Creates a new filter that matches the specified artifact patterns and includes or excludes them according to the specified flag.- Parameters:
patterns- the list of artifact patterns to match, as described aboveinclude-trueto include artifacts that match the patterns, orfalseto exclude them
-
-
Method Detail
-
include
public boolean include(org.apache.maven.artifact.Artifact artifact)
- Specified by:
includein interfaceorg.apache.maven.artifact.resolver.filter.ArtifactFilter
-
include
private boolean include(org.apache.maven.artifact.Artifact artifact, java.lang.String pattern)Gets whether the specified artifact matches the specified pattern.- Parameters:
artifact- the artifact to checkpattern- the pattern to match, as defined above- Returns:
trueif the specified artifact is matched by the specified pattern
-
matches
private boolean matches(java.lang.String token, java.lang.String pattern)Gets whether the specified token matches the specified pattern segment.- Parameters:
token- the token to checkpattern- the pattern segment to match, as defined above- Returns:
trueif the specified token is matched by the specified pattern segment
-
isVersionIncludedInRange
private boolean isVersionIncludedInRange(java.lang.String version, java.lang.String range)
-
-