1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
package org.apache.maven.doxia.site.decoration.io.xpp3; |
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
import java.io.IOException; |
15 | |
import java.io.InputStream; |
16 | |
import java.io.Reader; |
17 | |
import java.text.DateFormat; |
18 | |
import java.util.Locale; |
19 | |
import org.apache.maven.doxia.site.decoration.Banner; |
20 | |
import org.apache.maven.doxia.site.decoration.Body; |
21 | |
import org.apache.maven.doxia.site.decoration.DecorationModel; |
22 | |
import org.apache.maven.doxia.site.decoration.LinkItem; |
23 | |
import org.apache.maven.doxia.site.decoration.Logo; |
24 | |
import org.apache.maven.doxia.site.decoration.Menu; |
25 | |
import org.apache.maven.doxia.site.decoration.MenuItem; |
26 | |
import org.apache.maven.doxia.site.decoration.PublishDate; |
27 | |
import org.apache.maven.doxia.site.decoration.Skin; |
28 | |
import org.apache.maven.doxia.site.decoration.Version; |
29 | |
import org.codehaus.plexus.util.ReaderFactory; |
30 | |
import org.codehaus.plexus.util.xml.Xpp3DomBuilder; |
31 | |
import org.codehaus.plexus.util.xml.pull.MXParser; |
32 | |
import org.codehaus.plexus.util.xml.pull.XmlPullParser; |
33 | |
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
@SuppressWarnings( "all" ) |
41 | 120 | public class DecorationXpp3Reader |
42 | |
{ |
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | 120 | private boolean addDefaultEntities = true; |
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set parsed ) |
76 | |
throws XmlPullParserException |
77 | |
{ |
78 | 3518 | if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) ) |
79 | |
{ |
80 | 2626 | return false; |
81 | |
} |
82 | 892 | if ( !parsed.add( tagName ) ) |
83 | |
{ |
84 | 0 | throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null ); |
85 | |
} |
86 | 892 | return true; |
87 | |
} |
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict ) |
100 | |
throws XmlPullParserException, IOException |
101 | |
{ |
102 | |
|
103 | 0 | if ( strict ) |
104 | |
{ |
105 | 0 | throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null ); |
106 | |
} |
107 | 0 | } |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
private void checkUnknownElement( XmlPullParser parser, boolean strict ) |
118 | |
throws XmlPullParserException, IOException |
119 | |
{ |
120 | 0 | if ( strict ) |
121 | |
{ |
122 | 0 | throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null ); |
123 | |
} |
124 | |
|
125 | 0 | for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; ) |
126 | |
{ |
127 | 0 | int eventType = parser.next(); |
128 | 0 | if ( eventType == XmlPullParser.START_TAG ) |
129 | |
{ |
130 | 0 | unrecognizedTagCount++; |
131 | |
} |
132 | 0 | else if ( eventType == XmlPullParser.END_TAG ) |
133 | |
{ |
134 | 0 | unrecognizedTagCount--; |
135 | |
} |
136 | 0 | } |
137 | 0 | } |
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
public boolean getAddDefaultEntities() |
145 | |
{ |
146 | 0 | return addDefaultEntities; |
147 | |
} |
148 | |
|
149 | |
|
150 | |
|
151 | |
|
152 | |
|
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
private boolean getBooleanValue( String s, String attribute, XmlPullParser parser ) |
159 | |
throws XmlPullParserException |
160 | |
{ |
161 | 0 | return getBooleanValue( s, attribute, parser, null ); |
162 | |
} |
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
|
174 | |
private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue ) |
175 | |
throws XmlPullParserException |
176 | |
{ |
177 | 0 | if ( s != null && s.length() != 0 ) |
178 | |
{ |
179 | 0 | return Boolean.valueOf( s ).booleanValue(); |
180 | |
} |
181 | 0 | if ( defaultValue != null ) |
182 | |
{ |
183 | 0 | return Boolean.valueOf( defaultValue ).booleanValue(); |
184 | |
} |
185 | 0 | return false; |
186 | |
} |
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
|
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
199 | |
throws XmlPullParserException |
200 | |
{ |
201 | 0 | if ( s != null ) |
202 | |
{ |
203 | |
try |
204 | |
{ |
205 | 0 | return Byte.valueOf( s ).byteValue(); |
206 | |
} |
207 | 0 | catch ( NumberFormatException nfe ) |
208 | |
{ |
209 | 0 | if ( strict ) |
210 | |
{ |
211 | 0 | throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe ); |
212 | |
} |
213 | |
} |
214 | |
} |
215 | 0 | return 0; |
216 | |
} |
217 | |
|
218 | |
|
219 | |
|
220 | |
|
221 | |
|
222 | |
|
223 | |
|
224 | |
|
225 | |
|
226 | |
|
227 | |
private char getCharacterValue( String s, String attribute, XmlPullParser parser ) |
228 | |
throws XmlPullParserException |
229 | |
{ |
230 | 0 | if ( s != null ) |
231 | |
{ |
232 | 0 | return s.charAt( 0 ); |
233 | |
} |
234 | 0 | return 0; |
235 | |
} |
236 | |
|
237 | |
|
238 | |
|
239 | |
|
240 | |
|
241 | |
|
242 | |
|
243 | |
|
244 | |
|
245 | |
|
246 | |
private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser ) |
247 | |
throws XmlPullParserException |
248 | |
{ |
249 | 0 | return getDateValue( s, attribute, null, parser ); |
250 | |
} |
251 | |
|
252 | |
|
253 | |
|
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | |
|
259 | |
|
260 | |
|
261 | |
|
262 | |
private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser ) |
263 | |
throws XmlPullParserException |
264 | |
{ |
265 | 0 | if ( s != null ) |
266 | |
{ |
267 | 0 | String effectiveDateFormat = dateFormat; |
268 | 0 | if ( dateFormat == null ) |
269 | |
{ |
270 | 0 | effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS"; |
271 | |
} |
272 | 0 | if ( "long".equals( effectiveDateFormat ) ) |
273 | |
{ |
274 | |
try |
275 | |
{ |
276 | 0 | return new java.util.Date( Long.parseLong( s ) ); |
277 | |
} |
278 | 0 | catch ( NumberFormatException e ) |
279 | |
{ |
280 | 0 | throw new XmlPullParserException( e.getMessage(), parser, e ); |
281 | |
} |
282 | |
} |
283 | |
else |
284 | |
{ |
285 | |
try |
286 | |
{ |
287 | 0 | DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, Locale.US ); |
288 | 0 | return dateParser.parse( s ); |
289 | |
} |
290 | 0 | catch ( java.text.ParseException e ) |
291 | |
{ |
292 | 0 | throw new XmlPullParserException( e.getMessage(), parser, e ); |
293 | |
} |
294 | |
} |
295 | |
} |
296 | 0 | return null; |
297 | |
} |
298 | |
|
299 | |
|
300 | |
|
301 | |
|
302 | |
|
303 | |
|
304 | |
|
305 | |
|
306 | |
|
307 | |
|
308 | |
|
309 | |
private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
310 | |
throws XmlPullParserException |
311 | |
{ |
312 | 0 | if ( s != null ) |
313 | |
{ |
314 | |
try |
315 | |
{ |
316 | 0 | return Double.valueOf( s ).doubleValue(); |
317 | |
} |
318 | 0 | catch ( NumberFormatException nfe ) |
319 | |
{ |
320 | 0 | if ( strict ) |
321 | |
{ |
322 | 0 | throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe ); |
323 | |
} |
324 | |
} |
325 | |
} |
326 | 0 | return 0; |
327 | |
} |
328 | |
|
329 | |
|
330 | |
|
331 | |
|
332 | |
|
333 | |
|
334 | |
|
335 | |
|
336 | |
|
337 | |
|
338 | |
|
339 | |
private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
340 | |
throws XmlPullParserException |
341 | |
{ |
342 | 0 | if ( s != null ) |
343 | |
{ |
344 | |
try |
345 | |
{ |
346 | 0 | return Float.valueOf( s ).floatValue(); |
347 | |
} |
348 | 0 | catch ( NumberFormatException nfe ) |
349 | |
{ |
350 | 0 | if ( strict ) |
351 | |
{ |
352 | 0 | throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe ); |
353 | |
} |
354 | |
} |
355 | |
} |
356 | 0 | return 0; |
357 | |
} |
358 | |
|
359 | |
|
360 | |
|
361 | |
|
362 | |
|
363 | |
|
364 | |
|
365 | |
|
366 | |
|
367 | |
|
368 | |
|
369 | |
private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
370 | |
throws XmlPullParserException |
371 | |
{ |
372 | 0 | if ( s != null ) |
373 | |
{ |
374 | |
try |
375 | |
{ |
376 | 0 | return Integer.valueOf( s ).intValue(); |
377 | |
} |
378 | 0 | catch ( NumberFormatException nfe ) |
379 | |
{ |
380 | 0 | if ( strict ) |
381 | |
{ |
382 | 0 | throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe ); |
383 | |
} |
384 | |
} |
385 | |
} |
386 | 0 | return 0; |
387 | |
} |
388 | |
|
389 | |
|
390 | |
|
391 | |
|
392 | |
|
393 | |
|
394 | |
|
395 | |
|
396 | |
|
397 | |
|
398 | |
|
399 | |
private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
400 | |
throws XmlPullParserException |
401 | |
{ |
402 | 0 | if ( s != null ) |
403 | |
{ |
404 | |
try |
405 | |
{ |
406 | 0 | return Long.valueOf( s ).longValue(); |
407 | |
} |
408 | 0 | catch ( NumberFormatException nfe ) |
409 | |
{ |
410 | 0 | if ( strict ) |
411 | |
{ |
412 | 0 | throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe ); |
413 | |
} |
414 | |
} |
415 | |
} |
416 | 0 | return 0; |
417 | |
} |
418 | |
|
419 | |
|
420 | |
|
421 | |
|
422 | |
|
423 | |
|
424 | |
|
425 | |
|
426 | |
|
427 | |
|
428 | |
|
429 | |
private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
430 | |
throws XmlPullParserException |
431 | |
{ |
432 | 0 | if ( s == null ) |
433 | |
{ |
434 | 0 | if ( strict ) |
435 | |
{ |
436 | 0 | throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null ); |
437 | |
} |
438 | |
} |
439 | 0 | return s; |
440 | |
} |
441 | |
|
442 | |
|
443 | |
|
444 | |
|
445 | |
|
446 | |
|
447 | |
|
448 | |
|
449 | |
|
450 | |
|
451 | |
|
452 | |
private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict ) |
453 | |
throws XmlPullParserException |
454 | |
{ |
455 | 0 | if ( s != null ) |
456 | |
{ |
457 | |
try |
458 | |
{ |
459 | 0 | return Short.valueOf( s ).shortValue(); |
460 | |
} |
461 | 0 | catch ( NumberFormatException nfe ) |
462 | |
{ |
463 | 0 | if ( strict ) |
464 | |
{ |
465 | 0 | throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe ); |
466 | |
} |
467 | |
} |
468 | |
} |
469 | 0 | return 0; |
470 | |
} |
471 | |
|
472 | |
|
473 | |
|
474 | |
|
475 | |
|
476 | |
|
477 | |
|
478 | |
private String getTrimmedValue( String s ) |
479 | |
{ |
480 | 1388 | if ( s != null ) |
481 | |
{ |
482 | 1388 | s = s.trim(); |
483 | |
} |
484 | 1388 | return s; |
485 | |
} |
486 | |
|
487 | |
|
488 | |
|
489 | |
|
490 | |
|
491 | |
|
492 | |
|
493 | |
private void initParser( XmlPullParser parser ) |
494 | |
throws XmlPullParserException |
495 | |
{ |
496 | 120 | if ( addDefaultEntities ) |
497 | |
{ |
498 | |
|
499 | |
|
500 | |
|
501 | |
|
502 | 120 | parser.defineEntityReplacementText( "nbsp", "\u00a0" ); |
503 | 120 | parser.defineEntityReplacementText( "iexcl", "\u00a1" ); |
504 | 120 | parser.defineEntityReplacementText( "cent", "\u00a2" ); |
505 | 120 | parser.defineEntityReplacementText( "pound", "\u00a3" ); |
506 | 120 | parser.defineEntityReplacementText( "curren", "\u00a4" ); |
507 | 120 | parser.defineEntityReplacementText( "yen", "\u00a5" ); |
508 | 120 | parser.defineEntityReplacementText( "brvbar", "\u00a6" ); |
509 | 120 | parser.defineEntityReplacementText( "sect", "\u00a7" ); |
510 | 120 | parser.defineEntityReplacementText( "uml", "\u00a8" ); |
511 | 120 | parser.defineEntityReplacementText( "copy", "\u00a9" ); |
512 | 120 | parser.defineEntityReplacementText( "ordf", "\u00aa" ); |
513 | 120 | parser.defineEntityReplacementText( "laquo", "\u00ab" ); |
514 | 120 | parser.defineEntityReplacementText( "not", "\u00ac" ); |
515 | 120 | parser.defineEntityReplacementText( "shy", "\u00ad" ); |
516 | 120 | parser.defineEntityReplacementText( "reg", "\u00ae" ); |
517 | 120 | parser.defineEntityReplacementText( "macr", "\u00af" ); |
518 | 120 | parser.defineEntityReplacementText( "deg", "\u00b0" ); |
519 | 120 | parser.defineEntityReplacementText( "plusmn", "\u00b1" ); |
520 | 120 | parser.defineEntityReplacementText( "sup2", "\u00b2" ); |
521 | 120 | parser.defineEntityReplacementText( "sup3", "\u00b3" ); |
522 | 120 | parser.defineEntityReplacementText( "acute", "\u00b4" ); |
523 | 120 | parser.defineEntityReplacementText( "micro", "\u00b5" ); |
524 | 120 | parser.defineEntityReplacementText( "para", "\u00b6" ); |
525 | 120 | parser.defineEntityReplacementText( "middot", "\u00b7" ); |
526 | 120 | parser.defineEntityReplacementText( "cedil", "\u00b8" ); |
527 | 120 | parser.defineEntityReplacementText( "sup1", "\u00b9" ); |
528 | 120 | parser.defineEntityReplacementText( "ordm", "\u00ba" ); |
529 | 120 | parser.defineEntityReplacementText( "raquo", "\u00bb" ); |
530 | 120 | parser.defineEntityReplacementText( "frac14", "\u00bc" ); |
531 | 120 | parser.defineEntityReplacementText( "frac12", "\u00bd" ); |
532 | 120 | parser.defineEntityReplacementText( "frac34", "\u00be" ); |
533 | 120 | parser.defineEntityReplacementText( "iquest", "\u00bf" ); |
534 | 120 | parser.defineEntityReplacementText( "Agrave", "\u00c0" ); |
535 | 120 | parser.defineEntityReplacementText( "Aacute", "\u00c1" ); |
536 | 120 | parser.defineEntityReplacementText( "Acirc", "\u00c2" ); |
537 | 120 | parser.defineEntityReplacementText( "Atilde", "\u00c3" ); |
538 | 120 | parser.defineEntityReplacementText( "Auml", "\u00c4" ); |
539 | 120 | parser.defineEntityReplacementText( "Aring", "\u00c5" ); |
540 | 120 | parser.defineEntityReplacementText( "AElig", "\u00c6" ); |
541 | 120 | parser.defineEntityReplacementText( "Ccedil", "\u00c7" ); |
542 | 120 | parser.defineEntityReplacementText( "Egrave", "\u00c8" ); |
543 | 120 | parser.defineEntityReplacementText( "Eacute", "\u00c9" ); |
544 | 120 | parser.defineEntityReplacementText( "Ecirc", "\u00ca" ); |
545 | 120 | parser.defineEntityReplacementText( "Euml", "\u00cb" ); |
546 | 120 | parser.defineEntityReplacementText( "Igrave", "\u00cc" ); |
547 | 120 | parser.defineEntityReplacementText( "Iacute", "\u00cd" ); |
548 | 120 | parser.defineEntityReplacementText( "Icirc", "\u00ce" ); |
549 | 120 | parser.defineEntityReplacementText( "Iuml", "\u00cf" ); |
550 | 120 | parser.defineEntityReplacementText( "ETH", "\u00d0" ); |
551 | 120 | parser.defineEntityReplacementText( "Ntilde", "\u00d1" ); |
552 | 120 | parser.defineEntityReplacementText( "Ograve", "\u00d2" ); |
553 | 120 | parser.defineEntityReplacementText( "Oacute", "\u00d3" ); |
554 | 120 | parser.defineEntityReplacementText( "Ocirc", "\u00d4" ); |
555 | 120 | parser.defineEntityReplacementText( "Otilde", "\u00d5" ); |
556 | 120 | parser.defineEntityReplacementText( "Ouml", "\u00d6" ); |
557 | 120 | parser.defineEntityReplacementText( "times", "\u00d7" ); |
558 | 120 | parser.defineEntityReplacementText( "Oslash", "\u00d8" ); |
559 | 120 | parser.defineEntityReplacementText( "Ugrave", "\u00d9" ); |
560 | 120 | parser.defineEntityReplacementText( "Uacute", "\u00da" ); |
561 | 120 | parser.defineEntityReplacementText( "Ucirc", "\u00db" ); |
562 | 120 | parser.defineEntityReplacementText( "Uuml", "\u00dc" ); |
563 | 120 | parser.defineEntityReplacementText( "Yacute", "\u00dd" ); |
564 | 120 | parser.defineEntityReplacementText( "THORN", "\u00de" ); |
565 | 120 | parser.defineEntityReplacementText( "szlig", "\u00df" ); |
566 | 120 | parser.defineEntityReplacementText( "agrave", "\u00e0" ); |
567 | 120 | parser.defineEntityReplacementText( "aacute", "\u00e1" ); |
568 | 120 | parser.defineEntityReplacementText( "acirc", "\u00e2" ); |
569 | 120 | parser.defineEntityReplacementText( "atilde", "\u00e3" ); |
570 | 120 | parser.defineEntityReplacementText( "auml", "\u00e4" ); |
571 | 120 | parser.defineEntityReplacementText( "aring", "\u00e5" ); |
572 | 120 | parser.defineEntityReplacementText( "aelig", "\u00e6" ); |
573 | 120 | parser.defineEntityReplacementText( "ccedil", "\u00e7" ); |
574 | 120 | parser.defineEntityReplacementText( "egrave", "\u00e8" ); |
575 | 120 | parser.defineEntityReplacementText( "eacute", "\u00e9" ); |
576 | 120 | parser.defineEntityReplacementText( "ecirc", "\u00ea" ); |
577 | 120 | parser.defineEntityReplacementText( "euml", "\u00eb" ); |
578 | 120 | parser.defineEntityReplacementText( "igrave", "\u00ec" ); |
579 | 120 | parser.defineEntityReplacementText( "iacute", "\u00ed" ); |
580 | 120 | parser.defineEntityReplacementText( "icirc", "\u00ee" ); |
581 | 120 | parser.defineEntityReplacementText( "iuml", "\u00ef" ); |
582 | 120 | parser.defineEntityReplacementText( "eth", "\u00f0" ); |
583 | 120 | parser.defineEntityReplacementText( "ntilde", "\u00f1" ); |
584 | 120 | parser.defineEntityReplacementText( "ograve", "\u00f2" ); |
585 | 120 | parser.defineEntityReplacementText( "oacute", "\u00f3" ); |
586 | 120 | parser.defineEntityReplacementText( "ocirc", "\u00f4" ); |
587 | 120 | parser.defineEntityReplacementText( "otilde", "\u00f5" ); |
588 | 120 | parser.defineEntityReplacementText( "ouml", "\u00f6" ); |
589 | 120 | parser.defineEntityReplacementText( "divide", "\u00f7" ); |
590 | 120 | parser.defineEntityReplacementText( "oslash", "\u00f8" ); |
591 | 120 | parser.defineEntityReplacementText( "ugrave", "\u00f9" ); |
592 | 120 | parser.defineEntityReplacementText( "uacute", "\u00fa" ); |
593 | 120 | parser.defineEntityReplacementText( "ucirc", "\u00fb" ); |
594 | 120 | parser.defineEntityReplacementText( "uuml", "\u00fc" ); |
595 | 120 | parser.defineEntityReplacementText( "yacute", "\u00fd" ); |
596 | 120 | parser.defineEntityReplacementText( "thorn", "\u00fe" ); |
597 | 120 | parser.defineEntityReplacementText( "yuml", "\u00ff" ); |
598 | |
|
599 | |
|
600 | |
|
601 | |
|
602 | |
|
603 | 120 | parser.defineEntityReplacementText( "OElig", "\u0152" ); |
604 | 120 | parser.defineEntityReplacementText( "oelig", "\u0153" ); |
605 | 120 | parser.defineEntityReplacementText( "Scaron", "\u0160" ); |
606 | 120 | parser.defineEntityReplacementText( "scaron", "\u0161" ); |
607 | 120 | parser.defineEntityReplacementText( "Yuml", "\u0178" ); |
608 | 120 | parser.defineEntityReplacementText( "circ", "\u02c6" ); |
609 | 120 | parser.defineEntityReplacementText( "tilde", "\u02dc" ); |
610 | 120 | parser.defineEntityReplacementText( "ensp", "\u2002" ); |
611 | 120 | parser.defineEntityReplacementText( "emsp", "\u2003" ); |
612 | 120 | parser.defineEntityReplacementText( "thinsp", "\u2009" ); |
613 | 120 | parser.defineEntityReplacementText( "zwnj", "\u200c" ); |
614 | 120 | parser.defineEntityReplacementText( "zwj", "\u200d" ); |
615 | 120 | parser.defineEntityReplacementText( "lrm", "\u200e" ); |
616 | 120 | parser.defineEntityReplacementText( "rlm", "\u200f" ); |
617 | 120 | parser.defineEntityReplacementText( "ndash", "\u2013" ); |
618 | 120 | parser.defineEntityReplacementText( "mdash", "\u2014" ); |
619 | 120 | parser.defineEntityReplacementText( "lsquo", "\u2018" ); |
620 | 120 | parser.defineEntityReplacementText( "rsquo", "\u2019" ); |
621 | 120 | parser.defineEntityReplacementText( "sbquo", "\u201a" ); |
622 | 120 | parser.defineEntityReplacementText( "ldquo", "\u201c" ); |
623 | 120 | parser.defineEntityReplacementText( "rdquo", "\u201d" ); |
624 | 120 | parser.defineEntityReplacementText( "bdquo", "\u201e" ); |
625 | 120 | parser.defineEntityReplacementText( "dagger", "\u2020" ); |
626 | 120 | parser.defineEntityReplacementText( "Dagger", "\u2021" ); |
627 | 120 | parser.defineEntityReplacementText( "permil", "\u2030" ); |
628 | 120 | parser.defineEntityReplacementText( "lsaquo", "\u2039" ); |
629 | 120 | parser.defineEntityReplacementText( "rsaquo", "\u203a" ); |
630 | 120 | parser.defineEntityReplacementText( "euro", "\u20ac" ); |
631 | |
|
632 | |
|
633 | |
|
634 | |
|
635 | |
|
636 | 120 | parser.defineEntityReplacementText( "fnof", "\u0192" ); |
637 | 120 | parser.defineEntityReplacementText( "Alpha", "\u0391" ); |
638 | 120 | parser.defineEntityReplacementText( "Beta", "\u0392" ); |
639 | 120 | parser.defineEntityReplacementText( "Gamma", "\u0393" ); |
640 | 120 | parser.defineEntityReplacementText( "Delta", "\u0394" ); |
641 | 120 | parser.defineEntityReplacementText( "Epsilon", "\u0395" ); |
642 | 120 | parser.defineEntityReplacementText( "Zeta", "\u0396" ); |
643 | 120 | parser.defineEntityReplacementText( "Eta", "\u0397" ); |
644 | 120 | parser.defineEntityReplacementText( "Theta", "\u0398" ); |
645 | 120 | parser.defineEntityReplacementText( "Iota", "\u0399" ); |
646 | 120 | parser.defineEntityReplacementText( "Kappa", "\u039a" ); |
647 | 120 | parser.defineEntityReplacementText( "Lambda", "\u039b" ); |
648 | 120 | parser.defineEntityReplacementText( "Mu", "\u039c" ); |
649 | 120 | parser.defineEntityReplacementText( "Nu", "\u039d" ); |
650 | 120 | parser.defineEntityReplacementText( "Xi", "\u039e" ); |
651 | 120 | parser.defineEntityReplacementText( "Omicron", "\u039f" ); |
652 | 120 | parser.defineEntityReplacementText( "Pi", "\u03a0" ); |
653 | 120 | parser.defineEntityReplacementText( "Rho", "\u03a1" ); |
654 | 120 | parser.defineEntityReplacementText( "Sigma", "\u03a3" ); |
655 | 120 | parser.defineEntityReplacementText( "Tau", "\u03a4" ); |
656 | 120 | parser.defineEntityReplacementText( "Upsilon", "\u03a5" ); |
657 | 120 | parser.defineEntityReplacementText( "Phi", "\u03a6" ); |
658 | 120 | parser.defineEntityReplacementText( "Chi", "\u03a7" ); |
659 | 120 | parser.defineEntityReplacementText( "Psi", "\u03a8" ); |
660 | 120 | parser.defineEntityReplacementText( "Omega", "\u03a9" ); |
661 | 120 | parser.defineEntityReplacementText( "alpha", "\u03b1" ); |
662 | 120 | parser.defineEntityReplacementText( "beta", "\u03b2" ); |
663 | 120 | parser.defineEntityReplacementText( "gamma", "\u03b3" ); |
664 | 120 | parser.defineEntityReplacementText( "delta", "\u03b4" ); |
665 | 120 | parser.defineEntityReplacementText( "epsilon", "\u03b5" ); |
666 | 120 | parser.defineEntityReplacementText( "zeta", "\u03b6" ); |
667 | 120 | parser.defineEntityReplacementText( "eta", "\u03b7" ); |
668 | 120 | parser.defineEntityReplacementText( "theta", "\u03b8" ); |
669 | 120 | parser.defineEntityReplacementText( "iota", "\u03b9" ); |
670 | 120 | parser.defineEntityReplacementText( "kappa", "\u03ba" ); |
671 | 120 | parser.defineEntityReplacementText( "lambda", "\u03bb" ); |
672 | 120 | parser.defineEntityReplacementText( "mu", "\u03bc" ); |
673 | 120 | parser.defineEntityReplacementText( "nu", "\u03bd" ); |
674 | 120 | parser.defineEntityReplacementText( "xi", "\u03be" ); |
675 | 120 | parser.defineEntityReplacementText( "omicron", "\u03bf" ); |
676 | 120 | parser.defineEntityReplacementText( "pi", "\u03c0" ); |
677 | 120 | parser.defineEntityReplacementText( "rho", "\u03c1" ); |
678 | 120 | parser.defineEntityReplacementText( "sigmaf", "\u03c2" ); |
679 | 120 | parser.defineEntityReplacementText( "sigma", "\u03c3" ); |
680 | 120 | parser.defineEntityReplacementText( "tau", "\u03c4" ); |
681 | 120 | parser.defineEntityReplacementText( "upsilon", "\u03c5" ); |
682 | 120 | parser.defineEntityReplacementText( "phi", "\u03c6" ); |
683 | 120 | parser.defineEntityReplacementText( "chi", "\u03c7" ); |
684 | 120 | parser.defineEntityReplacementText( "psi", "\u03c8" ); |
685 | 120 | parser.defineEntityReplacementText( "omega", "\u03c9" ); |
686 | 120 | parser.defineEntityReplacementText( "thetasym", "\u03d1" ); |
687 | 120 | parser.defineEntityReplacementText( "upsih", "\u03d2" ); |
688 | 120 | parser.defineEntityReplacementText( "piv", "\u03d6" ); |
689 | 120 | parser.defineEntityReplacementText( "bull", "\u2022" ); |
690 | 120 | parser.defineEntityReplacementText( "hellip", "\u2026" ); |
691 | 120 | parser.defineEntityReplacementText( "prime", "\u2032" ); |
692 | 120 | parser.defineEntityReplacementText( "Prime", "\u2033" ); |
693 | 120 | parser.defineEntityReplacementText( "oline", "\u203e" ); |
694 | 120 | parser.defineEntityReplacementText( "frasl", "\u2044" ); |
695 | 120 | parser.defineEntityReplacementText( "weierp", "\u2118" ); |
696 | 120 | parser.defineEntityReplacementText( "image", "\u2111" ); |
697 | 120 | parser.defineEntityReplacementText( "real", "\u211c" ); |
698 | 120 | parser.defineEntityReplacementText( "trade", "\u2122" ); |
699 | 120 | parser.defineEntityReplacementText( "alefsym", "\u2135" ); |
700 | 120 | parser.defineEntityReplacementText( "larr", "\u2190" ); |
701 | 120 | parser.defineEntityReplacementText( "uarr", "\u2191" ); |
702 | 120 | parser.defineEntityReplacementText( "rarr", "\u2192" ); |
703 | 120 | parser.defineEntityReplacementText( "darr", "\u2193" ); |
704 | 120 | parser.defineEntityReplacementText( "harr", "\u2194" ); |
705 | 120 | parser.defineEntityReplacementText( "crarr", "\u21b5" ); |
706 | 120 | parser.defineEntityReplacementText( "lArr", "\u21d0" ); |
707 | 120 | parser.defineEntityReplacementText( "uArr", "\u21d1" ); |
708 | 120 | parser.defineEntityReplacementText( "rArr", "\u21d2" ); |
709 | 120 | parser.defineEntityReplacementText( "dArr", "\u21d3" ); |
710 | 120 | parser.defineEntityReplacementText( "hArr", "\u21d4" ); |
711 | 120 | parser.defineEntityReplacementText( "forall", "\u2200" ); |
712 | 120 | parser.defineEntityReplacementText( "part", "\u2202" ); |
713 | 120 | parser.defineEntityReplacementText( "exist", "\u2203" ); |
714 | 120 | parser.defineEntityReplacementText( "empty", "\u2205" ); |
715 | 120 | parser.defineEntityReplacementText( "nabla", "\u2207" ); |
716 | 120 | parser.defineEntityReplacementText( "isin", "\u2208" ); |
717 | 120 | parser.defineEntityReplacementText( "notin", "\u2209" ); |
718 | 120 | parser.defineEntityReplacementText( "ni", "\u220b" ); |
719 | 120 | parser.defineEntityReplacementText( "prod", "\u220f" ); |
720 | 120 | parser.defineEntityReplacementText( "sum", "\u2211" ); |
721 | 120 | parser.defineEntityReplacementText( "minus", "\u2212" ); |
722 | 120 | parser.defineEntityReplacementText( "lowast", "\u2217" ); |
723 | 120 | parser.defineEntityReplacementText( "radic", "\u221a" ); |
724 | 120 | parser.defineEntityReplacementText( "prop", "\u221d" ); |
725 | 120 | parser.defineEntityReplacementText( "infin", "\u221e" ); |
726 | 120 | parser.defineEntityReplacementText( "ang", "\u2220" ); |
727 | 120 | parser.defineEntityReplacementText( "and", "\u2227" ); |
728 | 120 | parser.defineEntityReplacementText( "or", "\u2228" ); |
729 | 120 | parser.defineEntityReplacementText( "cap", "\u2229" ); |
730 | 120 | parser.defineEntityReplacementText( "cup", "\u222a" ); |
731 | 120 | parser.defineEntityReplacementText( "int", "\u222b" ); |
732 | 120 | parser.defineEntityReplacementText( "there4", "\u2234" ); |
733 | 120 | parser.defineEntityReplacementText( "sim", "\u223c" ); |
734 | 120 | parser.defineEntityReplacementText( "cong", "\u2245" ); |
735 | 120 | parser.defineEntityReplacementText( "asymp", "\u2248" ); |
736 | 120 | parser.defineEntityReplacementText( "ne", "\u2260" ); |
737 | 120 | parser.defineEntityReplacementText( "equiv", "\u2261" ); |
738 | 120 | parser.defineEntityReplacementText( "le", "\u2264" ); |
739 | 120 | parser.defineEntityReplacementText( "ge", "\u2265" ); |
740 | 120 | parser.defineEntityReplacementText( "sub", "\u2282" ); |
741 | 120 | parser.defineEntityReplacementText( "sup", "\u2283" ); |
742 | 120 | parser.defineEntityReplacementText( "nsub", "\u2284" ); |
743 | 120 | parser.defineEntityReplacementText( "sube", "\u2286" ); |
744 | 120 | parser.defineEntityReplacementText( "supe", "\u2287" ); |
745 | 120 | parser.defineEntityReplacementText( "oplus", "\u2295" ); |
746 | 120 | parser.defineEntityReplacementText( "otimes", "\u2297" ); |
747 | 120 | parser.defineEntityReplacementText( "perp", "\u22a5" ); |
748 | 120 | parser.defineEntityReplacementText( "sdot", "\u22c5" ); |
749 | 120 | parser.defineEntityReplacementText( "lceil", "\u2308" ); |
750 | 120 | parser.defineEntityReplacementText( "rceil", "\u2309" ); |
751 | 120 | parser.defineEntityReplacementText( "lfloor", "\u230a" ); |
752 | 120 | parser.defineEntityReplacementText( "rfloor", "\u230b" ); |
753 | 120 | parser.defineEntityReplacementText( "lang", "\u2329" ); |
754 | 120 | parser.defineEntityReplacementText( "rang", "\u232a" ); |
755 | 120 | parser.defineEntityReplacementText( "loz", "\u25ca" ); |
756 | 120 | parser.defineEntityReplacementText( "spades", "\u2660" ); |
757 | 120 | parser.defineEntityReplacementText( "clubs", "\u2663" ); |
758 | 120 | parser.defineEntityReplacementText( "hearts", "\u2665" ); |
759 | 120 | parser.defineEntityReplacementText( "diams", "\u2666" ); |
760 | |
|
761 | |
} |
762 | 120 | } |
763 | |
|
764 | |
|
765 | |
|
766 | |
|
767 | |
|
768 | |
|
769 | |
|
770 | |
|
771 | |
|
772 | |
private int nextTag( XmlPullParser parser ) |
773 | |
throws IOException, XmlPullParserException |
774 | |
{ |
775 | 0 | int eventType = parser.next(); |
776 | 0 | if ( eventType == XmlPullParser.TEXT ) |
777 | |
{ |
778 | 0 | eventType = parser.next(); |
779 | |
} |
780 | 0 | if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG ) |
781 | |
{ |
782 | 0 | throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null ); |
783 | |
} |
784 | 0 | return eventType; |
785 | |
} |
786 | |
|
787 | |
|
788 | |
|
789 | |
|
790 | |
|
791 | |
|
792 | |
|
793 | |
|
794 | |
|
795 | |
|
796 | |
private Banner parseBanner( XmlPullParser parser, boolean strict ) |
797 | |
throws IOException, XmlPullParserException |
798 | |
{ |
799 | 128 | String tagName = parser.getName(); |
800 | 128 | Banner banner = new Banner(); |
801 | 128 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
802 | |
{ |
803 | 0 | String name = parser.getAttributeName( i ); |
804 | 0 | String value = parser.getAttributeValue( i ); |
805 | |
|
806 | 0 | if ( name.indexOf( ':' ) >= 0 ) |
807 | |
{ |
808 | |
|
809 | |
} |
810 | |
else |
811 | |
{ |
812 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
813 | |
} |
814 | |
} |
815 | 128 | java.util.Set parsed = new java.util.HashSet(); |
816 | 506 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
817 | |
{ |
818 | 378 | if ( checkFieldWithDuplicate( parser, "name", null, parsed ) ) |
819 | |
{ |
820 | 128 | banner.setName( getTrimmedValue( parser.nextText() ) ); |
821 | |
} |
822 | 250 | else if ( checkFieldWithDuplicate( parser, "src", null, parsed ) ) |
823 | |
{ |
824 | 122 | banner.setSrc( getTrimmedValue( parser.nextText() ) ); |
825 | |
} |
826 | 128 | else if ( checkFieldWithDuplicate( parser, "alt", null, parsed ) ) |
827 | |
{ |
828 | 0 | banner.setAlt( getTrimmedValue( parser.nextText() ) ); |
829 | |
} |
830 | 128 | else if ( checkFieldWithDuplicate( parser, "href", null, parsed ) ) |
831 | |
{ |
832 | 128 | banner.setHref( getTrimmedValue( parser.nextText() ) ); |
833 | |
} |
834 | 0 | else if ( checkFieldWithDuplicate( parser, "border", null, parsed ) ) |
835 | |
{ |
836 | 0 | banner.setBorder( getTrimmedValue( parser.nextText() ) ); |
837 | |
} |
838 | 0 | else if ( checkFieldWithDuplicate( parser, "width", null, parsed ) ) |
839 | |
{ |
840 | 0 | banner.setWidth( getTrimmedValue( parser.nextText() ) ); |
841 | |
} |
842 | 0 | else if ( checkFieldWithDuplicate( parser, "height", null, parsed ) ) |
843 | |
{ |
844 | 0 | banner.setHeight( getTrimmedValue( parser.nextText() ) ); |
845 | |
} |
846 | 0 | else if ( checkFieldWithDuplicate( parser, "title", null, parsed ) ) |
847 | |
{ |
848 | 0 | banner.setTitle( getTrimmedValue( parser.nextText() ) ); |
849 | |
} |
850 | |
else |
851 | |
{ |
852 | 0 | checkUnknownElement( parser, strict ); |
853 | |
} |
854 | |
} |
855 | 128 | return banner; |
856 | |
} |
857 | |
|
858 | |
|
859 | |
|
860 | |
|
861 | |
|
862 | |
|
863 | |
|
864 | |
|
865 | |
|
866 | |
|
867 | |
private Body parseBody( XmlPullParser parser, boolean strict ) |
868 | |
throws IOException, XmlPullParserException |
869 | |
{ |
870 | 68 | String tagName = parser.getName(); |
871 | 68 | Body body = new Body(); |
872 | 68 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
873 | |
{ |
874 | 0 | String name = parser.getAttributeName( i ); |
875 | 0 | String value = parser.getAttributeValue( i ); |
876 | |
|
877 | 0 | if ( name.indexOf( ':' ) >= 0 ) |
878 | |
{ |
879 | |
|
880 | |
} |
881 | |
else |
882 | |
{ |
883 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
884 | |
} |
885 | |
} |
886 | 68 | java.util.Set parsed = new java.util.HashSet(); |
887 | 278 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
888 | |
{ |
889 | 210 | if ( checkFieldWithDuplicate( parser, "head", null, parsed ) ) |
890 | |
{ |
891 | 18 | body.setHead( Xpp3DomBuilder.build( parser ) ); |
892 | |
} |
893 | 192 | else if ( checkFieldWithDuplicate( parser, "links", null, parsed ) ) |
894 | |
{ |
895 | 64 | java.util.List links = new java.util.ArrayList(); |
896 | 64 | body.setLinks( links ); |
897 | 128 | while ( parser.nextTag() == XmlPullParser.START_TAG ) |
898 | |
{ |
899 | 64 | if ( "item".equals( parser.getName() ) ) |
900 | |
{ |
901 | 64 | links.add( parseLinkItem( parser, strict ) ); |
902 | |
} |
903 | |
else |
904 | |
{ |
905 | 0 | checkUnknownElement( parser, strict ); |
906 | |
} |
907 | |
} |
908 | 64 | } |
909 | 128 | else if ( checkFieldWithDuplicate( parser, "breadcrumbs", null, parsed ) ) |
910 | |
{ |
911 | 46 | java.util.List breadcrumbs = new java.util.ArrayList(); |
912 | 46 | body.setBreadcrumbs( breadcrumbs ); |
913 | 106 | while ( parser.nextTag() == XmlPullParser.START_TAG ) |
914 | |
{ |
915 | 60 | if ( "item".equals( parser.getName() ) ) |
916 | |
{ |
917 | 60 | breadcrumbs.add( parseLinkItem( parser, strict ) ); |
918 | |
} |
919 | |
else |
920 | |
{ |
921 | 0 | checkUnknownElement( parser, strict ); |
922 | |
} |
923 | |
} |
924 | 46 | } |
925 | 82 | else if ( "menu".equals( parser.getName() ) ) |
926 | |
{ |
927 | 82 | java.util.List menus = body.getMenus(); |
928 | 82 | if ( menus == null ) |
929 | |
{ |
930 | 0 | menus = new java.util.ArrayList(); |
931 | 0 | body.setMenus( menus ); |
932 | |
} |
933 | 82 | menus.add( parseMenu( parser, strict ) ); |
934 | 82 | } |
935 | 0 | else if ( checkFieldWithDuplicate( parser, "footer", null, parsed ) ) |
936 | |
{ |
937 | 0 | body.setFooter( Xpp3DomBuilder.build( parser ) ); |
938 | |
} |
939 | |
else |
940 | |
{ |
941 | 0 | checkUnknownElement( parser, strict ); |
942 | |
} |
943 | |
} |
944 | 68 | return body; |
945 | |
} |
946 | |
|
947 | |
|
948 | |
|
949 | |
|
950 | |
|
951 | |
|
952 | |
|
953 | |
|
954 | |
|
955 | |
|
956 | |
private DecorationModel parseDecorationModel( XmlPullParser parser, boolean strict ) |
957 | |
throws IOException, XmlPullParserException |
958 | |
{ |
959 | 120 | String tagName = parser.getName(); |
960 | 120 | DecorationModel decorationModel = new DecorationModel(); |
961 | 600 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
962 | |
{ |
963 | 480 | String name = parser.getAttributeName( i ); |
964 | 480 | String value = parser.getAttributeValue( i ); |
965 | |
|
966 | 480 | if ( name.indexOf( ':' ) >= 0 ) |
967 | |
{ |
968 | |
|
969 | |
} |
970 | 240 | else if ( "xmlns".equals( name ) ) |
971 | |
{ |
972 | |
|
973 | |
} |
974 | 120 | else if ( "name".equals( name ) ) |
975 | |
{ |
976 | 120 | decorationModel.setName( getTrimmedValue( value ) ); |
977 | |
} |
978 | |
else |
979 | |
{ |
980 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
981 | |
} |
982 | |
} |
983 | 120 | java.util.Set parsed = new java.util.HashSet(); |
984 | 458 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
985 | |
{ |
986 | 338 | if ( checkFieldWithDuplicate( parser, "bannerLeft", null, parsed ) ) |
987 | |
{ |
988 | 64 | decorationModel.setBannerLeft( parseBanner( parser, strict ) ); |
989 | |
} |
990 | 274 | else if ( checkFieldWithDuplicate( parser, "bannerRight", null, parsed ) ) |
991 | |
{ |
992 | 64 | decorationModel.setBannerRight( parseBanner( parser, strict ) ); |
993 | |
} |
994 | 210 | else if ( checkFieldWithDuplicate( parser, "googleAdSenseClient", null, parsed ) ) |
995 | |
{ |
996 | 0 | decorationModel.setGoogleAdSenseClient( getTrimmedValue( parser.nextText() ) ); |
997 | |
} |
998 | 210 | else if ( checkFieldWithDuplicate( parser, "googleAdSenseSlot", null, parsed ) ) |
999 | |
{ |
1000 | 0 | decorationModel.setGoogleAdSenseSlot( getTrimmedValue( parser.nextText() ) ); |
1001 | |
} |
1002 | 210 | else if ( checkFieldWithDuplicate( parser, "googleAnalyticsAccountId", null, parsed ) ) |
1003 | |
{ |
1004 | 0 | decorationModel.setGoogleAnalyticsAccountId( getTrimmedValue( parser.nextText() ) ); |
1005 | |
} |
1006 | 210 | else if ( checkFieldWithDuplicate( parser, "publishDate", null, parsed ) ) |
1007 | |
{ |
1008 | 18 | decorationModel.setPublishDate( parsePublishDate( parser, strict ) ); |
1009 | |
} |
1010 | 192 | else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) ) |
1011 | |
{ |
1012 | 18 | decorationModel.setVersion( parseVersion( parser, strict ) ); |
1013 | |
} |
1014 | 174 | else if ( checkFieldWithDuplicate( parser, "poweredBy", null, parsed ) ) |
1015 | |
{ |
1016 | 64 | java.util.List poweredBy = new java.util.ArrayList(); |
1017 | 64 | decorationModel.setPoweredBy( poweredBy ); |
1018 | 128 | while ( parser.nextTag() == XmlPullParser.START_TAG ) |
1019 | |
{ |
1020 | 64 | if ( "logo".equals( parser.getName() ) ) |
1021 | |
{ |
1022 | 64 | poweredBy.add( parseLogo( parser, strict ) ); |
1023 | |
} |
1024 | |
else |
1025 | |
{ |
1026 | 0 | checkUnknownElement( parser, strict ); |
1027 | |
} |
1028 | |
} |
1029 | 64 | } |
1030 | 110 | else if ( checkFieldWithDuplicate( parser, "skin", null, parsed ) ) |
1031 | |
{ |
1032 | 24 | decorationModel.setSkin( parseSkin( parser, strict ) ); |
1033 | |
} |
1034 | 86 | else if ( checkFieldWithDuplicate( parser, "body", null, parsed ) ) |
1035 | |
{ |
1036 | 68 | decorationModel.setBody( parseBody( parser, strict ) ); |
1037 | |
} |
1038 | 18 | else if ( checkFieldWithDuplicate( parser, "custom", null, parsed ) ) |
1039 | |
{ |
1040 | 18 | decorationModel.setCustom( Xpp3DomBuilder.build( parser ) ); |
1041 | |
} |
1042 | |
else |
1043 | |
{ |
1044 | 0 | checkUnknownElement( parser, strict ); |
1045 | |
} |
1046 | |
} |
1047 | 120 | return decorationModel; |
1048 | |
} |
1049 | |
|
1050 | |
|
1051 | |
|
1052 | |
|
1053 | |
|
1054 | |
|
1055 | |
|
1056 | |
|
1057 | |
|
1058 | |
|
1059 | |
private LinkItem parseLinkItem( XmlPullParser parser, boolean strict ) |
1060 | |
throws IOException, XmlPullParserException |
1061 | |
{ |
1062 | 124 | String tagName = parser.getName(); |
1063 | 124 | LinkItem linkItem = new LinkItem(); |
1064 | 372 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1065 | |
{ |
1066 | 248 | String name = parser.getAttributeName( i ); |
1067 | 248 | String value = parser.getAttributeValue( i ); |
1068 | |
|
1069 | 248 | if ( name.indexOf( ':' ) >= 0 ) |
1070 | |
{ |
1071 | |
|
1072 | |
} |
1073 | 248 | else if ( "name".equals( name ) ) |
1074 | |
{ |
1075 | 124 | linkItem.setName( getTrimmedValue( value ) ); |
1076 | |
} |
1077 | 124 | else if ( "href".equals( name ) ) |
1078 | |
{ |
1079 | 124 | linkItem.setHref( getTrimmedValue( value ) ); |
1080 | |
} |
1081 | 0 | else if ( "img".equals( name ) ) |
1082 | |
{ |
1083 | 0 | linkItem.setImg( getTrimmedValue( value ) ); |
1084 | |
} |
1085 | 0 | else if ( "position".equals( name ) ) |
1086 | |
{ |
1087 | 0 | linkItem.setPosition( getTrimmedValue( value ) ); |
1088 | |
} |
1089 | 0 | else if ( "alt".equals( name ) ) |
1090 | |
{ |
1091 | 0 | linkItem.setAlt( getTrimmedValue( value ) ); |
1092 | |
} |
1093 | 0 | else if ( "border".equals( name ) ) |
1094 | |
{ |
1095 | 0 | linkItem.setBorder( getTrimmedValue( value ) ); |
1096 | |
} |
1097 | 0 | else if ( "width".equals( name ) ) |
1098 | |
{ |
1099 | 0 | linkItem.setWidth( getTrimmedValue( value ) ); |
1100 | |
} |
1101 | 0 | else if ( "height".equals( name ) ) |
1102 | |
{ |
1103 | 0 | linkItem.setHeight( getTrimmedValue( value ) ); |
1104 | |
} |
1105 | 0 | else if ( "target".equals( name ) ) |
1106 | |
{ |
1107 | 0 | linkItem.setTarget( getTrimmedValue( value ) ); |
1108 | |
} |
1109 | 0 | else if ( "title".equals( name ) ) |
1110 | |
{ |
1111 | 0 | linkItem.setTitle( getTrimmedValue( value ) ); |
1112 | |
} |
1113 | |
else |
1114 | |
{ |
1115 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1116 | |
} |
1117 | |
} |
1118 | 124 | java.util.Set parsed = new java.util.HashSet(); |
1119 | 124 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1120 | |
{ |
1121 | 0 | checkUnknownElement( parser, strict ); |
1122 | |
} |
1123 | 124 | return linkItem; |
1124 | |
} |
1125 | |
|
1126 | |
|
1127 | |
|
1128 | |
|
1129 | |
|
1130 | |
|
1131 | |
|
1132 | |
|
1133 | |
|
1134 | |
|
1135 | |
private Logo parseLogo( XmlPullParser parser, boolean strict ) |
1136 | |
throws IOException, XmlPullParserException |
1137 | |
{ |
1138 | 64 | String tagName = parser.getName(); |
1139 | 64 | Logo logo = new Logo(); |
1140 | 256 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1141 | |
{ |
1142 | 192 | String name = parser.getAttributeName( i ); |
1143 | 192 | String value = parser.getAttributeValue( i ); |
1144 | |
|
1145 | 192 | if ( name.indexOf( ':' ) >= 0 ) |
1146 | |
{ |
1147 | |
|
1148 | |
} |
1149 | 192 | else if ( "name".equals( name ) ) |
1150 | |
{ |
1151 | 64 | logo.setName( getTrimmedValue( value ) ); |
1152 | |
} |
1153 | 128 | else if ( "href".equals( name ) ) |
1154 | |
{ |
1155 | 64 | logo.setHref( getTrimmedValue( value ) ); |
1156 | |
} |
1157 | 64 | else if ( "img".equals( name ) ) |
1158 | |
{ |
1159 | 64 | logo.setImg( getTrimmedValue( value ) ); |
1160 | |
} |
1161 | 0 | else if ( "position".equals( name ) ) |
1162 | |
{ |
1163 | 0 | logo.setPosition( getTrimmedValue( value ) ); |
1164 | |
} |
1165 | 0 | else if ( "alt".equals( name ) ) |
1166 | |
{ |
1167 | 0 | logo.setAlt( getTrimmedValue( value ) ); |
1168 | |
} |
1169 | 0 | else if ( "border".equals( name ) ) |
1170 | |
{ |
1171 | 0 | logo.setBorder( getTrimmedValue( value ) ); |
1172 | |
} |
1173 | 0 | else if ( "width".equals( name ) ) |
1174 | |
{ |
1175 | 0 | logo.setWidth( getTrimmedValue( value ) ); |
1176 | |
} |
1177 | 0 | else if ( "height".equals( name ) ) |
1178 | |
{ |
1179 | 0 | logo.setHeight( getTrimmedValue( value ) ); |
1180 | |
} |
1181 | 0 | else if ( "target".equals( name ) ) |
1182 | |
{ |
1183 | 0 | logo.setTarget( getTrimmedValue( value ) ); |
1184 | |
} |
1185 | 0 | else if ( "title".equals( name ) ) |
1186 | |
{ |
1187 | 0 | logo.setTitle( getTrimmedValue( value ) ); |
1188 | |
} |
1189 | |
else |
1190 | |
{ |
1191 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1192 | |
} |
1193 | |
} |
1194 | 64 | java.util.Set parsed = new java.util.HashSet(); |
1195 | 64 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1196 | |
{ |
1197 | 0 | checkUnknownElement( parser, strict ); |
1198 | |
} |
1199 | 64 | return logo; |
1200 | |
} |
1201 | |
|
1202 | |
|
1203 | |
|
1204 | |
|
1205 | |
|
1206 | |
|
1207 | |
|
1208 | |
|
1209 | |
|
1210 | |
|
1211 | |
private Menu parseMenu( XmlPullParser parser, boolean strict ) |
1212 | |
throws IOException, XmlPullParserException |
1213 | |
{ |
1214 | 82 | String tagName = parser.getName(); |
1215 | 82 | Menu menu = new Menu(); |
1216 | 226 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1217 | |
{ |
1218 | 144 | String name = parser.getAttributeName( i ); |
1219 | 144 | String value = parser.getAttributeValue( i ); |
1220 | |
|
1221 | 144 | if ( name.indexOf( ':' ) >= 0 ) |
1222 | |
{ |
1223 | |
|
1224 | |
} |
1225 | 144 | else if ( "name".equals( name ) ) |
1226 | |
{ |
1227 | 82 | menu.setName( getTrimmedValue( value ) ); |
1228 | |
} |
1229 | 62 | else if ( "inherit".equals( name ) ) |
1230 | |
{ |
1231 | 62 | menu.setInherit( getTrimmedValue( value ) ); |
1232 | |
} |
1233 | 0 | else if ( "inheritAsRef".equals( name ) ) |
1234 | |
{ |
1235 | 0 | menu.setInheritAsRef( getBooleanValue( getTrimmedValue( value ), "inheritAsRef", parser, "false" ) ); |
1236 | |
} |
1237 | 0 | else if ( "ref".equals( name ) ) |
1238 | |
{ |
1239 | 0 | menu.setRef( getTrimmedValue( value ) ); |
1240 | |
} |
1241 | 0 | else if ( "img".equals( name ) ) |
1242 | |
{ |
1243 | 0 | menu.setImg( getTrimmedValue( value ) ); |
1244 | |
} |
1245 | 0 | else if ( "alt".equals( name ) ) |
1246 | |
{ |
1247 | 0 | menu.setAlt( getTrimmedValue( value ) ); |
1248 | |
} |
1249 | 0 | else if ( "position".equals( name ) ) |
1250 | |
{ |
1251 | 0 | menu.setPosition( getTrimmedValue( value ) ); |
1252 | |
} |
1253 | 0 | else if ( "border".equals( name ) ) |
1254 | |
{ |
1255 | 0 | menu.setBorder( getTrimmedValue( value ) ); |
1256 | |
} |
1257 | 0 | else if ( "width".equals( name ) ) |
1258 | |
{ |
1259 | 0 | menu.setWidth( getTrimmedValue( value ) ); |
1260 | |
} |
1261 | 0 | else if ( "height".equals( name ) ) |
1262 | |
{ |
1263 | 0 | menu.setHeight( getTrimmedValue( value ) ); |
1264 | |
} |
1265 | 0 | else if ( "title".equals( name ) ) |
1266 | |
{ |
1267 | 0 | menu.setTitle( getTrimmedValue( value ) ); |
1268 | |
} |
1269 | |
else |
1270 | |
{ |
1271 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1272 | |
} |
1273 | |
} |
1274 | 82 | java.util.Set parsed = new java.util.HashSet(); |
1275 | 184 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1276 | |
{ |
1277 | 102 | if ( "item".equals( parser.getName() ) ) |
1278 | |
{ |
1279 | 102 | java.util.List items = menu.getItems(); |
1280 | 102 | if ( items == null ) |
1281 | |
{ |
1282 | 0 | items = new java.util.ArrayList(); |
1283 | 0 | menu.setItems( items ); |
1284 | |
} |
1285 | 102 | items.add( parseMenuItem( parser, strict ) ); |
1286 | 102 | } |
1287 | |
else |
1288 | |
{ |
1289 | 0 | checkUnknownElement( parser, strict ); |
1290 | |
} |
1291 | |
} |
1292 | 82 | return menu; |
1293 | |
} |
1294 | |
|
1295 | |
|
1296 | |
|
1297 | |
|
1298 | |
|
1299 | |
|
1300 | |
|
1301 | |
|
1302 | |
|
1303 | |
|
1304 | |
private MenuItem parseMenuItem( XmlPullParser parser, boolean strict ) |
1305 | |
throws IOException, XmlPullParserException |
1306 | |
{ |
1307 | 102 | String tagName = parser.getName(); |
1308 | 102 | MenuItem menuItem = new MenuItem(); |
1309 | 306 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1310 | |
{ |
1311 | 204 | String name = parser.getAttributeName( i ); |
1312 | 204 | String value = parser.getAttributeValue( i ); |
1313 | |
|
1314 | 204 | if ( name.indexOf( ':' ) >= 0 ) |
1315 | |
{ |
1316 | |
|
1317 | |
} |
1318 | 204 | else if ( "collapse".equals( name ) ) |
1319 | |
{ |
1320 | 0 | menuItem.setCollapse( getBooleanValue( getTrimmedValue( value ), "collapse", parser, "false" ) ); |
1321 | |
} |
1322 | 204 | else if ( "ref".equals( name ) ) |
1323 | |
{ |
1324 | 0 | menuItem.setRef( getTrimmedValue( value ) ); |
1325 | |
} |
1326 | 204 | else if ( "name".equals( name ) ) |
1327 | |
{ |
1328 | 102 | menuItem.setName( getTrimmedValue( value ) ); |
1329 | |
} |
1330 | 102 | else if ( "href".equals( name ) ) |
1331 | |
{ |
1332 | 102 | menuItem.setHref( getTrimmedValue( value ) ); |
1333 | |
} |
1334 | 0 | else if ( "img".equals( name ) ) |
1335 | |
{ |
1336 | 0 | menuItem.setImg( getTrimmedValue( value ) ); |
1337 | |
} |
1338 | 0 | else if ( "position".equals( name ) ) |
1339 | |
{ |
1340 | 0 | menuItem.setPosition( getTrimmedValue( value ) ); |
1341 | |
} |
1342 | 0 | else if ( "alt".equals( name ) ) |
1343 | |
{ |
1344 | 0 | menuItem.setAlt( getTrimmedValue( value ) ); |
1345 | |
} |
1346 | 0 | else if ( "border".equals( name ) ) |
1347 | |
{ |
1348 | 0 | menuItem.setBorder( getTrimmedValue( value ) ); |
1349 | |
} |
1350 | 0 | else if ( "width".equals( name ) ) |
1351 | |
{ |
1352 | 0 | menuItem.setWidth( getTrimmedValue( value ) ); |
1353 | |
} |
1354 | 0 | else if ( "height".equals( name ) ) |
1355 | |
{ |
1356 | 0 | menuItem.setHeight( getTrimmedValue( value ) ); |
1357 | |
} |
1358 | 0 | else if ( "target".equals( name ) ) |
1359 | |
{ |
1360 | 0 | menuItem.setTarget( getTrimmedValue( value ) ); |
1361 | |
} |
1362 | 0 | else if ( "title".equals( name ) ) |
1363 | |
{ |
1364 | 0 | menuItem.setTitle( getTrimmedValue( value ) ); |
1365 | |
} |
1366 | |
else |
1367 | |
{ |
1368 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1369 | |
} |
1370 | |
} |
1371 | 102 | java.util.Set parsed = new java.util.HashSet(); |
1372 | 102 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1373 | |
{ |
1374 | 0 | if ( checkFieldWithDuplicate( parser, "description", null, parsed ) ) |
1375 | |
{ |
1376 | 0 | menuItem.setDescription( getTrimmedValue( parser.nextText() ) ); |
1377 | |
} |
1378 | 0 | else if ( "item".equals( parser.getName() ) ) |
1379 | |
{ |
1380 | 0 | java.util.List items = menuItem.getItems(); |
1381 | 0 | if ( items == null ) |
1382 | |
{ |
1383 | 0 | items = new java.util.ArrayList(); |
1384 | 0 | menuItem.setItems( items ); |
1385 | |
} |
1386 | 0 | items.add( parseMenuItem( parser, strict ) ); |
1387 | 0 | } |
1388 | |
else |
1389 | |
{ |
1390 | 0 | checkUnknownElement( parser, strict ); |
1391 | |
} |
1392 | |
} |
1393 | 102 | return menuItem; |
1394 | |
} |
1395 | |
|
1396 | |
|
1397 | |
|
1398 | |
|
1399 | |
|
1400 | |
|
1401 | |
|
1402 | |
|
1403 | |
|
1404 | |
|
1405 | |
private PublishDate parsePublishDate( XmlPullParser parser, boolean strict ) |
1406 | |
throws IOException, XmlPullParserException |
1407 | |
{ |
1408 | 18 | String tagName = parser.getName(); |
1409 | 18 | PublishDate publishDate = new PublishDate(); |
1410 | 54 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1411 | |
{ |
1412 | 36 | String name = parser.getAttributeName( i ); |
1413 | 36 | String value = parser.getAttributeValue( i ); |
1414 | |
|
1415 | 36 | if ( name.indexOf( ':' ) >= 0 ) |
1416 | |
{ |
1417 | |
|
1418 | |
} |
1419 | 36 | else if ( "position".equals( name ) ) |
1420 | |
{ |
1421 | 18 | publishDate.setPosition( getTrimmedValue( value ) ); |
1422 | |
} |
1423 | 18 | else if ( "format".equals( name ) ) |
1424 | |
{ |
1425 | 18 | publishDate.setFormat( getTrimmedValue( value ) ); |
1426 | |
} |
1427 | |
else |
1428 | |
{ |
1429 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1430 | |
} |
1431 | |
} |
1432 | 18 | java.util.Set parsed = new java.util.HashSet(); |
1433 | 18 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1434 | |
{ |
1435 | 0 | checkUnknownElement( parser, strict ); |
1436 | |
} |
1437 | 18 | return publishDate; |
1438 | |
} |
1439 | |
|
1440 | |
|
1441 | |
|
1442 | |
|
1443 | |
|
1444 | |
|
1445 | |
|
1446 | |
|
1447 | |
|
1448 | |
|
1449 | |
private Skin parseSkin( XmlPullParser parser, boolean strict ) |
1450 | |
throws IOException, XmlPullParserException |
1451 | |
{ |
1452 | 24 | String tagName = parser.getName(); |
1453 | 24 | Skin skin = new Skin(); |
1454 | 24 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1455 | |
{ |
1456 | 0 | String name = parser.getAttributeName( i ); |
1457 | 0 | String value = parser.getAttributeValue( i ); |
1458 | |
|
1459 | 0 | if ( name.indexOf( ':' ) >= 0 ) |
1460 | |
{ |
1461 | |
|
1462 | |
} |
1463 | |
else |
1464 | |
{ |
1465 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1466 | |
} |
1467 | |
} |
1468 | 24 | java.util.Set parsed = new java.util.HashSet(); |
1469 | 72 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1470 | |
{ |
1471 | 48 | if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) ) |
1472 | |
{ |
1473 | 24 | skin.setGroupId( getTrimmedValue( parser.nextText() ) ); |
1474 | |
} |
1475 | 24 | else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) ) |
1476 | |
{ |
1477 | 24 | skin.setArtifactId( getTrimmedValue( parser.nextText() ) ); |
1478 | |
} |
1479 | 0 | else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) ) |
1480 | |
{ |
1481 | 0 | skin.setVersion( getTrimmedValue( parser.nextText() ) ); |
1482 | |
} |
1483 | |
else |
1484 | |
{ |
1485 | 0 | checkUnknownElement( parser, strict ); |
1486 | |
} |
1487 | |
} |
1488 | 24 | return skin; |
1489 | |
} |
1490 | |
|
1491 | |
|
1492 | |
|
1493 | |
|
1494 | |
|
1495 | |
|
1496 | |
|
1497 | |
|
1498 | |
|
1499 | |
|
1500 | |
private Version parseVersion( XmlPullParser parser, boolean strict ) |
1501 | |
throws IOException, XmlPullParserException |
1502 | |
{ |
1503 | 18 | String tagName = parser.getName(); |
1504 | 18 | Version version = new Version(); |
1505 | 36 | for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) |
1506 | |
{ |
1507 | 18 | String name = parser.getAttributeName( i ); |
1508 | 18 | String value = parser.getAttributeValue( i ); |
1509 | |
|
1510 | 18 | if ( name.indexOf( ':' ) >= 0 ) |
1511 | |
{ |
1512 | |
|
1513 | |
} |
1514 | 18 | else if ( "position".equals( name ) ) |
1515 | |
{ |
1516 | 18 | version.setPosition( getTrimmedValue( value ) ); |
1517 | |
} |
1518 | |
else |
1519 | |
{ |
1520 | 0 | checkUnknownAttribute( parser, name, tagName, strict ); |
1521 | |
} |
1522 | |
} |
1523 | 18 | java.util.Set parsed = new java.util.HashSet(); |
1524 | 18 | while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG ) |
1525 | |
{ |
1526 | 0 | checkUnknownElement( parser, strict ); |
1527 | |
} |
1528 | 18 | return version; |
1529 | |
} |
1530 | |
|
1531 | |
|
1532 | |
|
1533 | |
|
1534 | |
|
1535 | |
|
1536 | |
|
1537 | |
|
1538 | |
|
1539 | |
|
1540 | |
public DecorationModel read( Reader reader, boolean strict ) |
1541 | |
throws IOException, XmlPullParserException |
1542 | |
{ |
1543 | 120 | XmlPullParser parser = new MXParser(); |
1544 | |
|
1545 | 120 | parser.setInput( reader ); |
1546 | |
|
1547 | 120 | initParser( parser ); |
1548 | |
|
1549 | 120 | return read( parser, strict ); |
1550 | |
} |
1551 | |
|
1552 | |
|
1553 | |
|
1554 | |
|
1555 | |
|
1556 | |
|
1557 | |
|
1558 | |
|
1559 | |
|
1560 | |
public DecorationModel read( Reader reader ) |
1561 | |
throws IOException, XmlPullParserException |
1562 | |
{ |
1563 | 120 | return read( reader, true ); |
1564 | |
} |
1565 | |
|
1566 | |
|
1567 | |
|
1568 | |
|
1569 | |
|
1570 | |
|
1571 | |
|
1572 | |
|
1573 | |
|
1574 | |
|
1575 | |
public DecorationModel read( InputStream in, boolean strict ) |
1576 | |
throws IOException, XmlPullParserException |
1577 | |
{ |
1578 | 0 | return read( ReaderFactory.newXmlReader( in ), strict ); |
1579 | |
} |
1580 | |
|
1581 | |
|
1582 | |
|
1583 | |
|
1584 | |
|
1585 | |
|
1586 | |
|
1587 | |
|
1588 | |
|
1589 | |
public DecorationModel read( InputStream in ) |
1590 | |
throws IOException, XmlPullParserException |
1591 | |
{ |
1592 | 0 | return read( ReaderFactory.newXmlReader( in ) ); |
1593 | |
} |
1594 | |
|
1595 | |
|
1596 | |
|
1597 | |
|
1598 | |
|
1599 | |
|
1600 | |
|
1601 | |
|
1602 | |
|
1603 | |
|
1604 | |
private DecorationModel read( XmlPullParser parser, boolean strict ) |
1605 | |
throws IOException, XmlPullParserException |
1606 | |
{ |
1607 | 120 | int eventType = parser.getEventType(); |
1608 | 240 | while ( eventType != XmlPullParser.END_DOCUMENT ) |
1609 | |
{ |
1610 | 240 | if ( eventType == XmlPullParser.START_TAG ) |
1611 | |
{ |
1612 | 120 | if ( strict && ! "project".equals( parser.getName() ) ) |
1613 | |
{ |
1614 | 0 | throw new XmlPullParserException( "Expected root element 'project' but found '" + parser.getName() + "'", parser, null ); |
1615 | |
} |
1616 | 120 | DecorationModel decorationModel = parseDecorationModel( parser, strict ); |
1617 | 120 | decorationModel.setModelEncoding( parser.getInputEncoding() ); |
1618 | 120 | return decorationModel; |
1619 | |
} |
1620 | 120 | eventType = parser.next(); |
1621 | |
} |
1622 | 0 | throw new XmlPullParserException( "Expected root element 'project' but found no element at all: invalid XML document", parser, null ); |
1623 | |
} |
1624 | |
|
1625 | |
|
1626 | |
|
1627 | |
|
1628 | |
|
1629 | |
|
1630 | |
public void setAddDefaultEntities( boolean addDefaultEntities ) |
1631 | |
{ |
1632 | 0 | this.addDefaultEntities = addDefaultEntities; |
1633 | 0 | } |
1634 | |
|
1635 | |
} |