View Javadoc

1   package org.apache.maven.plugin.descriptor;
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  /**
23   * @author Jason van Zyl
24   */
25  public class Parameter
26      implements Cloneable
27  {
28      private String alias;
29  
30      private String name;
31  
32      private String type;
33  
34      private boolean required;
35  
36      private boolean editable = true;
37  
38      private String description;
39  
40      private String expression;
41  
42      private String deprecated;
43  
44      private String defaultValue;
45  
46      private String implementation;
47  
48      private Requirement requirement;
49  
50      private String since;
51  
52      // ----------------------------------------------------------------------
53      //
54      // ----------------------------------------------------------------------
55  
56      public String getName()
57      {
58          return name;
59      }
60  
61      public void setName( String name )
62      {
63          this.name = name;
64      }
65  
66      public String getType()
67      {
68          return type;
69      }
70  
71      public void setType( String type )
72      {
73          this.type = type;
74      }
75  
76      public boolean isRequired()
77      {
78          return required;
79      }
80  
81      public void setRequired( boolean required )
82      {
83          this.required = required;
84      }
85  
86      public String getDescription()
87      {
88          return description;
89      }
90  
91      public void setDescription( String description )
92      {
93          this.description = description;
94      }
95  
96      public String getExpression()
97      {
98          return expression;
99      }
100 
101     public void setExpression( String expression )
102     {
103         this.expression = expression;
104     }
105 
106     public String getDeprecated()
107     {
108         return deprecated;
109     }
110 
111     public void setDeprecated( String deprecated )
112     {
113         this.deprecated = deprecated;
114     }
115 
116     public int hashCode()
117     {
118         return name.hashCode();
119     }
120 
121     public boolean equals( Object other )
122     {
123         return ( other instanceof Parameter ) && getName().equals( ( (Parameter) other ).getName() );
124     }
125 
126     public String getAlias()
127     {
128         return alias;
129     }
130 
131     public void setAlias( String alias )
132     {
133         this.alias = alias;
134     }
135 
136     public boolean isEditable()
137     {
138         return editable;
139     }
140 
141     public void setEditable( boolean editable )
142     {
143         this.editable = editable;
144     }
145 
146     public void setDefaultValue( String defaultValue )
147     {
148         this.defaultValue = defaultValue;
149     }
150 
151     public String getDefaultValue()
152     {
153         return defaultValue;
154     }
155 
156     public String toString()
157     {
158         return "Mojo parameter [name: \'" + getName() + "\'; alias: \'" + getAlias() + "\']";
159     }
160 
161     public Requirement getRequirement()
162     {
163         return requirement;
164     }
165 
166     public void setRequirement( Requirement requirement )
167     {
168         this.requirement = requirement;
169     }
170 
171     public String getImplementation()
172     {
173         return implementation;
174     }
175 
176     public void setImplementation( String implementation )
177     {
178         this.implementation = implementation;
179     }
180 
181     public String getSince()
182     {
183         return since;
184     }
185 
186     public void setSince( String since )
187     {
188         this.since = since;
189     }
190 
191     /**
192      * Creates a shallow copy of this parameter.
193      */
194     @Override
195     public Parameter clone()
196     {
197         try
198         {
199             return (Parameter) super.clone();
200         }
201         catch ( CloneNotSupportedException e )
202         {
203             throw new UnsupportedOperationException( e );
204         }
205     }
206 
207 }