ShrinkWrap Resolver Maven API 2.0.0-cr-1

org.jboss.shrinkwrap.resolver.api.maven.filter
Class ScopeFilter

java.lang.Object
  extended by org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter
All Implemented Interfaces:
MavenResolutionFilter, ResolutionFilter

public class ScopeFilter
extends Object
implements MavenResolutionFilter

A filter which limits scope of the artifacts. Only the artifacts within specified scopes are included in resolution.

Author:
Karel Piwko, Andrew Lee Rubinger

Constructor Summary
ScopeFilter()
          Creates a filter which accepts all artifacts that have scope {ScopeType.COMPILE
ScopeFilter(ScopeType... scopes)
          Creates a filter which accepts all artifacts which have scope matching one of those specified here.
 
Method Summary
 boolean accepts(MavenDependency dependency, List<MavenDependency> dependenciesForResolution, List<MavenDependency> dependencyAncestors)
          Determines whether or not a MavenDependency is accepted by this filter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScopeFilter

public ScopeFilter()
Creates a filter which accepts all artifacts that have scope {ScopeType.COMPILE


ScopeFilter

public ScopeFilter(ScopeType... scopes)
Creates a filter which accepts all artifacts which have scope matching one of those specified here. If no scopes are defined, ScopeType.COMPILE will be allowed as a default.

Parameters:
scopes - The enumeration of allowed scopes
Method Detail

accepts

public boolean accepts(MavenDependency dependency,
                       List<MavenDependency> dependenciesForResolution,
                       List<MavenDependency> dependencyAncestors)
Determines whether or not a MavenDependency is accepted by this filter. The filtering mechanism may consult the project's explicitly-defined dependencies and dependencyManagement (guaranteed immutable and non-null) in determining whether filtering should be applied.

Specified by:
accepts in interface MavenResolutionFilter
Parameters:
dependency - Candidate for inclusion
dependenciesForResolution - Explicitly-declared dependencies for the current session, does not include those obtained via transitivity
dependencyAncestors - A list of ancestors of the candidate for inclusion.
Returns:
See Also:
MavenResolutionFilter.accepts(org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependency, java.util.List, java.util.List)

toString

public String toString()
Overrides:
toString in class Object

ShrinkWrap Resolver Maven API 2.0.0-cr-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.