View Javadoc

1   /*
2    *  Licensed under the Apache License, Version 2.0 (the "License");
3    *  you may not use this file except in compliance with the License.
4    *  You may obtain a copy of the License at
5    *
6    *      http://www.apache.org/licenses/LICENSE-2.0
7    *
8    *  Unless required by applicable law or agreed to in writing, software
9    *  distributed under the License is distributed on an "AS IS" BASIS,
10   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11   *  See the License for the specific language governing permissions and
12   *  limitations under the License.
13   */
14  /*
15   * This file has been modified by Chris Pheby in accordance with Section 4.2
16   * of the Apache Software License
17   */
18  package org.jadira.dependencynavigator.model;
19  
20  import org.apache.maven.model.Dependency;
21  
22  import java.util.Collections;
23  import java.util.List;
24  
25  public class LeafDependency extends Artifact {
26      public LeafDependency(Artifact parent, Dependency dependency, String scope) throws ArtifactInitialisationException {
27          super(parent, dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), scope);
28      }
29  
30      @Override
31      public boolean isLeaf() {
32          return true;
33      }
34  
35      @Override
36      public List<Artifact> getDependencies() {
37          return Collections.emptyList();
38      }
39  
40      @Override
41      public int dependencyCount() {
42          return 1;
43      }
44  }