Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Standard |
|
| 1.3076923076923077;1,308 |
1 | /* | |
2 | * $Id: org.apache.maven.plugin.doap.options.Standard.html 815332 2012-05-01 21:25:03Z hboutemy $ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugin.doap.options; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * The "Standard" element is used to list all the relevant | |
15 | * standards implemented by the project. | |
16 | * These standards include W3C or ISO standards, RFCs, various | |
17 | * technical specifications etc. | |
18 | * Example: | |
19 | * <pre> | |
20 | * <asfext:implements> | |
21 | * <asfext:Standard> | |
22 | * <asfext:title>Extensible | |
23 | * Stylesheet Language - Formatting Objects (XSL-FO | |
24 | * 1.1)</asfext:title> | |
25 | * <asfext:body>W3C</asfext:body> | |
26 | * <asfext:id>XSL | |
27 | * 1.1</asfext:id> | |
28 | * <asfext:url | |
29 | * rdf:resource="http://www.w3.org/TR/xsl11/"/> | |
30 | * </asfext:Standard> | |
31 | * </asfext:implements> | |
32 | * </pre> | |
33 | * @see <a | |
34 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
35 | * | |
36 | * @version $Revision: 815332 $ $Date: 2012-05-01 21:25:03 +0000 (Tue, 01 May 2012) $ | |
37 | */ | |
38 | 0 | public class Standard implements java.io.Serializable { |
39 | ||
40 | ||
41 | //--------------------------/ | |
42 | //- Class/Member Variables -/ | |
43 | //--------------------------/ | |
44 | ||
45 | /** | |
46 | * The expanded title of the standard. Required. | |
47 | * @see <a | |
48 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
49 | */ | |
50 | private String title; | |
51 | ||
52 | /** | |
53 | * The body which published the standard (Example: "W3C", | |
54 | * "OASIS", "ISO" etc.). Required. | |
55 | * @see <a | |
56 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
57 | */ | |
58 | private String body; | |
59 | ||
60 | /** | |
61 | * An identifier for the standard (Example: ISO/IEC 15438, | |
62 | * RFC2397, JSR206 etc.). Required. | |
63 | * @see <a | |
64 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
65 | */ | |
66 | private String id; | |
67 | ||
68 | /** | |
69 | * An URL pointing to the standard (main website or | |
70 | * specification document). Optional. | |
71 | * @see <a | |
72 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
73 | */ | |
74 | private String url; | |
75 | ||
76 | ||
77 | //-----------/ | |
78 | //- Methods -/ | |
79 | //-----------/ | |
80 | ||
81 | /** | |
82 | * Method equals. | |
83 | * | |
84 | * @param other | |
85 | * @return boolean | |
86 | */ | |
87 | public boolean equals(Object other) | |
88 | { | |
89 | 0 | if ( this == other) |
90 | { | |
91 | 0 | return true; |
92 | } | |
93 | ||
94 | 0 | if ( !(other instanceof Standard) ) |
95 | { | |
96 | 0 | return false; |
97 | } | |
98 | ||
99 | 0 | Standard that = (Standard) other; |
100 | 0 | boolean result = true; |
101 | ||
102 | 0 | result = result && ( getTitle() == null ? that.getTitle() == null : getTitle().equals( that.getTitle() ) ); |
103 | 0 | result = result && ( getBody() == null ? that.getBody() == null : getBody().equals( that.getBody() ) ); |
104 | 0 | result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) ); |
105 | 0 | result = result && ( getUrl() == null ? that.getUrl() == null : getUrl().equals( that.getUrl() ) ); |
106 | ||
107 | 0 | return result; |
108 | } //-- boolean equals(Object) | |
109 | ||
110 | /** | |
111 | * Get the body which published the standard (Example: "W3C", | |
112 | * "OASIS", "ISO" etc.). Required. | |
113 | * @see <a | |
114 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
115 | * | |
116 | * @return String | |
117 | */ | |
118 | public String getBody() | |
119 | { | |
120 | 0 | return this.body; |
121 | } //-- String getBody() | |
122 | ||
123 | /** | |
124 | * Get an identifier for the standard (Example: ISO/IEC 15438, | |
125 | * RFC2397, JSR206 etc.). Required. | |
126 | * @see <a | |
127 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
128 | * | |
129 | * @return String | |
130 | */ | |
131 | public String getId() | |
132 | { | |
133 | 0 | return this.id; |
134 | } //-- String getId() | |
135 | ||
136 | /** | |
137 | * Get the expanded title of the standard. Required. | |
138 | * @see <a | |
139 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
140 | * | |
141 | * @return String | |
142 | */ | |
143 | public String getTitle() | |
144 | { | |
145 | 0 | return this.title; |
146 | } //-- String getTitle() | |
147 | ||
148 | /** | |
149 | * Get an URL pointing to the standard (main website or | |
150 | * specification document). Optional. | |
151 | * @see <a | |
152 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
153 | * | |
154 | * @return String | |
155 | */ | |
156 | public String getUrl() | |
157 | { | |
158 | 0 | return this.url; |
159 | } //-- String getUrl() | |
160 | ||
161 | /** | |
162 | * Method hashCode. | |
163 | * | |
164 | * @return int | |
165 | */ | |
166 | public int hashCode() | |
167 | { | |
168 | 0 | int result = 17; |
169 | ||
170 | 0 | result = 37 * result + ( title != null ? title.hashCode() : 0 ); |
171 | 0 | result = 37 * result + ( body != null ? body.hashCode() : 0 ); |
172 | 0 | result = 37 * result + ( id != null ? id.hashCode() : 0 ); |
173 | 0 | result = 37 * result + ( url != null ? url.hashCode() : 0 ); |
174 | ||
175 | 0 | return result; |
176 | } //-- int hashCode() | |
177 | ||
178 | /** | |
179 | * Set the body which published the standard (Example: "W3C", | |
180 | * "OASIS", "ISO" etc.). Required. | |
181 | * @see <a | |
182 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
183 | * | |
184 | * @param body | |
185 | */ | |
186 | public void setBody(String body) | |
187 | { | |
188 | 0 | this.body = body; |
189 | 0 | } //-- void setBody(String) |
190 | ||
191 | /** | |
192 | * Set an identifier for the standard (Example: ISO/IEC 15438, | |
193 | * RFC2397, JSR206 etc.). Required. | |
194 | * @see <a | |
195 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
196 | * | |
197 | * @param id | |
198 | */ | |
199 | public void setId(String id) | |
200 | { | |
201 | 0 | this.id = id; |
202 | 0 | } //-- void setId(String) |
203 | ||
204 | /** | |
205 | * Set the expanded title of the standard. Required. | |
206 | * @see <a | |
207 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
208 | * | |
209 | * @param title | |
210 | */ | |
211 | public void setTitle(String title) | |
212 | { | |
213 | 0 | this.title = title; |
214 | 0 | } //-- void setTitle(String) |
215 | ||
216 | /** | |
217 | * Set an URL pointing to the standard (main website or | |
218 | * specification document). Optional. | |
219 | * @see <a | |
220 | * href="http://projects.apache.org/docs/standards.html">http://projects.apache.org/docs/standards.html</a> | |
221 | * | |
222 | * @param url | |
223 | */ | |
224 | public void setUrl(String url) | |
225 | { | |
226 | 0 | this.url = url; |
227 | 0 | } //-- void setUrl(String) |
228 | ||
229 | /** | |
230 | * Method toString. | |
231 | * | |
232 | * @return java.lang.String | |
233 | */ | |
234 | public java.lang.String toString() | |
235 | { | |
236 | 0 | StringBuffer buf = new StringBuffer(); |
237 | ||
238 | 0 | buf.append( "title = '" ); |
239 | 0 | buf.append( getTitle() ); |
240 | 0 | buf.append( "'" ); |
241 | 0 | buf.append( "\n" ); |
242 | 0 | buf.append( "body = '" ); |
243 | 0 | buf.append( getBody() ); |
244 | 0 | buf.append( "'" ); |
245 | 0 | buf.append( "\n" ); |
246 | 0 | buf.append( "id = '" ); |
247 | 0 | buf.append( getId() ); |
248 | 0 | buf.append( "'" ); |
249 | 0 | buf.append( "\n" ); |
250 | 0 | buf.append( "url = '" ); |
251 | 0 | buf.append( getUrl() ); |
252 | 0 | buf.append( "'" ); |
253 | ||
254 | 0 | return buf.toString(); |
255 | } //-- java.lang.String toString() | |
256 | ||
257 | ||
258 | 0 | private String modelEncoding = "UTF-8"; |
259 | ||
260 | /** | |
261 | * Set an encoding used for reading/writing the model. | |
262 | * | |
263 | * @param modelEncoding the encoding used when reading/writing the model. | |
264 | */ | |
265 | public void setModelEncoding( String modelEncoding ) | |
266 | { | |
267 | 0 | this.modelEncoding = modelEncoding; |
268 | 0 | } |
269 | ||
270 | /** | |
271 | * @return the current encoding used when reading/writing this model. | |
272 | */ | |
273 | public String getModelEncoding() | |
274 | { | |
275 | 0 | return modelEncoding; |
276 | } | |
277 | } |