View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugins.javadoc.stubs;
20  
21  import org.apache.maven.artifact.handler.ArtifactHandler;
22  import org.apache.maven.artifact.versioning.VersionRange;
23  import org.apache.maven.plugin.testing.stubs.ArtifactStub;
24  
25  /**
26   * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
27   */
28  public class JavadocPluginArtifactStub extends ArtifactStub {
29      private String groupId;
30  
31      private String artifactId;
32  
33      private String version;
34  
35      private String packaging;
36  
37      private String baseVersion;
38  
39      private VersionRange versionRange;
40  
41      private ArtifactHandler handler;
42  
43      public JavadocPluginArtifactStub(String groupId, String artifactId, String version, String packaging) {
44          this.groupId = groupId;
45          this.artifactId = artifactId;
46          this.version = version;
47          this.packaging = packaging;
48          versionRange = VersionRange.createFromVersion(version);
49      }
50  
51      /** {@inheritDoc} */
52      @Override
53      public void setGroupId(String groupId) {
54          this.groupId = groupId;
55      }
56  
57      /** {@inheritDoc} */
58      @Override
59      public String getGroupId() {
60          return groupId;
61      }
62  
63      /** {@inheritDoc} */
64      @Override
65      public void setArtifactId(String artifactId) {
66          this.artifactId = artifactId;
67      }
68  
69      /** {@inheritDoc} */
70      @Override
71      public String getArtifactId() {
72          return artifactId;
73      }
74  
75      /** {@inheritDoc} */
76      @Override
77      public void setVersion(String version) {
78          this.version = version;
79      }
80  
81      /** {@inheritDoc} */
82      @Override
83      public String getVersion() {
84          return version;
85      }
86  
87      /**
88       * @param packaging
89       */
90      public void setPackaging(String packaging) {
91          this.packaging = packaging;
92      }
93  
94      /**
95       * @return
96       */
97      public String getPackaging() {
98          return packaging;
99      }
100 
101     /** {@inheritDoc} */
102     @Override
103     public VersionRange getVersionRange() {
104         return versionRange;
105     }
106 
107     /** {@inheritDoc} */
108     @Override
109     public void setVersionRange(VersionRange versionRange) {
110         this.versionRange = versionRange;
111     }
112 
113     /** {@inheritDoc} */
114     @Override
115     public ArtifactHandler getArtifactHandler() {
116         return handler;
117     }
118 
119     /** {@inheritDoc} */
120     @Override
121     public void setArtifactHandler(ArtifactHandler handler) {
122         this.handler = handler;
123     }
124 
125     /** {@inheritDoc} */
126     @Override
127     public String getBaseVersion() {
128         return baseVersion;
129     }
130 
131     /** {@inheritDoc} */
132     @Override
133     public void setBaseVersion(String string) {
134         this.baseVersion = string;
135     }
136 }