Class ScopeFilter
- java.lang.Object
-
- org.apache.maven.shared.artifact.filter.resolve.ScopeFilter
-
- All Implemented Interfaces:
TransformableFilter
public class ScopeFilter extends Object implements TransformableFilter
Filter based on scope. Note: There's no logic for inherited scoped- Since:
- 3.0
- Author:
- Robert Scholte
- See Also:
ScopeDependencyFilter
-
-
Constructor Summary
Constructors Constructor Description ScopeFilter(Collection<String> included, Collection<String> excluded)
Constructor for ScopeFilter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScopeFilter
excluding(String... excluded)
Construct a ScopeFilter based on excluded scopesstatic ScopeFilter
excluding(Collection<String> excluded)
Construct a ScopeFilter based on excluded scopesCollection<String>
getExcluded()
Get the excluded scopesCollection<String>
getIncluded()
Get the included scopesstatic ScopeFilter
including(String... included)
Construct a ScopeFilter based on included scopesstatic ScopeFilter
including(Collection<String> included)
Construct a ScopeFilter based on included scopes<T> T
transform(FilterTransformer<T> transformer)
Subclasses should include the following code:
-
-
-
Constructor Detail
-
ScopeFilter
public ScopeFilter(Collection<String> included, Collection<String> excluded)
Constructor for ScopeFilter.
- Parameters:
included
- specific scopes to include ornull
to include allexcluded
- specific scopes to exclude ornull
to exclude none
-
-
Method Detail
-
including
public static ScopeFilter including(Collection<String> included)
Construct a ScopeFilter based on included scopes- Parameters:
included
- the scopes to include, may benull
- Returns:
- the filter, never
null
-
including
public static ScopeFilter including(String... included)
Construct a ScopeFilter based on included scopes- Parameters:
included
- the scopes to include, must not benull
- Returns:
- the filter, never
null
-
excluding
public static ScopeFilter excluding(Collection<String> excluded)
Construct a ScopeFilter based on excluded scopes- Parameters:
excluded
- the scopes to exclude, may benull
- Returns:
- the filter, never
null
-
excluding
public static ScopeFilter excluding(String... excluded)
Construct a ScopeFilter based on excluded scopes- Parameters:
excluded
- the scopes to exclude, must not benull
- Returns:
- the filter, never
null
-
getExcluded
public final Collection<String> getExcluded()
Get the excluded scopes- Returns:
- the scopes to exclude, may be
null
-
getIncluded
public final Collection<String> getIncluded()
Get the included scopes- Returns:
- the scopes to include, may be
null
-
transform
public <T> T transform(FilterTransformer<T> transformer)
Subclasses should include the following code:@Override public abstract <T> T transform( FilterTransformer<T> transformer ) { return transformer.transform( this ); }
Transform this filter to a tool specific implementation- Specified by:
transform
in interfaceTransformableFilter
- Type Parameters:
T
- the interface of the tool specific filter- Parameters:
transformer
- the tool specific transformer, may not benull
- Returns:
- the transformed value, never
null
-
-