Coverage Report - org.apache.maven.shared.dependency.graph.filter.ArtifactDependencyNodeFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
ArtifactDependencyNodeFilter
0 %
0/6
N/A
1
 
 1  
 package org.apache.maven.shared.dependency.graph.filter;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import org.apache.maven.artifact.Artifact;
 23  
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 24  
 import org.apache.maven.shared.dependency.graph.DependencyNode;
 25  
 
 26  
 /**
 27  
  * A dependency node filter that delegates to an artifact filter.
 28  
  * 
 29  
  * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
 30  
  * @version $Id: ArtifactDependencyNodeFilter.java 1351166 2012-06-17 21:15:54Z hboutemy $
 31  
  * @since 1.1
 32  
  */
 33  
 public class ArtifactDependencyNodeFilter
 34  
     implements DependencyNodeFilter
 35  
 {
 36  
     // fields -----------------------------------------------------------------
 37  
 
 38  
     /**
 39  
      * The artifact filter this dependency node filter delegates to.
 40  
      */
 41  
     private final ArtifactFilter filter;
 42  
 
 43  
     // constructors -----------------------------------------------------------
 44  
 
 45  
     /**
 46  
      * Creates a dependency node filter that delegates to the specified artifact filter.
 47  
      * 
 48  
      * @param filter
 49  
      *            the artifact filter to delegate to
 50  
      */
 51  
     public ArtifactDependencyNodeFilter( ArtifactFilter filter )
 52  0
     {
 53  0
         this.filter = filter;
 54  0
     }
 55  
 
 56  
     // DependencyNodeFilter methods -------------------------------------------
 57  
 
 58  
     /**
 59  
      * {@inheritDoc}
 60  
      */
 61  
     public boolean accept( DependencyNode node )
 62  
     {
 63  0
         Artifact artifact = node.getArtifact();
 64  
 
 65  0
         return filter.include( artifact );
 66  
     }
 67  
 
 68  
     // public methods ---------------------------------------------------------
 69  
 
 70  
     /**
 71  
      * Gets the artifact filter this dependency node filter delegates to.
 72  
      * 
 73  
      * @return the artifact filter this dependency node filter delegates to
 74  
      */
 75  
     public ArtifactFilter getArtifactFilter()
 76  
     {
 77  0
         return filter;
 78  
     }
 79  
 }