org.apache.maven.shared.artifact.filter.collection
Class AbstractArtifactFeatureFilter

java.lang.Object
  extended by org.apache.maven.shared.artifact.filter.collection.AbstractArtifactsFilter
      extended by org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
All Implemented Interfaces:
ArtifactsFilter
Direct Known Subclasses:
ArtifactIdFilter, ClassifierFilter, GroupIdFilter, TypeFilter

public abstract class AbstractArtifactFeatureFilter
extends AbstractArtifactsFilter

This is the common base class of ClassifierFilter and TypeFilter

Version:
$Id: AbstractArtifactFeatureFilter.java 766157 2009-04-17 21:09:16Z pgier $
Author:
Richard van der Hoff

Constructor Summary
AbstractArtifactFeatureFilter(String include, String exclude)
           
 
Method Summary
protected  boolean compareFeatures(String lhs, String rhs)
          Allows Feature comparison to be customized
 Set filter(Set artifacts)
          This function determines if filtering needs to be performed.
protected abstract  String getArtifactFeature(Artifact artifact)
          Should return the type or classifier of the given artifact, so that we can filter it
 List getExcludes()
           
 List getIncludes()
           
 void setExcludes(String excludeString)
           
 void setIncludes(String includeString)
           
 
Methods inherited from class org.apache.maven.shared.artifact.filter.collection.AbstractArtifactsFilter
isArtifactIncluded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractArtifactFeatureFilter

public AbstractArtifactFeatureFilter(String include,
                                     String exclude)
Method Detail

filter

public Set filter(Set artifacts)
This function determines if filtering needs to be performed. Includes are processed before Excludes.

Parameters:
dependencies - the set of dependencies to filter.
Returns:
a Set of filtered dependencies.

getArtifactFeature

protected abstract String getArtifactFeature(Artifact artifact)
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

public void setExcludes(String excludeString)

setIncludes

public void setIncludes(String includeString)

getExcludes

public List getExcludes()
Returns:
Returns the excludes.

getIncludes

public List getIncludes()
Returns:
Returns the includes.

compareFeatures

protected boolean compareFeatures(String lhs,
                                  String rhs)
Allows Feature comparison to be customized

Parameters:
lhs - String artifact's feature
rhs - String feature from exclude or include list
Returns:
boolean true if features match


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.