View Javadoc

1   package org.apache.maven.report.projectinfo.stubs;
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.handler.ArtifactHandler;
23  import org.apache.maven.artifact.versioning.VersionRange;
24  import org.apache.maven.plugin.testing.stubs.ArtifactStub;
25  
26  /**
27   * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
28   * @version $Id: ProjectInfoPluginArtifactStub.java 1038048 2010-11-23 10:52:14Z vsiveton $
29   */
30  public class ProjectInfoPluginArtifactStub
31      extends ArtifactStub
32  {
33      private String groupId;
34  
35      private String artifactId;
36  
37      private String version;
38  
39      private String packaging;
40  
41      private VersionRange versionRange;
42  
43      private ArtifactHandler handler;
44  
45      /**
46       * @param groupId
47       * @param artifactId
48       * @param version
49       * @param packaging
50       */
51      public ProjectInfoPluginArtifactStub( String groupId, String artifactId, String version, String packaging )
52      {
53          this.groupId = groupId;
54          this.artifactId = artifactId;
55          this.version = version;
56          this.packaging = packaging;
57          versionRange = VersionRange.createFromVersion( version );
58      }
59  
60      @Override
61      public void setGroupId( String groupId )
62      {
63          this.groupId = groupId;
64      }
65  
66      @Override
67      public String getGroupId()
68      {
69          return groupId;
70      }
71  
72      @Override
73      public void setArtifactId( String artifactId )
74      {
75          this.artifactId = artifactId;
76      }
77  
78      @Override
79      public String getArtifactId()
80      {
81          return artifactId;
82      }
83  
84      @Override
85      public void setVersion( String version )
86      {
87          this.version = version;
88      }
89  
90      @Override
91      public String getVersion()
92      {
93          return version;
94      }
95  
96      /**
97       * @param packaging
98       */
99      public void setPackaging( String packaging )
100     {
101         this.packaging = packaging;
102     }
103 
104     /**
105      * @return the packaging
106      */
107     public String getPackaging()
108     {
109         return packaging;
110     }
111 
112     @Override
113     public VersionRange getVersionRange()
114     {
115         return versionRange;
116     }
117 
118     @Override
119     public void setVersionRange( VersionRange versionRange )
120     {
121         this.versionRange = versionRange;
122     }
123 
124     @Override
125     public ArtifactHandler getArtifactHandler()
126     {
127         return handler;
128     }
129 
130     @Override
131     public void setArtifactHandler( ArtifactHandler handler )
132     {
133         this.handler = handler;
134     }
135 }