View Javadoc
1   package org.apache.maven.plugins.javadoc.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   */
29  public class JavadocPluginArtifactStub
30      extends ArtifactStub
31  {
32      private String groupId;
33  
34      private String artifactId;
35  
36      private String version;
37  
38      private String packaging;
39  
40      private String baseVersion;
41  
42      private VersionRange versionRange;
43  
44      private ArtifactHandler handler;
45  
46      public JavadocPluginArtifactStub( String groupId, String artifactId, String version, String packaging )
47      {
48          this.groupId = groupId;
49          this.artifactId = artifactId;
50          this.version = version;
51          this.packaging = packaging;
52          versionRange = VersionRange.createFromVersion( version );
53      }
54  
55      /** {@inheritDoc} */
56      @Override
57      public void setGroupId( String groupId )
58      {
59          this.groupId = groupId;
60      }
61  
62      /** {@inheritDoc} */
63      @Override
64      public String getGroupId()
65      {
66          return groupId;
67      }
68  
69      /** {@inheritDoc} */
70      @Override
71      public void setArtifactId( String artifactId )
72      {
73          this.artifactId = artifactId;
74      }
75  
76      /** {@inheritDoc} */
77      @Override
78      public String getArtifactId()
79      {
80          return artifactId;
81      }
82  
83      /** {@inheritDoc} */
84      @Override
85      public void setVersion( String version )
86      {
87          this.version = version;
88      }
89  
90      /** {@inheritDoc} */
91      @Override
92      public String getVersion()
93      {
94          return version;
95      }
96  
97      /**
98       * @param packaging
99       */
100     public void setPackaging( String packaging )
101     {
102         this.packaging = packaging;
103     }
104 
105     /**
106      * @return
107      */
108     public String getPackaging()
109     {
110         return packaging;
111     }
112 
113     /** {@inheritDoc} */
114     @Override
115     public VersionRange getVersionRange()
116     {
117         return versionRange;
118     }
119 
120     /** {@inheritDoc} */
121     @Override
122     public void setVersionRange( VersionRange versionRange )
123     {
124         this.versionRange = versionRange;
125     }
126 
127     /** {@inheritDoc} */
128     @Override
129     public ArtifactHandler getArtifactHandler()
130     {
131         return handler;
132     }
133 
134     /** {@inheritDoc} */
135     @Override
136     public void setArtifactHandler( ArtifactHandler handler )
137     {
138         this.handler = handler;
139     }
140 
141     /** {@inheritDoc} */
142     @Override
143     public String getBaseVersion()
144     {
145         return baseVersion;
146     }
147 
148     /** {@inheritDoc} */
149     @Override
150     public void setBaseVersion( String string )
151     {
152         this.baseVersion = string;
153     }
154 }