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