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 Details

    • ScopeFilter

      public ScopeFilter(Collection<String> included, Collection<String> excluded)

      Constructor for ScopeFilter.

      Parameters:
      included - specific scopes to include or null to include all
      excluded - specific scopes to exclude or null to exclude none
  • Method Details

    • including

      public static ScopeFilter including(Collection<String> included)
      Construct a ScopeFilter based on included scopes
      Parameters:
      included - the scopes to include, may be null
      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 be null
      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 be null
      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 be null
      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 interface TransformableFilter
      Type Parameters:
      T - the interface of the tool specific filter
      Parameters:
      transformer - the tool specific transformer, may not be null
      Returns:
      the transformed value, never null