Class AbstractArtifactFeatureFilter
java.lang.Object
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactsFilter
org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
- All Implemented Interfaces:
ArtifactsFilter
- Direct Known Subclasses:
ArtifactIdFilter
,ClassifierFilter
,GroupIdFilter
,TypeFilter
This is the common base class of ClassifierFilter and TypeFilter
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractArtifactFeatureFilter
(String include, String exclude) Constructor for AbstractArtifactFeatureFilter. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
compareFeatures
(String lhs, String rhs) Allows Feature comparison to be customizedSet
<org.apache.maven.artifact.Artifact> filter.private Set
<org.apache.maven.artifact.Artifact> filterExcludes
(Set<org.apache.maven.artifact.Artifact> artifacts, List<String> theExcludes) Processes the dependencies list and excludes the dependencies that match a filter in the list.private Set
<org.apache.maven.artifact.Artifact> filterIncludes
(Set<org.apache.maven.artifact.Artifact> artifacts, List<String> theIncludes) Processes the dependencies list and includes the dependencies that match a filter in the list.protected abstract String
getArtifactFeature
(org.apache.maven.artifact.Artifact artifact) Should return the type or classifier of the given artifact, so that we can filter itGetter for the fieldexcludes
.Getter for the fieldincludes
.void
setExcludes
(String excludeString) Setter for the fieldexcludes
.void
setIncludes
(String includeString) Setter for the fieldincludes
.Methods inherited from class org.apache.maven.shared.artifact.filter.collection.AbstractArtifactsFilter
isArtifactIncluded
-
Field Details
-
includes
The list of types or classifiers to include -
excludes
The list of types or classifiers to exclude (ignored if includes != null)
-
-
Constructor Details
-
AbstractArtifactFeatureFilter
Constructor for AbstractArtifactFeatureFilter.
- Parameters:
include
- comma separated list with includes.exclude
- comma separated list with excludes.
-
-
Method Details
-
filter
public Set<org.apache.maven.artifact.Artifact> filter(Set<org.apache.maven.artifact.Artifact> artifacts) filter.
This function determines if filtering needs to be performed. Includes are processed before Excludes.- Parameters:
artifacts
-Artifact
- Returns:
- Set of artifacts.
-
filterIncludes
private Set<org.apache.maven.artifact.Artifact> filterIncludes(Set<org.apache.maven.artifact.Artifact> artifacts, List<String> theIncludes) Processes the dependencies list and includes the dependencies that match a filter in the list.- Parameters:
artifacts
- List of dependencies.theIncludes
- List of types or classifiers to include.- Returns:
- a set of filtered artifacts.
-
filterExcludes
private Set<org.apache.maven.artifact.Artifact> filterExcludes(Set<org.apache.maven.artifact.Artifact> artifacts, List<String> theExcludes) Processes the dependencies list and excludes the dependencies that match a filter in the list.- Parameters:
artifacts
- List of dependencies.theExcludes
- List of types or classifiers to exclude.- Returns:
- a set of filtered artifacts.
-
getArtifactFeature
Should return the type or classifier of the given artifact, so that we can filter it- Parameters:
artifact
- artifact to return type or classifier of- Returns:
- type or classifier
-
setExcludes
Setter for the field
excludes
.- Parameters:
excludeString
- comma separated list with excludes.
-
setIncludes
Setter for the field
includes
.- Parameters:
includeString
- comma separated list with includes.
-
getExcludes
Getter for the field
excludes
.- Returns:
- Returns the excludes.
-
getIncludes
Getter for the field
includes
.- Returns:
- Returns the includes.
-
compareFeatures
Allows Feature comparison to be customized- Parameters:
lhs
- String artifact's featurerhs
- String feature from exclude or include list- Returns:
- boolean true if features match
-