View Javadoc
1   package org.apache.maven.plugins.pmd.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:oching@apache.org">Maria Odea Ching</a>
28   * @version $Id$
29   */
30  public class PmdPluginArtifactStub
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      public PmdPluginArtifactStub( String groupId, String artifactId, String version, String packaging )
46      {
47          this.groupId = groupId;
48          this.artifactId = artifactId;
49          this.version = version;
50          this.packaging = packaging;
51          versionRange = VersionRange.createFromVersion( version );
52      }
53  
54      /** {@inheritDoc} */
55      @Override
56      public void setGroupId( String groupId )
57      {
58          this.groupId = groupId;
59      }
60  
61      /** {@inheritDoc} */
62      @Override
63      public String getGroupId()
64      {
65          return groupId;
66      }
67  
68      /** {@inheritDoc} */
69      @Override
70      public void setArtifactId( String artifactId )
71      {
72          this.artifactId = artifactId;
73      }
74  
75      /** {@inheritDoc} */
76      @Override
77      public String getArtifactId()
78      {
79          return artifactId;
80      }
81  
82      /** {@inheritDoc} */
83      @Override
84      public void setVersion( String version )
85      {
86          this.version = version;
87      }
88  
89      /** {@inheritDoc} */
90      @Override
91      public String getVersion()
92      {
93          return version;
94      }
95  
96      public void setPackaging( String packaging )
97      {
98          this.packaging = packaging;
99      }
100 
101     public String getPackaging()
102     {
103         return packaging;
104     }
105 
106     /** {@inheritDoc} */
107     @Override
108     public VersionRange getVersionRange()
109     {
110         return versionRange;
111     }
112 
113     /** {@inheritDoc} */
114     @Override
115     public void setVersionRange( VersionRange versionRange )
116     {
117         this.versionRange = versionRange;
118     }
119 
120     /** {@inheritDoc} */
121     @Override
122     public ArtifactHandler getArtifactHandler()
123     {
124         return handler;
125     }
126 
127     /** {@inheritDoc} */
128     @Override
129     public void setArtifactHandler( ArtifactHandler handler )
130     {
131         this.handler = handler;
132     }
133 }