1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.maven.model.io.xpp3;
25
26
27
28
29
30 import java.io.IOException;
31 import java.io.InputStream;
32 import java.io.Reader;
33 import java.text.DateFormat;
34 import org.apache.maven.model.Activation;
35 import org.apache.maven.model.ActivationFile;
36 import org.apache.maven.model.ActivationOS;
37 import org.apache.maven.model.ActivationProperty;
38 import org.apache.maven.model.Build;
39 import org.apache.maven.model.BuildBase;
40 import org.apache.maven.model.CiManagement;
41 import org.apache.maven.model.ConfigurationContainer;
42 import org.apache.maven.model.Contributor;
43 import org.apache.maven.model.Dependency;
44 import org.apache.maven.model.DependencyManagement;
45 import org.apache.maven.model.DeploymentRepository;
46 import org.apache.maven.model.Developer;
47 import org.apache.maven.model.DistributionManagement;
48 import org.apache.maven.model.Exclusion;
49 import org.apache.maven.model.Extension;
50 import org.apache.maven.model.FileSet;
51 import org.apache.maven.model.InputLocation;
52 import org.apache.maven.model.InputSource;
53 import org.apache.maven.model.IssueManagement;
54 import org.apache.maven.model.License;
55 import org.apache.maven.model.MailingList;
56 import org.apache.maven.model.Model;
57 import org.apache.maven.model.ModelBase;
58 import org.apache.maven.model.Notifier;
59 import org.apache.maven.model.Organization;
60 import org.apache.maven.model.Parent;
61 import org.apache.maven.model.PatternSet;
62 import org.apache.maven.model.Plugin;
63 import org.apache.maven.model.PluginConfiguration;
64 import org.apache.maven.model.PluginContainer;
65 import org.apache.maven.model.PluginExecution;
66 import org.apache.maven.model.PluginManagement;
67 import org.apache.maven.model.Prerequisites;
68 import org.apache.maven.model.Profile;
69 import org.apache.maven.model.Relocation;
70 import org.apache.maven.model.ReportPlugin;
71 import org.apache.maven.model.ReportSet;
72 import org.apache.maven.model.Reporting;
73 import org.apache.maven.model.Repository;
74 import org.apache.maven.model.RepositoryBase;
75 import org.apache.maven.model.RepositoryPolicy;
76 import org.apache.maven.model.Resource;
77 import org.apache.maven.model.Scm;
78 import org.apache.maven.model.Site;
79 import org.codehaus.plexus.util.xml.XmlStreamReader;
80 import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
81 import org.codehaus.plexus.util.xml.pull.MXParser;
82 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
83 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
84
85
86
87
88
89
90 @SuppressWarnings( "all" )
91 public class MavenXpp3ReaderEx
92 {
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108 private boolean addDefaultEntities = true;
109
110
111
112
113 public final ContentTransformer contentTransformer;
114
115
116
117
118
119
120 public MavenXpp3ReaderEx()
121 {
122 this( new ContentTransformer()
123 {
124 public String transform( String source, String fieldName )
125 {
126 return source;
127 }
128 } );
129 }
130
131 public MavenXpp3ReaderEx(ContentTransformer contentTransformer)
132 {
133 this.contentTransformer = contentTransformer;
134 }
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152 private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set<String> parsed )
153 throws XmlPullParserException
154 {
155 if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
156 {
157 return false;
158 }
159 if ( !parsed.add( tagName ) )
160 {
161 throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
162 }
163 return true;
164 }
165
166
167
168
169
170
171
172
173
174
175
176
177 private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict )
178 throws XmlPullParserException, IOException
179 {
180
181 if ( strict )
182 {
183 throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null );
184 }
185 }
186
187
188
189
190
191
192
193
194
195
196 private void checkUnknownElement( XmlPullParser parser, boolean strict )
197 throws XmlPullParserException, IOException
198 {
199 if ( strict )
200 {
201 throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
202 }
203
204 for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; )
205 {
206 int eventType = parser.next();
207 if ( eventType == XmlPullParser.START_TAG )
208 {
209 unrecognizedTagCount++;
210 }
211 else if ( eventType == XmlPullParser.END_TAG )
212 {
213 unrecognizedTagCount--;
214 }
215 }
216 }
217
218
219
220
221
222
223 public boolean getAddDefaultEntities()
224 {
225 return addDefaultEntities;
226 }
227
228
229
230
231
232
233
234
235
236
237
238 private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
239 throws XmlPullParserException
240 {
241 return getBooleanValue( s, attribute, parser, null );
242 }
243
244
245
246
247
248
249
250
251
252
253
254
255 private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
256 throws XmlPullParserException
257 {
258 if ( s != null && s.length() != 0 )
259 {
260 return Boolean.valueOf( s ).booleanValue();
261 }
262 if ( defaultValue != null )
263 {
264 return Boolean.valueOf( defaultValue ).booleanValue();
265 }
266 return false;
267 }
268
269
270
271
272
273
274
275
276
277
278
279
280 private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
281 throws XmlPullParserException
282 {
283 if ( s != null )
284 {
285 try
286 {
287 return Byte.valueOf( s ).byteValue();
288 }
289 catch ( NumberFormatException nfe )
290 {
291 if ( strict )
292 {
293 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe );
294 }
295 }
296 }
297 return 0;
298 }
299
300
301
302
303
304
305
306
307
308
309
310 private char getCharacterValue( String s, String attribute, XmlPullParser parser )
311 throws XmlPullParserException
312 {
313 if ( s != null )
314 {
315 return s.charAt( 0 );
316 }
317 return 0;
318 }
319
320
321
322
323
324
325
326
327
328
329
330 private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser )
331 throws XmlPullParserException
332 {
333 return getDateValue( s, attribute, null, parser );
334 }
335
336
337
338
339
340
341
342
343
344
345
346
347 private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
348 throws XmlPullParserException
349 {
350 if ( s != null )
351 {
352 String effectiveDateFormat = dateFormat;
353 if ( dateFormat == null )
354 {
355 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
356 }
357 if ( "long".equals( effectiveDateFormat ) )
358 {
359 try
360 {
361 return new java.util.Date( Long.parseLong( s ) );
362 }
363 catch ( NumberFormatException e )
364 {
365 throw new XmlPullParserException( e.getMessage(), parser, e );
366 }
367 }
368 else
369 {
370 try
371 {
372 DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
373 return dateParser.parse( s );
374 }
375 catch ( java.text.ParseException e )
376 {
377 throw new XmlPullParserException( e.getMessage(), parser, e );
378 }
379 }
380 }
381 return null;
382 }
383
384
385
386
387
388
389
390
391
392
393
394
395 private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
396 throws XmlPullParserException
397 {
398 if ( s != null )
399 {
400 try
401 {
402 return Double.valueOf( s ).doubleValue();
403 }
404 catch ( NumberFormatException nfe )
405 {
406 if ( strict )
407 {
408 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
409 }
410 }
411 }
412 return 0;
413 }
414
415
416
417
418
419
420
421
422
423
424
425
426 private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
427 throws XmlPullParserException
428 {
429 if ( s != null )
430 {
431 try
432 {
433 return Float.valueOf( s ).floatValue();
434 }
435 catch ( NumberFormatException nfe )
436 {
437 if ( strict )
438 {
439 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
440 }
441 }
442 }
443 return 0;
444 }
445
446
447
448
449
450
451
452
453
454
455
456
457 private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
458 throws XmlPullParserException
459 {
460 if ( s != null )
461 {
462 try
463 {
464 return Integer.valueOf( s ).intValue();
465 }
466 catch ( NumberFormatException nfe )
467 {
468 if ( strict )
469 {
470 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe );
471 }
472 }
473 }
474 return 0;
475 }
476
477
478
479
480
481
482
483
484
485
486
487
488 private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
489 throws XmlPullParserException
490 {
491 if ( s != null )
492 {
493 try
494 {
495 return Long.valueOf( s ).longValue();
496 }
497 catch ( NumberFormatException nfe )
498 {
499 if ( strict )
500 {
501 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe );
502 }
503 }
504 }
505 return 0;
506 }
507
508
509
510
511
512
513
514
515
516
517
518
519 private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
520 throws XmlPullParserException
521 {
522 if ( s == null )
523 {
524 if ( strict )
525 {
526 throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
527 }
528 }
529 return s;
530 }
531
532
533
534
535
536
537
538
539
540
541
542
543 private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
544 throws XmlPullParserException
545 {
546 if ( s != null )
547 {
548 try
549 {
550 return Short.valueOf( s ).shortValue();
551 }
552 catch ( NumberFormatException nfe )
553 {
554 if ( strict )
555 {
556 throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe );
557 }
558 }
559 }
560 return 0;
561 }
562
563
564
565
566
567
568
569 private String getTrimmedValue( String s )
570 {
571 if ( s != null )
572 {
573 s = s.trim();
574 }
575 return s;
576 }
577
578
579
580
581
582
583
584
585 private String interpolatedTrimmed( String value, String context )
586 {
587 return getTrimmedValue( contentTransformer.transform( value, context ) );
588 }
589
590
591
592
593
594
595
596
597
598
599 private int nextTag( XmlPullParser parser )
600 throws IOException, XmlPullParserException
601 {
602 int eventType = parser.next();
603 if ( eventType == XmlPullParser.TEXT )
604 {
605 eventType = parser.next();
606 }
607 if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG )
608 {
609 throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null );
610 }
611 return eventType;
612 }
613
614
615
616
617
618
619
620
621
622
623
624
625 public Model read( XmlPullParser parser, boolean strict, InputSource source )
626 throws IOException, XmlPullParserException
627 {
628 Model model = null;
629 int eventType = parser.getEventType();
630 boolean parsed = false;
631 while ( eventType != XmlPullParser.END_DOCUMENT )
632 {
633 if ( eventType == XmlPullParser.START_TAG )
634 {
635 if ( strict && ! "project".equals( parser.getName() ) )
636 {
637 throw new XmlPullParserException( "Expected root element 'project' but found '" + parser.getName() + "'", parser, null );
638 }
639 else if ( parsed )
640 {
641
642 throw new XmlPullParserException( "Duplicated tag: 'project'", parser, null );
643 }
644 model = parseModel( parser, strict, source );
645 model.setModelEncoding( parser.getInputEncoding() );
646 parsed = true;
647 }
648 eventType = parser.next();
649 }
650 if ( parsed )
651 {
652 return model;
653 }
654 throw new XmlPullParserException( "Expected root element 'project' but found no element at all: invalid XML document", parser, null );
655 }
656
657
658
659
660
661
662
663
664
665
666
667
668 public Model read( Reader reader, boolean strict, InputSource source )
669 throws IOException, XmlPullParserException
670 {
671 XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
672
673 parser.setInput( reader );
674
675
676 return read( parser, strict, source );
677 }
678
679
680
681
682
683
684
685
686
687
688
689
690 public Model read( InputStream in, boolean strict, InputSource source )
691 throws IOException, XmlPullParserException
692 {
693 return read( new XmlStreamReader( in ), strict, source );
694 }
695
696
697
698
699
700
701
702
703
704
705
706
707 private Activation parseActivation( XmlPullParser parser, boolean strict, InputSource source )
708 throws IOException, XmlPullParserException
709 {
710 String tagName = parser.getName();
711 Activation activation = new Activation();
712 InputLocation _location;
713 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
714 activation.setLocation( "", _location );
715 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
716 {
717 String name = parser.getAttributeName( i );
718 String value = parser.getAttributeValue( i );
719
720 if ( name.indexOf( ':' ) >= 0 )
721 {
722
723 }
724 else
725 {
726 checkUnknownAttribute( parser, name, tagName, strict );
727 }
728 }
729 java.util.Set<String> parsed = new java.util.HashSet<String>();
730 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
731 {
732 if ( checkFieldWithDuplicate( parser, "activeByDefault", null, parsed ) )
733 {
734 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
735 activation.setLocation( "activeByDefault", _location );
736 activation.setActiveByDefault( getBooleanValue( interpolatedTrimmed( parser.nextText(), "activeByDefault" ), "activeByDefault", parser, "false" ) );
737 }
738 else if ( checkFieldWithDuplicate( parser, "jdk", null, parsed ) )
739 {
740 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
741 activation.setLocation( "jdk", _location );
742 activation.setJdk( interpolatedTrimmed( parser.nextText(), "jdk" ) );
743 }
744 else if ( checkFieldWithDuplicate( parser, "os", null, parsed ) )
745 {
746 activation.setOs( parseActivationOS( parser, strict, source ) );
747 }
748 else if ( checkFieldWithDuplicate( parser, "property", null, parsed ) )
749 {
750 activation.setProperty( parseActivationProperty( parser, strict, source ) );
751 }
752 else if ( checkFieldWithDuplicate( parser, "file", null, parsed ) )
753 {
754 activation.setFile( parseActivationFile( parser, strict, source ) );
755 }
756 else
757 {
758 checkUnknownElement( parser, strict );
759 }
760 }
761 return activation;
762 }
763
764
765
766
767
768
769
770
771
772
773
774
775 private ActivationFile parseActivationFile( XmlPullParser parser, boolean strict, InputSource source )
776 throws IOException, XmlPullParserException
777 {
778 String tagName = parser.getName();
779 ActivationFile activationFile = new ActivationFile();
780 InputLocation _location;
781 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
782 activationFile.setLocation( "", _location );
783 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
784 {
785 String name = parser.getAttributeName( i );
786 String value = parser.getAttributeValue( i );
787
788 if ( name.indexOf( ':' ) >= 0 )
789 {
790
791 }
792 else
793 {
794 checkUnknownAttribute( parser, name, tagName, strict );
795 }
796 }
797 java.util.Set<String> parsed = new java.util.HashSet<String>();
798 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
799 {
800 if ( checkFieldWithDuplicate( parser, "missing", null, parsed ) )
801 {
802 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
803 activationFile.setLocation( "missing", _location );
804 activationFile.setMissing( interpolatedTrimmed( parser.nextText(), "missing" ) );
805 }
806 else if ( checkFieldWithDuplicate( parser, "exists", null, parsed ) )
807 {
808 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
809 activationFile.setLocation( "exists", _location );
810 activationFile.setExists( interpolatedTrimmed( parser.nextText(), "exists" ) );
811 }
812 else
813 {
814 checkUnknownElement( parser, strict );
815 }
816 }
817 return activationFile;
818 }
819
820
821
822
823
824
825
826
827
828
829
830
831 private ActivationOS parseActivationOS( XmlPullParser parser, boolean strict, InputSource source )
832 throws IOException, XmlPullParserException
833 {
834 String tagName = parser.getName();
835 ActivationOS activationOS = new ActivationOS();
836 InputLocation _location;
837 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
838 activationOS.setLocation( "", _location );
839 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
840 {
841 String name = parser.getAttributeName( i );
842 String value = parser.getAttributeValue( i );
843
844 if ( name.indexOf( ':' ) >= 0 )
845 {
846
847 }
848 else
849 {
850 checkUnknownAttribute( parser, name, tagName, strict );
851 }
852 }
853 java.util.Set<String> parsed = new java.util.HashSet<String>();
854 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
855 {
856 if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
857 {
858 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
859 activationOS.setLocation( "name", _location );
860 activationOS.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
861 }
862 else if ( checkFieldWithDuplicate( parser, "family", null, parsed ) )
863 {
864 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
865 activationOS.setLocation( "family", _location );
866 activationOS.setFamily( interpolatedTrimmed( parser.nextText(), "family" ) );
867 }
868 else if ( checkFieldWithDuplicate( parser, "arch", null, parsed ) )
869 {
870 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
871 activationOS.setLocation( "arch", _location );
872 activationOS.setArch( interpolatedTrimmed( parser.nextText(), "arch" ) );
873 }
874 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
875 {
876 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
877 activationOS.setLocation( "version", _location );
878 activationOS.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
879 }
880 else
881 {
882 checkUnknownElement( parser, strict );
883 }
884 }
885 return activationOS;
886 }
887
888
889
890
891
892
893
894
895
896
897
898
899 private ActivationProperty parseActivationProperty( XmlPullParser parser, boolean strict, InputSource source )
900 throws IOException, XmlPullParserException
901 {
902 String tagName = parser.getName();
903 ActivationProperty activationProperty = new ActivationProperty();
904 InputLocation _location;
905 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
906 activationProperty.setLocation( "", _location );
907 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
908 {
909 String name = parser.getAttributeName( i );
910 String value = parser.getAttributeValue( i );
911
912 if ( name.indexOf( ':' ) >= 0 )
913 {
914
915 }
916 else
917 {
918 checkUnknownAttribute( parser, name, tagName, strict );
919 }
920 }
921 java.util.Set<String> parsed = new java.util.HashSet<String>();
922 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
923 {
924 if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
925 {
926 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
927 activationProperty.setLocation( "name", _location );
928 activationProperty.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
929 }
930 else if ( checkFieldWithDuplicate( parser, "value", null, parsed ) )
931 {
932 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
933 activationProperty.setLocation( "value", _location );
934 activationProperty.setValue( interpolatedTrimmed( parser.nextText(), "value" ) );
935 }
936 else
937 {
938 checkUnknownElement( parser, strict );
939 }
940 }
941 return activationProperty;
942 }
943
944
945
946
947
948
949
950
951
952
953
954
955 private Build parseBuild( XmlPullParser parser, boolean strict, InputSource source )
956 throws IOException, XmlPullParserException
957 {
958 String tagName = parser.getName();
959 Build build = new Build();
960 InputLocation _location;
961 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
962 build.setLocation( "", _location );
963 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
964 {
965 String name = parser.getAttributeName( i );
966 String value = parser.getAttributeValue( i );
967
968 if ( name.indexOf( ':' ) >= 0 )
969 {
970
971 }
972 else
973 {
974 checkUnknownAttribute( parser, name, tagName, strict );
975 }
976 }
977 java.util.Set<String> parsed = new java.util.HashSet<String>();
978 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
979 {
980 if ( checkFieldWithDuplicate( parser, "sourceDirectory", null, parsed ) )
981 {
982 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
983 build.setLocation( "sourceDirectory", _location );
984 build.setSourceDirectory( interpolatedTrimmed( parser.nextText(), "sourceDirectory" ) );
985 }
986 else if ( checkFieldWithDuplicate( parser, "scriptSourceDirectory", null, parsed ) )
987 {
988 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
989 build.setLocation( "scriptSourceDirectory", _location );
990 build.setScriptSourceDirectory( interpolatedTrimmed( parser.nextText(), "scriptSourceDirectory" ) );
991 }
992 else if ( checkFieldWithDuplicate( parser, "testSourceDirectory", null, parsed ) )
993 {
994 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
995 build.setLocation( "testSourceDirectory", _location );
996 build.setTestSourceDirectory( interpolatedTrimmed( parser.nextText(), "testSourceDirectory" ) );
997 }
998 else if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
999 {
1000 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1001 build.setLocation( "outputDirectory", _location );
1002 build.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
1003 }
1004 else if ( checkFieldWithDuplicate( parser, "testOutputDirectory", null, parsed ) )
1005 {
1006 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1007 build.setLocation( "testOutputDirectory", _location );
1008 build.setTestOutputDirectory( interpolatedTrimmed( parser.nextText(), "testOutputDirectory" ) );
1009 }
1010 else if ( checkFieldWithDuplicate( parser, "extensions", null, parsed ) )
1011 {
1012 java.util.List<Extension> extensions = new java.util.ArrayList<Extension>();
1013 while ( parser.nextTag() == XmlPullParser.START_TAG )
1014 {
1015 if ( "extension".equals( parser.getName() ) )
1016 {
1017 extensions.add( parseExtension( parser, strict, source ) );
1018 }
1019 else
1020 {
1021 checkUnknownElement( parser, strict );
1022 }
1023 }
1024 build.setExtensions( extensions );
1025 }
1026 else if ( checkFieldWithDuplicate( parser, "defaultGoal", null, parsed ) )
1027 {
1028 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1029 build.setLocation( "defaultGoal", _location );
1030 build.setDefaultGoal( interpolatedTrimmed( parser.nextText(), "defaultGoal" ) );
1031 }
1032 else if ( checkFieldWithDuplicate( parser, "resources", null, parsed ) )
1033 {
1034 java.util.List<Resource> resources = new java.util.ArrayList<Resource>();
1035 while ( parser.nextTag() == XmlPullParser.START_TAG )
1036 {
1037 if ( "resource".equals( parser.getName() ) )
1038 {
1039 resources.add( parseResource( parser, strict, source ) );
1040 }
1041 else
1042 {
1043 checkUnknownElement( parser, strict );
1044 }
1045 }
1046 build.setResources( resources );
1047 }
1048 else if ( checkFieldWithDuplicate( parser, "testResources", null, parsed ) )
1049 {
1050 java.util.List<Resource> testResources = new java.util.ArrayList<Resource>();
1051 while ( parser.nextTag() == XmlPullParser.START_TAG )
1052 {
1053 if ( "testResource".equals( parser.getName() ) )
1054 {
1055 testResources.add( parseResource( parser, strict, source ) );
1056 }
1057 else
1058 {
1059 checkUnknownElement( parser, strict );
1060 }
1061 }
1062 build.setTestResources( testResources );
1063 }
1064 else if ( checkFieldWithDuplicate( parser, "directory", null, parsed ) )
1065 {
1066 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1067 build.setLocation( "directory", _location );
1068 build.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) );
1069 }
1070 else if ( checkFieldWithDuplicate( parser, "finalName", null, parsed ) )
1071 {
1072 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1073 build.setLocation( "finalName", _location );
1074 build.setFinalName( interpolatedTrimmed( parser.nextText(), "finalName" ) );
1075 }
1076 else if ( checkFieldWithDuplicate( parser, "filters", null, parsed ) )
1077 {
1078 java.util.List<String> filters = new java.util.ArrayList<String>();
1079 InputLocation _locations;
1080 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1081 build.setLocation( "filters", _locations );
1082 while ( parser.nextTag() == XmlPullParser.START_TAG )
1083 {
1084 if ( "filter".equals( parser.getName() ) )
1085 {
1086 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1087 _locations.setLocation( Integer.valueOf(filters.size()), _location );
1088 filters.add( interpolatedTrimmed( parser.nextText(), "filters" ) );
1089 }
1090 else
1091 {
1092 checkUnknownElement( parser, strict );
1093 }
1094 }
1095 build.setFilters( filters );
1096 }
1097 else if ( checkFieldWithDuplicate( parser, "pluginManagement", null, parsed ) )
1098 {
1099 build.setPluginManagement( parsePluginManagement( parser, strict, source ) );
1100 }
1101 else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
1102 {
1103 java.util.List<Plugin> plugins = new java.util.ArrayList<Plugin>();
1104 while ( parser.nextTag() == XmlPullParser.START_TAG )
1105 {
1106 if ( "plugin".equals( parser.getName() ) )
1107 {
1108 plugins.add( parsePlugin( parser, strict, source ) );
1109 }
1110 else
1111 {
1112 checkUnknownElement( parser, strict );
1113 }
1114 }
1115 build.setPlugins( plugins );
1116 }
1117 else
1118 {
1119 checkUnknownElement( parser, strict );
1120 }
1121 }
1122 return build;
1123 }
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136 private BuildBase parseBuildBase( XmlPullParser parser, boolean strict, InputSource source )
1137 throws IOException, XmlPullParserException
1138 {
1139 String tagName = parser.getName();
1140 BuildBase buildBase = new BuildBase();
1141 InputLocation _location;
1142 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1143 buildBase.setLocation( "", _location );
1144 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1145 {
1146 String name = parser.getAttributeName( i );
1147 String value = parser.getAttributeValue( i );
1148
1149 if ( name.indexOf( ':' ) >= 0 )
1150 {
1151
1152 }
1153 else
1154 {
1155 checkUnknownAttribute( parser, name, tagName, strict );
1156 }
1157 }
1158 java.util.Set<String> parsed = new java.util.HashSet<String>();
1159 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1160 {
1161 if ( checkFieldWithDuplicate( parser, "defaultGoal", null, parsed ) )
1162 {
1163 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1164 buildBase.setLocation( "defaultGoal", _location );
1165 buildBase.setDefaultGoal( interpolatedTrimmed( parser.nextText(), "defaultGoal" ) );
1166 }
1167 else if ( checkFieldWithDuplicate( parser, "resources", null, parsed ) )
1168 {
1169 java.util.List<Resource> resources = new java.util.ArrayList<Resource>();
1170 while ( parser.nextTag() == XmlPullParser.START_TAG )
1171 {
1172 if ( "resource".equals( parser.getName() ) )
1173 {
1174 resources.add( parseResource( parser, strict, source ) );
1175 }
1176 else
1177 {
1178 checkUnknownElement( parser, strict );
1179 }
1180 }
1181 buildBase.setResources( resources );
1182 }
1183 else if ( checkFieldWithDuplicate( parser, "testResources", null, parsed ) )
1184 {
1185 java.util.List<Resource> testResources = new java.util.ArrayList<Resource>();
1186 while ( parser.nextTag() == XmlPullParser.START_TAG )
1187 {
1188 if ( "testResource".equals( parser.getName() ) )
1189 {
1190 testResources.add( parseResource( parser, strict, source ) );
1191 }
1192 else
1193 {
1194 checkUnknownElement( parser, strict );
1195 }
1196 }
1197 buildBase.setTestResources( testResources );
1198 }
1199 else if ( checkFieldWithDuplicate( parser, "directory", null, parsed ) )
1200 {
1201 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1202 buildBase.setLocation( "directory", _location );
1203 buildBase.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) );
1204 }
1205 else if ( checkFieldWithDuplicate( parser, "finalName", null, parsed ) )
1206 {
1207 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1208 buildBase.setLocation( "finalName", _location );
1209 buildBase.setFinalName( interpolatedTrimmed( parser.nextText(), "finalName" ) );
1210 }
1211 else if ( checkFieldWithDuplicate( parser, "filters", null, parsed ) )
1212 {
1213 java.util.List<String> filters = new java.util.ArrayList<String>();
1214 InputLocation _locations;
1215 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1216 buildBase.setLocation( "filters", _locations );
1217 while ( parser.nextTag() == XmlPullParser.START_TAG )
1218 {
1219 if ( "filter".equals( parser.getName() ) )
1220 {
1221 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1222 _locations.setLocation( Integer.valueOf(filters.size()), _location );
1223 filters.add( interpolatedTrimmed( parser.nextText(), "filters" ) );
1224 }
1225 else
1226 {
1227 checkUnknownElement( parser, strict );
1228 }
1229 }
1230 buildBase.setFilters( filters );
1231 }
1232 else if ( checkFieldWithDuplicate( parser, "pluginManagement", null, parsed ) )
1233 {
1234 buildBase.setPluginManagement( parsePluginManagement( parser, strict, source ) );
1235 }
1236 else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
1237 {
1238 java.util.List<Plugin> plugins = new java.util.ArrayList<Plugin>();
1239 while ( parser.nextTag() == XmlPullParser.START_TAG )
1240 {
1241 if ( "plugin".equals( parser.getName() ) )
1242 {
1243 plugins.add( parsePlugin( parser, strict, source ) );
1244 }
1245 else
1246 {
1247 checkUnknownElement( parser, strict );
1248 }
1249 }
1250 buildBase.setPlugins( plugins );
1251 }
1252 else
1253 {
1254 checkUnknownElement( parser, strict );
1255 }
1256 }
1257 return buildBase;
1258 }
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271 private CiManagement parseCiManagement( XmlPullParser parser, boolean strict, InputSource source )
1272 throws IOException, XmlPullParserException
1273 {
1274 String tagName = parser.getName();
1275 CiManagement ciManagement = new CiManagement();
1276 InputLocation _location;
1277 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1278 ciManagement.setLocation( "", _location );
1279 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1280 {
1281 String name = parser.getAttributeName( i );
1282 String value = parser.getAttributeValue( i );
1283
1284 if ( name.indexOf( ':' ) >= 0 )
1285 {
1286
1287 }
1288 else
1289 {
1290 checkUnknownAttribute( parser, name, tagName, strict );
1291 }
1292 }
1293 java.util.Set<String> parsed = new java.util.HashSet<String>();
1294 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1295 {
1296 if ( checkFieldWithDuplicate( parser, "system", null, parsed ) )
1297 {
1298 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1299 ciManagement.setLocation( "system", _location );
1300 ciManagement.setSystem( interpolatedTrimmed( parser.nextText(), "system" ) );
1301 }
1302 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
1303 {
1304 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1305 ciManagement.setLocation( "url", _location );
1306 ciManagement.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
1307 }
1308 else if ( checkFieldWithDuplicate( parser, "notifiers", null, parsed ) )
1309 {
1310 java.util.List<Notifier> notifiers = new java.util.ArrayList<Notifier>();
1311 while ( parser.nextTag() == XmlPullParser.START_TAG )
1312 {
1313 if ( "notifier".equals( parser.getName() ) )
1314 {
1315 notifiers.add( parseNotifier( parser, strict, source ) );
1316 }
1317 else
1318 {
1319 checkUnknownElement( parser, strict );
1320 }
1321 }
1322 ciManagement.setNotifiers( notifiers );
1323 }
1324 else
1325 {
1326 checkUnknownElement( parser, strict );
1327 }
1328 }
1329 return ciManagement;
1330 }
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343 private ConfigurationContainer parseConfigurationContainer( XmlPullParser parser, boolean strict, InputSource source )
1344 throws IOException, XmlPullParserException
1345 {
1346 String tagName = parser.getName();
1347 ConfigurationContainer configurationContainer = new ConfigurationContainer();
1348 InputLocation _location;
1349 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1350 configurationContainer.setLocation( "", _location );
1351 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1352 {
1353 String name = parser.getAttributeName( i );
1354 String value = parser.getAttributeValue( i );
1355
1356 if ( name.indexOf( ':' ) >= 0 )
1357 {
1358
1359 }
1360 else
1361 {
1362 checkUnknownAttribute( parser, name, tagName, strict );
1363 }
1364 }
1365 java.util.Set<String> parsed = new java.util.HashSet<String>();
1366 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1367 {
1368 if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
1369 {
1370 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1371 configurationContainer.setLocation( "inherited", _location );
1372 configurationContainer.setInherited( interpolatedTrimmed( parser.nextText(), "inherited" ) );
1373 }
1374 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
1375 {
1376 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1377 configurationContainer.setLocation( "configuration", _location );
1378 configurationContainer.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
1379 }
1380 else
1381 {
1382 checkUnknownElement( parser, strict );
1383 }
1384 }
1385 return configurationContainer;
1386 }
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399 private Contributor parseContributor( XmlPullParser parser, boolean strict, InputSource source )
1400 throws IOException, XmlPullParserException
1401 {
1402 String tagName = parser.getName();
1403 Contributor contributor = new Contributor();
1404 InputLocation _location;
1405 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1406 contributor.setLocation( "", _location );
1407 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1408 {
1409 String name = parser.getAttributeName( i );
1410 String value = parser.getAttributeValue( i );
1411
1412 if ( name.indexOf( ':' ) >= 0 )
1413 {
1414
1415 }
1416 else
1417 {
1418 checkUnknownAttribute( parser, name, tagName, strict );
1419 }
1420 }
1421 java.util.Set<String> parsed = new java.util.HashSet<String>();
1422 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1423 {
1424 if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
1425 {
1426 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1427 contributor.setLocation( "name", _location );
1428 contributor.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
1429 }
1430 else if ( checkFieldWithDuplicate( parser, "email", null, parsed ) )
1431 {
1432 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1433 contributor.setLocation( "email", _location );
1434 contributor.setEmail( interpolatedTrimmed( parser.nextText(), "email" ) );
1435 }
1436 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
1437 {
1438 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1439 contributor.setLocation( "url", _location );
1440 contributor.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
1441 }
1442 else if ( checkFieldWithDuplicate( parser, "organization", "organisation", parsed ) )
1443 {
1444 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1445 contributor.setLocation( "organization", _location );
1446 contributor.setOrganization( interpolatedTrimmed( parser.nextText(), "organization" ) );
1447 }
1448 else if ( checkFieldWithDuplicate( parser, "organizationUrl", "organisationUrl", parsed ) )
1449 {
1450 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1451 contributor.setLocation( "organizationUrl", _location );
1452 contributor.setOrganizationUrl( interpolatedTrimmed( parser.nextText(), "organizationUrl" ) );
1453 }
1454 else if ( checkFieldWithDuplicate( parser, "roles", null, parsed ) )
1455 {
1456 java.util.List<String> roles = new java.util.ArrayList<String>();
1457 InputLocation _locations;
1458 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1459 contributor.setLocation( "roles", _locations );
1460 while ( parser.nextTag() == XmlPullParser.START_TAG )
1461 {
1462 if ( "role".equals( parser.getName() ) )
1463 {
1464 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1465 _locations.setLocation( Integer.valueOf(roles.size()), _location );
1466 roles.add( interpolatedTrimmed( parser.nextText(), "roles" ) );
1467 }
1468 else
1469 {
1470 checkUnknownElement( parser, strict );
1471 }
1472 }
1473 contributor.setRoles( roles );
1474 }
1475 else if ( checkFieldWithDuplicate( parser, "timezone", null, parsed ) )
1476 {
1477 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1478 contributor.setLocation( "timezone", _location );
1479 contributor.setTimezone( interpolatedTrimmed( parser.nextText(), "timezone" ) );
1480 }
1481 else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
1482 {
1483 InputLocation _locations;
1484 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1485 contributor.setLocation( "properties", _locations );
1486 while ( parser.nextTag() == XmlPullParser.START_TAG )
1487 {
1488 String key = parser.getName();
1489 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1490 _locations.setLocation( key, _location );
1491 String value = parser.nextText().trim();
1492 contributor.addProperty( key, value );
1493 }
1494 }
1495 else
1496 {
1497 checkUnknownElement( parser, strict );
1498 }
1499 }
1500 return contributor;
1501 }
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514 private Dependency parseDependency( XmlPullParser parser, boolean strict, InputSource source )
1515 throws IOException, XmlPullParserException
1516 {
1517 String tagName = parser.getName();
1518 Dependency dependency = new Dependency();
1519 InputLocation _location;
1520 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1521 dependency.setLocation( "", _location );
1522 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1523 {
1524 String name = parser.getAttributeName( i );
1525 String value = parser.getAttributeValue( i );
1526
1527 if ( name.indexOf( ':' ) >= 0 )
1528 {
1529
1530 }
1531 else
1532 {
1533 checkUnknownAttribute( parser, name, tagName, strict );
1534 }
1535 }
1536 java.util.Set<String> parsed = new java.util.HashSet<String>();
1537 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1538 {
1539 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
1540 {
1541 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1542 dependency.setLocation( "groupId", _location );
1543 dependency.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
1544 }
1545 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
1546 {
1547 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1548 dependency.setLocation( "artifactId", _location );
1549 dependency.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
1550 }
1551 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
1552 {
1553 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1554 dependency.setLocation( "version", _location );
1555 dependency.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
1556 }
1557 else if ( checkFieldWithDuplicate( parser, "type", null, parsed ) )
1558 {
1559 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1560 dependency.setLocation( "type", _location );
1561 dependency.setType( interpolatedTrimmed( parser.nextText(), "type" ) );
1562 }
1563 else if ( checkFieldWithDuplicate( parser, "classifier", null, parsed ) )
1564 {
1565 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1566 dependency.setLocation( "classifier", _location );
1567 dependency.setClassifier( interpolatedTrimmed( parser.nextText(), "classifier" ) );
1568 }
1569 else if ( checkFieldWithDuplicate( parser, "scope", null, parsed ) )
1570 {
1571 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1572 dependency.setLocation( "scope", _location );
1573 dependency.setScope( interpolatedTrimmed( parser.nextText(), "scope" ) );
1574 }
1575 else if ( checkFieldWithDuplicate( parser, "systemPath", null, parsed ) )
1576 {
1577 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1578 dependency.setLocation( "systemPath", _location );
1579 dependency.setSystemPath( interpolatedTrimmed( parser.nextText(), "systemPath" ) );
1580 }
1581 else if ( checkFieldWithDuplicate( parser, "exclusions", null, parsed ) )
1582 {
1583 java.util.List<Exclusion> exclusions = new java.util.ArrayList<Exclusion>();
1584 while ( parser.nextTag() == XmlPullParser.START_TAG )
1585 {
1586 if ( "exclusion".equals( parser.getName() ) )
1587 {
1588 exclusions.add( parseExclusion( parser, strict, source ) );
1589 }
1590 else
1591 {
1592 checkUnknownElement( parser, strict );
1593 }
1594 }
1595 dependency.setExclusions( exclusions );
1596 }
1597 else if ( checkFieldWithDuplicate( parser, "optional", null, parsed ) )
1598 {
1599 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1600 dependency.setLocation( "optional", _location );
1601 dependency.setOptional( interpolatedTrimmed( parser.nextText(), "optional" ) );
1602 }
1603 else
1604 {
1605 checkUnknownElement( parser, strict );
1606 }
1607 }
1608 return dependency;
1609 }
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622 private DependencyManagement parseDependencyManagement( XmlPullParser parser, boolean strict, InputSource source )
1623 throws IOException, XmlPullParserException
1624 {
1625 String tagName = parser.getName();
1626 DependencyManagement dependencyManagement = new DependencyManagement();
1627 InputLocation _location;
1628 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1629 dependencyManagement.setLocation( "", _location );
1630 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1631 {
1632 String name = parser.getAttributeName( i );
1633 String value = parser.getAttributeValue( i );
1634
1635 if ( name.indexOf( ':' ) >= 0 )
1636 {
1637
1638 }
1639 else
1640 {
1641 checkUnknownAttribute( parser, name, tagName, strict );
1642 }
1643 }
1644 java.util.Set<String> parsed = new java.util.HashSet<String>();
1645 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1646 {
1647 if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
1648 {
1649 java.util.List<Dependency> dependencies = new java.util.ArrayList<Dependency>();
1650 while ( parser.nextTag() == XmlPullParser.START_TAG )
1651 {
1652 if ( "dependency".equals( parser.getName() ) )
1653 {
1654 dependencies.add( parseDependency( parser, strict, source ) );
1655 }
1656 else
1657 {
1658 checkUnknownElement( parser, strict );
1659 }
1660 }
1661 dependencyManagement.setDependencies( dependencies );
1662 }
1663 else
1664 {
1665 checkUnknownElement( parser, strict );
1666 }
1667 }
1668 return dependencyManagement;
1669 }
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682 private DeploymentRepository parseDeploymentRepository( XmlPullParser parser, boolean strict, InputSource source )
1683 throws IOException, XmlPullParserException
1684 {
1685 String tagName = parser.getName();
1686 DeploymentRepository deploymentRepository = new DeploymentRepository();
1687 InputLocation _location;
1688 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1689 deploymentRepository.setLocation( "", _location );
1690 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1691 {
1692 String name = parser.getAttributeName( i );
1693 String value = parser.getAttributeValue( i );
1694
1695 if ( name.indexOf( ':' ) >= 0 )
1696 {
1697
1698 }
1699 else
1700 {
1701 checkUnknownAttribute( parser, name, tagName, strict );
1702 }
1703 }
1704 java.util.Set<String> parsed = new java.util.HashSet<String>();
1705 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1706 {
1707 if ( checkFieldWithDuplicate( parser, "uniqueVersion", null, parsed ) )
1708 {
1709 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1710 deploymentRepository.setLocation( "uniqueVersion", _location );
1711 deploymentRepository.setUniqueVersion( getBooleanValue( interpolatedTrimmed( parser.nextText(), "uniqueVersion" ), "uniqueVersion", parser, "true" ) );
1712 }
1713 else if ( checkFieldWithDuplicate( parser, "releases", null, parsed ) )
1714 {
1715 deploymentRepository.setReleases( parseRepositoryPolicy( parser, strict, source ) );
1716 }
1717 else if ( checkFieldWithDuplicate( parser, "snapshots", null, parsed ) )
1718 {
1719 deploymentRepository.setSnapshots( parseRepositoryPolicy( parser, strict, source ) );
1720 }
1721 else if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
1722 {
1723 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1724 deploymentRepository.setLocation( "id", _location );
1725 deploymentRepository.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
1726 }
1727 else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
1728 {
1729 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1730 deploymentRepository.setLocation( "name", _location );
1731 deploymentRepository.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
1732 }
1733 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
1734 {
1735 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1736 deploymentRepository.setLocation( "url", _location );
1737 deploymentRepository.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
1738 }
1739 else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
1740 {
1741 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1742 deploymentRepository.setLocation( "layout", _location );
1743 deploymentRepository.setLayout( interpolatedTrimmed( parser.nextText(), "layout" ) );
1744 }
1745 else
1746 {
1747 checkUnknownElement( parser, strict );
1748 }
1749 }
1750 return deploymentRepository;
1751 }
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764 private Developer parseDeveloper( XmlPullParser parser, boolean strict, InputSource source )
1765 throws IOException, XmlPullParserException
1766 {
1767 String tagName = parser.getName();
1768 Developer developer = new Developer();
1769 InputLocation _location;
1770 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1771 developer.setLocation( "", _location );
1772 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1773 {
1774 String name = parser.getAttributeName( i );
1775 String value = parser.getAttributeValue( i );
1776
1777 if ( name.indexOf( ':' ) >= 0 )
1778 {
1779
1780 }
1781 else
1782 {
1783 checkUnknownAttribute( parser, name, tagName, strict );
1784 }
1785 }
1786 java.util.Set<String> parsed = new java.util.HashSet<String>();
1787 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1788 {
1789 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
1790 {
1791 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1792 developer.setLocation( "id", _location );
1793 developer.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
1794 }
1795 else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
1796 {
1797 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1798 developer.setLocation( "name", _location );
1799 developer.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
1800 }
1801 else if ( checkFieldWithDuplicate( parser, "email", null, parsed ) )
1802 {
1803 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1804 developer.setLocation( "email", _location );
1805 developer.setEmail( interpolatedTrimmed( parser.nextText(), "email" ) );
1806 }
1807 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
1808 {
1809 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1810 developer.setLocation( "url", _location );
1811 developer.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
1812 }
1813 else if ( checkFieldWithDuplicate( parser, "organization", "organisation", parsed ) )
1814 {
1815 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1816 developer.setLocation( "organization", _location );
1817 developer.setOrganization( interpolatedTrimmed( parser.nextText(), "organization" ) );
1818 }
1819 else if ( checkFieldWithDuplicate( parser, "organizationUrl", "organisationUrl", parsed ) )
1820 {
1821 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1822 developer.setLocation( "organizationUrl", _location );
1823 developer.setOrganizationUrl( interpolatedTrimmed( parser.nextText(), "organizationUrl" ) );
1824 }
1825 else if ( checkFieldWithDuplicate( parser, "roles", null, parsed ) )
1826 {
1827 java.util.List<String> roles = new java.util.ArrayList<String>();
1828 InputLocation _locations;
1829 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1830 developer.setLocation( "roles", _locations );
1831 while ( parser.nextTag() == XmlPullParser.START_TAG )
1832 {
1833 if ( "role".equals( parser.getName() ) )
1834 {
1835 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1836 _locations.setLocation( Integer.valueOf(roles.size()), _location );
1837 roles.add( interpolatedTrimmed( parser.nextText(), "roles" ) );
1838 }
1839 else
1840 {
1841 checkUnknownElement( parser, strict );
1842 }
1843 }
1844 developer.setRoles( roles );
1845 }
1846 else if ( checkFieldWithDuplicate( parser, "timezone", null, parsed ) )
1847 {
1848 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1849 developer.setLocation( "timezone", _location );
1850 developer.setTimezone( interpolatedTrimmed( parser.nextText(), "timezone" ) );
1851 }
1852 else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
1853 {
1854 InputLocation _locations;
1855 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1856 developer.setLocation( "properties", _locations );
1857 while ( parser.nextTag() == XmlPullParser.START_TAG )
1858 {
1859 String key = parser.getName();
1860 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1861 _locations.setLocation( key, _location );
1862 String value = parser.nextText().trim();
1863 developer.addProperty( key, value );
1864 }
1865 }
1866 else
1867 {
1868 checkUnknownElement( parser, strict );
1869 }
1870 }
1871 return developer;
1872 }
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885 private DistributionManagement parseDistributionManagement( XmlPullParser parser, boolean strict, InputSource source )
1886 throws IOException, XmlPullParserException
1887 {
1888 String tagName = parser.getName();
1889 DistributionManagement distributionManagement = new DistributionManagement();
1890 InputLocation _location;
1891 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1892 distributionManagement.setLocation( "", _location );
1893 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1894 {
1895 String name = parser.getAttributeName( i );
1896 String value = parser.getAttributeValue( i );
1897
1898 if ( name.indexOf( ':' ) >= 0 )
1899 {
1900
1901 }
1902 else
1903 {
1904 checkUnknownAttribute( parser, name, tagName, strict );
1905 }
1906 }
1907 java.util.Set<String> parsed = new java.util.HashSet<String>();
1908 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1909 {
1910 if ( checkFieldWithDuplicate( parser, "repository", null, parsed ) )
1911 {
1912 distributionManagement.setRepository( parseDeploymentRepository( parser, strict, source ) );
1913 }
1914 else if ( checkFieldWithDuplicate( parser, "snapshotRepository", null, parsed ) )
1915 {
1916 distributionManagement.setSnapshotRepository( parseDeploymentRepository( parser, strict, source ) );
1917 }
1918 else if ( checkFieldWithDuplicate( parser, "site", null, parsed ) )
1919 {
1920 distributionManagement.setSite( parseSite( parser, strict, source ) );
1921 }
1922 else if ( checkFieldWithDuplicate( parser, "downloadUrl", null, parsed ) )
1923 {
1924 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1925 distributionManagement.setLocation( "downloadUrl", _location );
1926 distributionManagement.setDownloadUrl( interpolatedTrimmed( parser.nextText(), "downloadUrl" ) );
1927 }
1928 else if ( checkFieldWithDuplicate( parser, "relocation", null, parsed ) )
1929 {
1930 distributionManagement.setRelocation( parseRelocation( parser, strict, source ) );
1931 }
1932 else if ( checkFieldWithDuplicate( parser, "status", null, parsed ) )
1933 {
1934 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1935 distributionManagement.setLocation( "status", _location );
1936 distributionManagement.setStatus( interpolatedTrimmed( parser.nextText(), "status" ) );
1937 }
1938 else
1939 {
1940 checkUnknownElement( parser, strict );
1941 }
1942 }
1943 return distributionManagement;
1944 }
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957 private Exclusion parseExclusion( XmlPullParser parser, boolean strict, InputSource source )
1958 throws IOException, XmlPullParserException
1959 {
1960 String tagName = parser.getName();
1961 Exclusion exclusion = new Exclusion();
1962 InputLocation _location;
1963 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1964 exclusion.setLocation( "", _location );
1965 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1966 {
1967 String name = parser.getAttributeName( i );
1968 String value = parser.getAttributeValue( i );
1969
1970 if ( name.indexOf( ':' ) >= 0 )
1971 {
1972
1973 }
1974 else
1975 {
1976 checkUnknownAttribute( parser, name, tagName, strict );
1977 }
1978 }
1979 java.util.Set<String> parsed = new java.util.HashSet<String>();
1980 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1981 {
1982 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
1983 {
1984 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1985 exclusion.setLocation( "groupId", _location );
1986 exclusion.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
1987 }
1988 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
1989 {
1990 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
1991 exclusion.setLocation( "artifactId", _location );
1992 exclusion.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
1993 }
1994 else
1995 {
1996 checkUnknownElement( parser, strict );
1997 }
1998 }
1999 return exclusion;
2000 }
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013 private Extension parseExtension( XmlPullParser parser, boolean strict, InputSource source )
2014 throws IOException, XmlPullParserException
2015 {
2016 String tagName = parser.getName();
2017 Extension extension = new Extension();
2018 InputLocation _location;
2019 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2020 extension.setLocation( "", _location );
2021 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2022 {
2023 String name = parser.getAttributeName( i );
2024 String value = parser.getAttributeValue( i );
2025
2026 if ( name.indexOf( ':' ) >= 0 )
2027 {
2028
2029 }
2030 else
2031 {
2032 checkUnknownAttribute( parser, name, tagName, strict );
2033 }
2034 }
2035 java.util.Set<String> parsed = new java.util.HashSet<String>();
2036 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2037 {
2038 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
2039 {
2040 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2041 extension.setLocation( "groupId", _location );
2042 extension.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
2043 }
2044 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
2045 {
2046 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2047 extension.setLocation( "artifactId", _location );
2048 extension.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
2049 }
2050 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
2051 {
2052 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2053 extension.setLocation( "version", _location );
2054 extension.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
2055 }
2056 else
2057 {
2058 checkUnknownElement( parser, strict );
2059 }
2060 }
2061 return extension;
2062 }
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075 private FileSet parseFileSet( XmlPullParser parser, boolean strict, InputSource source )
2076 throws IOException, XmlPullParserException
2077 {
2078 String tagName = parser.getName();
2079 FileSet fileSet = new FileSet();
2080 InputLocation _location;
2081 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2082 fileSet.setLocation( "", _location );
2083 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2084 {
2085 String name = parser.getAttributeName( i );
2086 String value = parser.getAttributeValue( i );
2087
2088 if ( name.indexOf( ':' ) >= 0 )
2089 {
2090
2091 }
2092 else
2093 {
2094 checkUnknownAttribute( parser, name, tagName, strict );
2095 }
2096 }
2097 java.util.Set<String> parsed = new java.util.HashSet<String>();
2098 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2099 {
2100 if ( checkFieldWithDuplicate( parser, "directory", null, parsed ) )
2101 {
2102 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2103 fileSet.setLocation( "directory", _location );
2104 fileSet.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) );
2105 }
2106 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
2107 {
2108 java.util.List<String> includes = new java.util.ArrayList<String>();
2109 InputLocation _locations;
2110 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2111 fileSet.setLocation( "includes", _locations );
2112 while ( parser.nextTag() == XmlPullParser.START_TAG )
2113 {
2114 if ( "include".equals( parser.getName() ) )
2115 {
2116 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2117 _locations.setLocation( Integer.valueOf(includes.size()), _location );
2118 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
2119 }
2120 else
2121 {
2122 checkUnknownElement( parser, strict );
2123 }
2124 }
2125 fileSet.setIncludes( includes );
2126 }
2127 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
2128 {
2129 java.util.List<String> excludes = new java.util.ArrayList<String>();
2130 InputLocation _locations;
2131 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2132 fileSet.setLocation( "excludes", _locations );
2133 while ( parser.nextTag() == XmlPullParser.START_TAG )
2134 {
2135 if ( "exclude".equals( parser.getName() ) )
2136 {
2137 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2138 _locations.setLocation( Integer.valueOf(excludes.size()), _location );
2139 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
2140 }
2141 else
2142 {
2143 checkUnknownElement( parser, strict );
2144 }
2145 }
2146 fileSet.setExcludes( excludes );
2147 }
2148 else
2149 {
2150 checkUnknownElement( parser, strict );
2151 }
2152 }
2153 return fileSet;
2154 }
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167 private IssueManagement parseIssueManagement( XmlPullParser parser, boolean strict, InputSource source )
2168 throws IOException, XmlPullParserException
2169 {
2170 String tagName = parser.getName();
2171 IssueManagement issueManagement = new IssueManagement();
2172 InputLocation _location;
2173 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2174 issueManagement.setLocation( "", _location );
2175 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2176 {
2177 String name = parser.getAttributeName( i );
2178 String value = parser.getAttributeValue( i );
2179
2180 if ( name.indexOf( ':' ) >= 0 )
2181 {
2182
2183 }
2184 else
2185 {
2186 checkUnknownAttribute( parser, name, tagName, strict );
2187 }
2188 }
2189 java.util.Set<String> parsed = new java.util.HashSet<String>();
2190 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2191 {
2192 if ( checkFieldWithDuplicate( parser, "system", null, parsed ) )
2193 {
2194 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2195 issueManagement.setLocation( "system", _location );
2196 issueManagement.setSystem( interpolatedTrimmed( parser.nextText(), "system" ) );
2197 }
2198 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
2199 {
2200 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2201 issueManagement.setLocation( "url", _location );
2202 issueManagement.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
2203 }
2204 else
2205 {
2206 checkUnknownElement( parser, strict );
2207 }
2208 }
2209 return issueManagement;
2210 }
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223 private License parseLicense( XmlPullParser parser, boolean strict, InputSource source )
2224 throws IOException, XmlPullParserException
2225 {
2226 String tagName = parser.getName();
2227 License license = new License();
2228 InputLocation _location;
2229 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2230 license.setLocation( "", _location );
2231 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2232 {
2233 String name = parser.getAttributeName( i );
2234 String value = parser.getAttributeValue( i );
2235
2236 if ( name.indexOf( ':' ) >= 0 )
2237 {
2238
2239 }
2240 else
2241 {
2242 checkUnknownAttribute( parser, name, tagName, strict );
2243 }
2244 }
2245 java.util.Set<String> parsed = new java.util.HashSet<String>();
2246 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2247 {
2248 if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
2249 {
2250 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2251 license.setLocation( "name", _location );
2252 license.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
2253 }
2254 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
2255 {
2256 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2257 license.setLocation( "url", _location );
2258 license.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
2259 }
2260 else if ( checkFieldWithDuplicate( parser, "distribution", null, parsed ) )
2261 {
2262 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2263 license.setLocation( "distribution", _location );
2264 license.setDistribution( interpolatedTrimmed( parser.nextText(), "distribution" ) );
2265 }
2266 else if ( checkFieldWithDuplicate( parser, "comments", null, parsed ) )
2267 {
2268 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2269 license.setLocation( "comments", _location );
2270 license.setComments( interpolatedTrimmed( parser.nextText(), "comments" ) );
2271 }
2272 else
2273 {
2274 checkUnknownElement( parser, strict );
2275 }
2276 }
2277 return license;
2278 }
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291 private MailingList parseMailingList( XmlPullParser parser, boolean strict, InputSource source )
2292 throws IOException, XmlPullParserException
2293 {
2294 String tagName = parser.getName();
2295 MailingList mailingList = new MailingList();
2296 InputLocation _location;
2297 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2298 mailingList.setLocation( "", _location );
2299 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2300 {
2301 String name = parser.getAttributeName( i );
2302 String value = parser.getAttributeValue( i );
2303
2304 if ( name.indexOf( ':' ) >= 0 )
2305 {
2306
2307 }
2308 else
2309 {
2310 checkUnknownAttribute( parser, name, tagName, strict );
2311 }
2312 }
2313 java.util.Set<String> parsed = new java.util.HashSet<String>();
2314 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2315 {
2316 if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
2317 {
2318 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2319 mailingList.setLocation( "name", _location );
2320 mailingList.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
2321 }
2322 else if ( checkFieldWithDuplicate( parser, "subscribe", null, parsed ) )
2323 {
2324 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2325 mailingList.setLocation( "subscribe", _location );
2326 mailingList.setSubscribe( interpolatedTrimmed( parser.nextText(), "subscribe" ) );
2327 }
2328 else if ( checkFieldWithDuplicate( parser, "unsubscribe", null, parsed ) )
2329 {
2330 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2331 mailingList.setLocation( "unsubscribe", _location );
2332 mailingList.setUnsubscribe( interpolatedTrimmed( parser.nextText(), "unsubscribe" ) );
2333 }
2334 else if ( checkFieldWithDuplicate( parser, "post", null, parsed ) )
2335 {
2336 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2337 mailingList.setLocation( "post", _location );
2338 mailingList.setPost( interpolatedTrimmed( parser.nextText(), "post" ) );
2339 }
2340 else if ( checkFieldWithDuplicate( parser, "archive", null, parsed ) )
2341 {
2342 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2343 mailingList.setLocation( "archive", _location );
2344 mailingList.setArchive( interpolatedTrimmed( parser.nextText(), "archive" ) );
2345 }
2346 else if ( checkFieldWithDuplicate( parser, "otherArchives", null, parsed ) )
2347 {
2348 java.util.List<String> otherArchives = new java.util.ArrayList<String>();
2349 InputLocation _locations;
2350 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2351 mailingList.setLocation( "otherArchives", _locations );
2352 while ( parser.nextTag() == XmlPullParser.START_TAG )
2353 {
2354 if ( "otherArchive".equals( parser.getName() ) )
2355 {
2356 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2357 _locations.setLocation( Integer.valueOf(otherArchives.size()), _location );
2358 otherArchives.add( interpolatedTrimmed( parser.nextText(), "otherArchives" ) );
2359 }
2360 else
2361 {
2362 checkUnknownElement( parser, strict );
2363 }
2364 }
2365 mailingList.setOtherArchives( otherArchives );
2366 }
2367 else
2368 {
2369 checkUnknownElement( parser, strict );
2370 }
2371 }
2372 return mailingList;
2373 }
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386 private Model parseModel( XmlPullParser parser, boolean strict, InputSource source )
2387 throws IOException, XmlPullParserException
2388 {
2389 String tagName = parser.getName();
2390 Model model = new Model();
2391 InputLocation _location;
2392 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2393 model.setLocation( "", _location );
2394 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2395 {
2396 String name = parser.getAttributeName( i );
2397 String value = parser.getAttributeValue( i );
2398
2399 if ( name.indexOf( ':' ) >= 0 )
2400 {
2401
2402 }
2403 else if ( "xmlns".equals( name ) )
2404 {
2405
2406 }
2407 else if ( "child.project.url.inherit.append.path".equals( name ) )
2408 {
2409 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2410 model.setLocation( "childProjectUrlInheritAppendPath", _location );
2411 model.setChildProjectUrlInheritAppendPath( interpolatedTrimmed( value, "child.project.url.inherit.append.path" ) );
2412 }
2413 else
2414 {
2415 checkUnknownAttribute( parser, name, tagName, strict );
2416 }
2417 }
2418 java.util.Set<String> parsed = new java.util.HashSet<String>();
2419 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2420 {
2421 if ( checkFieldWithDuplicate( parser, "modelVersion", null, parsed ) )
2422 {
2423 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2424 model.setLocation( "modelVersion", _location );
2425 model.setModelVersion( interpolatedTrimmed( parser.nextText(), "modelVersion" ) );
2426 }
2427 else if ( checkFieldWithDuplicate( parser, "parent", null, parsed ) )
2428 {
2429 model.setParent( parseParent( parser, strict, source ) );
2430 }
2431 else if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
2432 {
2433 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2434 model.setLocation( "groupId", _location );
2435 model.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
2436 }
2437 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
2438 {
2439 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2440 model.setLocation( "artifactId", _location );
2441 model.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
2442 }
2443 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
2444 {
2445 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2446 model.setLocation( "version", _location );
2447 model.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
2448 }
2449 else if ( checkFieldWithDuplicate( parser, "packaging", null, parsed ) )
2450 {
2451 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2452 model.setLocation( "packaging", _location );
2453 model.setPackaging( interpolatedTrimmed( parser.nextText(), "packaging" ) );
2454 }
2455 else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
2456 {
2457 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2458 model.setLocation( "name", _location );
2459 model.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
2460 }
2461 else if ( checkFieldWithDuplicate( parser, "description", null, parsed ) )
2462 {
2463 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2464 model.setLocation( "description", _location );
2465 model.setDescription( interpolatedTrimmed( parser.nextText(), "description" ) );
2466 }
2467 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
2468 {
2469 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2470 model.setLocation( "url", _location );
2471 model.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
2472 }
2473 else if ( checkFieldWithDuplicate( parser, "inceptionYear", null, parsed ) )
2474 {
2475 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2476 model.setLocation( "inceptionYear", _location );
2477 model.setInceptionYear( interpolatedTrimmed( parser.nextText(), "inceptionYear" ) );
2478 }
2479 else if ( checkFieldWithDuplicate( parser, "organization", "organisation", parsed ) )
2480 {
2481 model.setOrganization( parseOrganization( parser, strict, source ) );
2482 }
2483 else if ( checkFieldWithDuplicate( parser, "licenses", null, parsed ) )
2484 {
2485 java.util.List<License> licenses = new java.util.ArrayList<License>();
2486 while ( parser.nextTag() == XmlPullParser.START_TAG )
2487 {
2488 if ( "license".equals( parser.getName() ) )
2489 {
2490 licenses.add( parseLicense( parser, strict, source ) );
2491 }
2492 else
2493 {
2494 checkUnknownElement( parser, strict );
2495 }
2496 }
2497 model.setLicenses( licenses );
2498 }
2499 else if ( checkFieldWithDuplicate( parser, "developers", null, parsed ) )
2500 {
2501 java.util.List<Developer> developers = new java.util.ArrayList<Developer>();
2502 while ( parser.nextTag() == XmlPullParser.START_TAG )
2503 {
2504 if ( "developer".equals( parser.getName() ) )
2505 {
2506 developers.add( parseDeveloper( parser, strict, source ) );
2507 }
2508 else
2509 {
2510 checkUnknownElement( parser, strict );
2511 }
2512 }
2513 model.setDevelopers( developers );
2514 }
2515 else if ( checkFieldWithDuplicate( parser, "contributors", null, parsed ) )
2516 {
2517 java.util.List<Contributor> contributors = new java.util.ArrayList<Contributor>();
2518 while ( parser.nextTag() == XmlPullParser.START_TAG )
2519 {
2520 if ( "contributor".equals( parser.getName() ) )
2521 {
2522 contributors.add( parseContributor( parser, strict, source ) );
2523 }
2524 else
2525 {
2526 checkUnknownElement( parser, strict );
2527 }
2528 }
2529 model.setContributors( contributors );
2530 }
2531 else if ( checkFieldWithDuplicate( parser, "mailingLists", null, parsed ) )
2532 {
2533 java.util.List<MailingList> mailingLists = new java.util.ArrayList<MailingList>();
2534 while ( parser.nextTag() == XmlPullParser.START_TAG )
2535 {
2536 if ( "mailingList".equals( parser.getName() ) )
2537 {
2538 mailingLists.add( parseMailingList( parser, strict, source ) );
2539 }
2540 else
2541 {
2542 checkUnknownElement( parser, strict );
2543 }
2544 }
2545 model.setMailingLists( mailingLists );
2546 }
2547 else if ( checkFieldWithDuplicate( parser, "prerequisites", null, parsed ) )
2548 {
2549 model.setPrerequisites( parsePrerequisites( parser, strict, source ) );
2550 }
2551 else if ( checkFieldWithDuplicate( parser, "modules", null, parsed ) )
2552 {
2553 java.util.List<String> modules = new java.util.ArrayList<String>();
2554 InputLocation _locations;
2555 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2556 model.setLocation( "modules", _locations );
2557 while ( parser.nextTag() == XmlPullParser.START_TAG )
2558 {
2559 if ( "module".equals( parser.getName() ) )
2560 {
2561 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2562 _locations.setLocation( Integer.valueOf(modules.size()), _location );
2563 modules.add( interpolatedTrimmed( parser.nextText(), "modules" ) );
2564 }
2565 else
2566 {
2567 checkUnknownElement( parser, strict );
2568 }
2569 }
2570 model.setModules( modules );
2571 }
2572 else if ( checkFieldWithDuplicate( parser, "scm", null, parsed ) )
2573 {
2574 model.setScm( parseScm( parser, strict, source ) );
2575 }
2576 else if ( checkFieldWithDuplicate( parser, "issueManagement", null, parsed ) )
2577 {
2578 model.setIssueManagement( parseIssueManagement( parser, strict, source ) );
2579 }
2580 else if ( checkFieldWithDuplicate( parser, "ciManagement", null, parsed ) )
2581 {
2582 model.setCiManagement( parseCiManagement( parser, strict, source ) );
2583 }
2584 else if ( checkFieldWithDuplicate( parser, "distributionManagement", null, parsed ) )
2585 {
2586 model.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
2587 }
2588 else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
2589 {
2590 InputLocation _locations;
2591 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2592 model.setLocation( "properties", _locations );
2593 while ( parser.nextTag() == XmlPullParser.START_TAG )
2594 {
2595 String key = parser.getName();
2596 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2597 _locations.setLocation( key, _location );
2598 String value = parser.nextText().trim();
2599 model.addProperty( key, value );
2600 }
2601 }
2602 else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
2603 {
2604 model.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
2605 }
2606 else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
2607 {
2608 java.util.List<Dependency> dependencies = new java.util.ArrayList<Dependency>();
2609 while ( parser.nextTag() == XmlPullParser.START_TAG )
2610 {
2611 if ( "dependency".equals( parser.getName() ) )
2612 {
2613 dependencies.add( parseDependency( parser, strict, source ) );
2614 }
2615 else
2616 {
2617 checkUnknownElement( parser, strict );
2618 }
2619 }
2620 model.setDependencies( dependencies );
2621 }
2622 else if ( checkFieldWithDuplicate( parser, "repositories", null, parsed ) )
2623 {
2624 java.util.List<Repository> repositories = new java.util.ArrayList<Repository>();
2625 while ( parser.nextTag() == XmlPullParser.START_TAG )
2626 {
2627 if ( "repository".equals( parser.getName() ) )
2628 {
2629 repositories.add( parseRepository( parser, strict, source ) );
2630 }
2631 else
2632 {
2633 checkUnknownElement( parser, strict );
2634 }
2635 }
2636 model.setRepositories( repositories );
2637 }
2638 else if ( checkFieldWithDuplicate( parser, "pluginRepositories", null, parsed ) )
2639 {
2640 java.util.List<Repository> pluginRepositories = new java.util.ArrayList<Repository>();
2641 while ( parser.nextTag() == XmlPullParser.START_TAG )
2642 {
2643 if ( "pluginRepository".equals( parser.getName() ) )
2644 {
2645 pluginRepositories.add( parseRepository( parser, strict, source ) );
2646 }
2647 else
2648 {
2649 checkUnknownElement( parser, strict );
2650 }
2651 }
2652 model.setPluginRepositories( pluginRepositories );
2653 }
2654 else if ( checkFieldWithDuplicate( parser, "build", null, parsed ) )
2655 {
2656 model.setBuild( parseBuild( parser, strict, source ) );
2657 }
2658 else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
2659 {
2660 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2661 model.setLocation( "reports", _location );
2662 model.setReports( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
2663 }
2664 else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
2665 {
2666 model.setReporting( parseReporting( parser, strict, source ) );
2667 }
2668 else if ( checkFieldWithDuplicate( parser, "profiles", null, parsed ) )
2669 {
2670 java.util.List<Profile> profiles = new java.util.ArrayList<Profile>();
2671 while ( parser.nextTag() == XmlPullParser.START_TAG )
2672 {
2673 if ( "profile".equals( parser.getName() ) )
2674 {
2675 profiles.add( parseProfile( parser, strict, source ) );
2676 }
2677 else
2678 {
2679 checkUnknownElement( parser, strict );
2680 }
2681 }
2682 model.setProfiles( profiles );
2683 }
2684 else
2685 {
2686 checkUnknownElement( parser, strict );
2687 }
2688 }
2689 return model;
2690 }
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703 private ModelBase parseModelBase( XmlPullParser parser, boolean strict, InputSource source )
2704 throws IOException, XmlPullParserException
2705 {
2706 String tagName = parser.getName();
2707 ModelBase modelBase = new ModelBase();
2708 InputLocation _location;
2709 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2710 modelBase.setLocation( "", _location );
2711 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2712 {
2713 String name = parser.getAttributeName( i );
2714 String value = parser.getAttributeValue( i );
2715
2716 if ( name.indexOf( ':' ) >= 0 )
2717 {
2718
2719 }
2720 else
2721 {
2722 checkUnknownAttribute( parser, name, tagName, strict );
2723 }
2724 }
2725 java.util.Set<String> parsed = new java.util.HashSet<String>();
2726 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2727 {
2728 if ( checkFieldWithDuplicate( parser, "modules", null, parsed ) )
2729 {
2730 java.util.List<String> modules = new java.util.ArrayList<String>();
2731 InputLocation _locations;
2732 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2733 modelBase.setLocation( "modules", _locations );
2734 while ( parser.nextTag() == XmlPullParser.START_TAG )
2735 {
2736 if ( "module".equals( parser.getName() ) )
2737 {
2738 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2739 _locations.setLocation( Integer.valueOf(modules.size()), _location );
2740 modules.add( interpolatedTrimmed( parser.nextText(), "modules" ) );
2741 }
2742 else
2743 {
2744 checkUnknownElement( parser, strict );
2745 }
2746 }
2747 modelBase.setModules( modules );
2748 }
2749 else if ( checkFieldWithDuplicate( parser, "distributionManagement", null, parsed ) )
2750 {
2751 modelBase.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
2752 }
2753 else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
2754 {
2755 InputLocation _locations;
2756 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2757 modelBase.setLocation( "properties", _locations );
2758 while ( parser.nextTag() == XmlPullParser.START_TAG )
2759 {
2760 String key = parser.getName();
2761 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2762 _locations.setLocation( key, _location );
2763 String value = parser.nextText().trim();
2764 modelBase.addProperty( key, value );
2765 }
2766 }
2767 else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
2768 {
2769 modelBase.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
2770 }
2771 else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
2772 {
2773 java.util.List<Dependency> dependencies = new java.util.ArrayList<Dependency>();
2774 while ( parser.nextTag() == XmlPullParser.START_TAG )
2775 {
2776 if ( "dependency".equals( parser.getName() ) )
2777 {
2778 dependencies.add( parseDependency( parser, strict, source ) );
2779 }
2780 else
2781 {
2782 checkUnknownElement( parser, strict );
2783 }
2784 }
2785 modelBase.setDependencies( dependencies );
2786 }
2787 else if ( checkFieldWithDuplicate( parser, "repositories", null, parsed ) )
2788 {
2789 java.util.List<Repository> repositories = new java.util.ArrayList<Repository>();
2790 while ( parser.nextTag() == XmlPullParser.START_TAG )
2791 {
2792 if ( "repository".equals( parser.getName() ) )
2793 {
2794 repositories.add( parseRepository( parser, strict, source ) );
2795 }
2796 else
2797 {
2798 checkUnknownElement( parser, strict );
2799 }
2800 }
2801 modelBase.setRepositories( repositories );
2802 }
2803 else if ( checkFieldWithDuplicate( parser, "pluginRepositories", null, parsed ) )
2804 {
2805 java.util.List<Repository> pluginRepositories = new java.util.ArrayList<Repository>();
2806 while ( parser.nextTag() == XmlPullParser.START_TAG )
2807 {
2808 if ( "pluginRepository".equals( parser.getName() ) )
2809 {
2810 pluginRepositories.add( parseRepository( parser, strict, source ) );
2811 }
2812 else
2813 {
2814 checkUnknownElement( parser, strict );
2815 }
2816 }
2817 modelBase.setPluginRepositories( pluginRepositories );
2818 }
2819 else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
2820 {
2821 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2822 modelBase.setLocation( "reports", _location );
2823 modelBase.setReports( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
2824 }
2825 else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
2826 {
2827 modelBase.setReporting( parseReporting( parser, strict, source ) );
2828 }
2829 else
2830 {
2831 checkUnknownElement( parser, strict );
2832 }
2833 }
2834 return modelBase;
2835 }
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848 private Notifier parseNotifier( XmlPullParser parser, boolean strict, InputSource source )
2849 throws IOException, XmlPullParserException
2850 {
2851 String tagName = parser.getName();
2852 Notifier notifier = new Notifier();
2853 InputLocation _location;
2854 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2855 notifier.setLocation( "", _location );
2856 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2857 {
2858 String name = parser.getAttributeName( i );
2859 String value = parser.getAttributeValue( i );
2860
2861 if ( name.indexOf( ':' ) >= 0 )
2862 {
2863
2864 }
2865 else
2866 {
2867 checkUnknownAttribute( parser, name, tagName, strict );
2868 }
2869 }
2870 java.util.Set<String> parsed = new java.util.HashSet<String>();
2871 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2872 {
2873 if ( checkFieldWithDuplicate( parser, "type", null, parsed ) )
2874 {
2875 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2876 notifier.setLocation( "type", _location );
2877 notifier.setType( interpolatedTrimmed( parser.nextText(), "type" ) );
2878 }
2879 else if ( checkFieldWithDuplicate( parser, "sendOnError", null, parsed ) )
2880 {
2881 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2882 notifier.setLocation( "sendOnError", _location );
2883 notifier.setSendOnError( getBooleanValue( interpolatedTrimmed( parser.nextText(), "sendOnError" ), "sendOnError", parser, "true" ) );
2884 }
2885 else if ( checkFieldWithDuplicate( parser, "sendOnFailure", null, parsed ) )
2886 {
2887 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2888 notifier.setLocation( "sendOnFailure", _location );
2889 notifier.setSendOnFailure( getBooleanValue( interpolatedTrimmed( parser.nextText(), "sendOnFailure" ), "sendOnFailure", parser, "true" ) );
2890 }
2891 else if ( checkFieldWithDuplicate( parser, "sendOnSuccess", null, parsed ) )
2892 {
2893 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2894 notifier.setLocation( "sendOnSuccess", _location );
2895 notifier.setSendOnSuccess( getBooleanValue( interpolatedTrimmed( parser.nextText(), "sendOnSuccess" ), "sendOnSuccess", parser, "true" ) );
2896 }
2897 else if ( checkFieldWithDuplicate( parser, "sendOnWarning", null, parsed ) )
2898 {
2899 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2900 notifier.setLocation( "sendOnWarning", _location );
2901 notifier.setSendOnWarning( getBooleanValue( interpolatedTrimmed( parser.nextText(), "sendOnWarning" ), "sendOnWarning", parser, "true" ) );
2902 }
2903 else if ( checkFieldWithDuplicate( parser, "address", null, parsed ) )
2904 {
2905 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2906 notifier.setLocation( "address", _location );
2907 notifier.setAddress( interpolatedTrimmed( parser.nextText(), "address" ) );
2908 }
2909 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
2910 {
2911 InputLocation _locations;
2912 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2913 notifier.setLocation( "configuration", _locations );
2914 while ( parser.nextTag() == XmlPullParser.START_TAG )
2915 {
2916 String key = parser.getName();
2917 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2918 _locations.setLocation( key, _location );
2919 String value = parser.nextText().trim();
2920 notifier.addConfiguration( key, value );
2921 }
2922 }
2923 else
2924 {
2925 checkUnknownElement( parser, strict );
2926 }
2927 }
2928 return notifier;
2929 }
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942 private Organization parseOrganization( XmlPullParser parser, boolean strict, InputSource source )
2943 throws IOException, XmlPullParserException
2944 {
2945 String tagName = parser.getName();
2946 Organization organization = new Organization();
2947 InputLocation _location;
2948 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2949 organization.setLocation( "", _location );
2950 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2951 {
2952 String name = parser.getAttributeName( i );
2953 String value = parser.getAttributeValue( i );
2954
2955 if ( name.indexOf( ':' ) >= 0 )
2956 {
2957
2958 }
2959 else
2960 {
2961 checkUnknownAttribute( parser, name, tagName, strict );
2962 }
2963 }
2964 java.util.Set<String> parsed = new java.util.HashSet<String>();
2965 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2966 {
2967 if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
2968 {
2969 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2970 organization.setLocation( "name", _location );
2971 organization.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
2972 }
2973 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
2974 {
2975 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
2976 organization.setLocation( "url", _location );
2977 organization.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
2978 }
2979 else
2980 {
2981 checkUnknownElement( parser, strict );
2982 }
2983 }
2984 return organization;
2985 }
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998 private Parent parseParent( XmlPullParser parser, boolean strict, InputSource source )
2999 throws IOException, XmlPullParserException
3000 {
3001 String tagName = parser.getName();
3002 Parent parent = new Parent();
3003 InputLocation _location;
3004 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3005 parent.setLocation( "", _location );
3006 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3007 {
3008 String name = parser.getAttributeName( i );
3009 String value = parser.getAttributeValue( i );
3010
3011 if ( name.indexOf( ':' ) >= 0 )
3012 {
3013
3014 }
3015 else
3016 {
3017 checkUnknownAttribute( parser, name, tagName, strict );
3018 }
3019 }
3020 java.util.Set<String> parsed = new java.util.HashSet<String>();
3021 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3022 {
3023 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
3024 {
3025 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3026 parent.setLocation( "groupId", _location );
3027 parent.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
3028 }
3029 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
3030 {
3031 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3032 parent.setLocation( "artifactId", _location );
3033 parent.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
3034 }
3035 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
3036 {
3037 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3038 parent.setLocation( "version", _location );
3039 parent.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
3040 }
3041 else if ( checkFieldWithDuplicate( parser, "relativePath", null, parsed ) )
3042 {
3043 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3044 parent.setLocation( "relativePath", _location );
3045 parent.setRelativePath( interpolatedTrimmed( parser.nextText(), "relativePath" ) );
3046 }
3047 else
3048 {
3049 checkUnknownElement( parser, strict );
3050 }
3051 }
3052 return parent;
3053 }
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066 private PatternSet parsePatternSet( XmlPullParser parser, boolean strict, InputSource source )
3067 throws IOException, XmlPullParserException
3068 {
3069 String tagName = parser.getName();
3070 PatternSet patternSet = new PatternSet();
3071 InputLocation _location;
3072 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3073 patternSet.setLocation( "", _location );
3074 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3075 {
3076 String name = parser.getAttributeName( i );
3077 String value = parser.getAttributeValue( i );
3078
3079 if ( name.indexOf( ':' ) >= 0 )
3080 {
3081
3082 }
3083 else
3084 {
3085 checkUnknownAttribute( parser, name, tagName, strict );
3086 }
3087 }
3088 java.util.Set<String> parsed = new java.util.HashSet<String>();
3089 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3090 {
3091 if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
3092 {
3093 java.util.List<String> includes = new java.util.ArrayList<String>();
3094 InputLocation _locations;
3095 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3096 patternSet.setLocation( "includes", _locations );
3097 while ( parser.nextTag() == XmlPullParser.START_TAG )
3098 {
3099 if ( "include".equals( parser.getName() ) )
3100 {
3101 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3102 _locations.setLocation( Integer.valueOf(includes.size()), _location );
3103 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
3104 }
3105 else
3106 {
3107 checkUnknownElement( parser, strict );
3108 }
3109 }
3110 patternSet.setIncludes( includes );
3111 }
3112 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
3113 {
3114 java.util.List<String> excludes = new java.util.ArrayList<String>();
3115 InputLocation _locations;
3116 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3117 patternSet.setLocation( "excludes", _locations );
3118 while ( parser.nextTag() == XmlPullParser.START_TAG )
3119 {
3120 if ( "exclude".equals( parser.getName() ) )
3121 {
3122 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3123 _locations.setLocation( Integer.valueOf(excludes.size()), _location );
3124 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
3125 }
3126 else
3127 {
3128 checkUnknownElement( parser, strict );
3129 }
3130 }
3131 patternSet.setExcludes( excludes );
3132 }
3133 else
3134 {
3135 checkUnknownElement( parser, strict );
3136 }
3137 }
3138 return patternSet;
3139 }
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152 private Plugin parsePlugin( XmlPullParser parser, boolean strict, InputSource source )
3153 throws IOException, XmlPullParserException
3154 {
3155 String tagName = parser.getName();
3156 Plugin plugin = new Plugin();
3157 InputLocation _location;
3158 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3159 plugin.setLocation( "", _location );
3160 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3161 {
3162 String name = parser.getAttributeName( i );
3163 String value = parser.getAttributeValue( i );
3164
3165 if ( name.indexOf( ':' ) >= 0 )
3166 {
3167
3168 }
3169 else
3170 {
3171 checkUnknownAttribute( parser, name, tagName, strict );
3172 }
3173 }
3174 java.util.Set<String> parsed = new java.util.HashSet<String>();
3175 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3176 {
3177 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
3178 {
3179 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3180 plugin.setLocation( "groupId", _location );
3181 plugin.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
3182 }
3183 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
3184 {
3185 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3186 plugin.setLocation( "artifactId", _location );
3187 plugin.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
3188 }
3189 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
3190 {
3191 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3192 plugin.setLocation( "version", _location );
3193 plugin.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
3194 }
3195 else if ( checkFieldWithDuplicate( parser, "extensions", null, parsed ) )
3196 {
3197 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3198 plugin.setLocation( "extensions", _location );
3199 plugin.setExtensions( interpolatedTrimmed( parser.nextText(), "extensions" ) );
3200 }
3201 else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) )
3202 {
3203 java.util.List<PluginExecution> executions = new java.util.ArrayList<PluginExecution>();
3204 while ( parser.nextTag() == XmlPullParser.START_TAG )
3205 {
3206 if ( "execution".equals( parser.getName() ) )
3207 {
3208 executions.add( parsePluginExecution( parser, strict, source ) );
3209 }
3210 else
3211 {
3212 checkUnknownElement( parser, strict );
3213 }
3214 }
3215 plugin.setExecutions( executions );
3216 }
3217 else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
3218 {
3219 java.util.List<Dependency> dependencies = new java.util.ArrayList<Dependency>();
3220 while ( parser.nextTag() == XmlPullParser.START_TAG )
3221 {
3222 if ( "dependency".equals( parser.getName() ) )
3223 {
3224 dependencies.add( parseDependency( parser, strict, source ) );
3225 }
3226 else
3227 {
3228 checkUnknownElement( parser, strict );
3229 }
3230 }
3231 plugin.setDependencies( dependencies );
3232 }
3233 else if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) )
3234 {
3235 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3236 plugin.setLocation( "goals", _location );
3237 plugin.setGoals( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
3238 }
3239 else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
3240 {
3241 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3242 plugin.setLocation( "inherited", _location );
3243 plugin.setInherited( interpolatedTrimmed( parser.nextText(), "inherited" ) );
3244 }
3245 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
3246 {
3247 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3248 plugin.setLocation( "configuration", _location );
3249 plugin.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
3250 }
3251 else
3252 {
3253 checkUnknownElement( parser, strict );
3254 }
3255 }
3256 return plugin;
3257 }
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270 private PluginConfiguration parsePluginConfiguration( XmlPullParser parser, boolean strict, InputSource source )
3271 throws IOException, XmlPullParserException
3272 {
3273 String tagName = parser.getName();
3274 PluginConfiguration pluginConfiguration = new PluginConfiguration();
3275 InputLocation _location;
3276 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3277 pluginConfiguration.setLocation( "", _location );
3278 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3279 {
3280 String name = parser.getAttributeName( i );
3281 String value = parser.getAttributeValue( i );
3282
3283 if ( name.indexOf( ':' ) >= 0 )
3284 {
3285
3286 }
3287 else
3288 {
3289 checkUnknownAttribute( parser, name, tagName, strict );
3290 }
3291 }
3292 java.util.Set<String> parsed = new java.util.HashSet<String>();
3293 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3294 {
3295 if ( checkFieldWithDuplicate( parser, "pluginManagement", null, parsed ) )
3296 {
3297 pluginConfiguration.setPluginManagement( parsePluginManagement( parser, strict, source ) );
3298 }
3299 else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
3300 {
3301 java.util.List<Plugin> plugins = new java.util.ArrayList<Plugin>();
3302 while ( parser.nextTag() == XmlPullParser.START_TAG )
3303 {
3304 if ( "plugin".equals( parser.getName() ) )
3305 {
3306 plugins.add( parsePlugin( parser, strict, source ) );
3307 }
3308 else
3309 {
3310 checkUnknownElement( parser, strict );
3311 }
3312 }
3313 pluginConfiguration.setPlugins( plugins );
3314 }
3315 else
3316 {
3317 checkUnknownElement( parser, strict );
3318 }
3319 }
3320 return pluginConfiguration;
3321 }
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334 private PluginContainer parsePluginContainer( XmlPullParser parser, boolean strict, InputSource source )
3335 throws IOException, XmlPullParserException
3336 {
3337 String tagName = parser.getName();
3338 PluginContainer pluginContainer = new PluginContainer();
3339 InputLocation _location;
3340 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3341 pluginContainer.setLocation( "", _location );
3342 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3343 {
3344 String name = parser.getAttributeName( i );
3345 String value = parser.getAttributeValue( i );
3346
3347 if ( name.indexOf( ':' ) >= 0 )
3348 {
3349
3350 }
3351 else
3352 {
3353 checkUnknownAttribute( parser, name, tagName, strict );
3354 }
3355 }
3356 java.util.Set<String> parsed = new java.util.HashSet<String>();
3357 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3358 {
3359 if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
3360 {
3361 java.util.List<Plugin> plugins = new java.util.ArrayList<Plugin>();
3362 while ( parser.nextTag() == XmlPullParser.START_TAG )
3363 {
3364 if ( "plugin".equals( parser.getName() ) )
3365 {
3366 plugins.add( parsePlugin( parser, strict, source ) );
3367 }
3368 else
3369 {
3370 checkUnknownElement( parser, strict );
3371 }
3372 }
3373 pluginContainer.setPlugins( plugins );
3374 }
3375 else
3376 {
3377 checkUnknownElement( parser, strict );
3378 }
3379 }
3380 return pluginContainer;
3381 }
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394 private PluginExecution parsePluginExecution( XmlPullParser parser, boolean strict, InputSource source )
3395 throws IOException, XmlPullParserException
3396 {
3397 String tagName = parser.getName();
3398 PluginExecution pluginExecution = new PluginExecution();
3399 InputLocation _location;
3400 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3401 pluginExecution.setLocation( "", _location );
3402 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3403 {
3404 String name = parser.getAttributeName( i );
3405 String value = parser.getAttributeValue( i );
3406
3407 if ( name.indexOf( ':' ) >= 0 )
3408 {
3409
3410 }
3411 else
3412 {
3413 checkUnknownAttribute( parser, name, tagName, strict );
3414 }
3415 }
3416 java.util.Set<String> parsed = new java.util.HashSet<String>();
3417 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3418 {
3419 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
3420 {
3421 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3422 pluginExecution.setLocation( "id", _location );
3423 pluginExecution.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
3424 }
3425 else if ( checkFieldWithDuplicate( parser, "phase", null, parsed ) )
3426 {
3427 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3428 pluginExecution.setLocation( "phase", _location );
3429 pluginExecution.setPhase( interpolatedTrimmed( parser.nextText(), "phase" ) );
3430 }
3431 else if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) )
3432 {
3433 java.util.List<String> goals = new java.util.ArrayList<String>();
3434 InputLocation _locations;
3435 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3436 pluginExecution.setLocation( "goals", _locations );
3437 while ( parser.nextTag() == XmlPullParser.START_TAG )
3438 {
3439 if ( "goal".equals( parser.getName() ) )
3440 {
3441 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3442 _locations.setLocation( Integer.valueOf(goals.size()), _location );
3443 goals.add( interpolatedTrimmed( parser.nextText(), "goals" ) );
3444 }
3445 else
3446 {
3447 checkUnknownElement( parser, strict );
3448 }
3449 }
3450 pluginExecution.setGoals( goals );
3451 }
3452 else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
3453 {
3454 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3455 pluginExecution.setLocation( "inherited", _location );
3456 pluginExecution.setInherited( interpolatedTrimmed( parser.nextText(), "inherited" ) );
3457 }
3458 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
3459 {
3460 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3461 pluginExecution.setLocation( "configuration", _location );
3462 pluginExecution.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
3463 }
3464 else
3465 {
3466 checkUnknownElement( parser, strict );
3467 }
3468 }
3469 return pluginExecution;
3470 }
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483 private PluginManagement parsePluginManagement( XmlPullParser parser, boolean strict, InputSource source )
3484 throws IOException, XmlPullParserException
3485 {
3486 String tagName = parser.getName();
3487 PluginManagement pluginManagement = new PluginManagement();
3488 InputLocation _location;
3489 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3490 pluginManagement.setLocation( "", _location );
3491 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3492 {
3493 String name = parser.getAttributeName( i );
3494 String value = parser.getAttributeValue( i );
3495
3496 if ( name.indexOf( ':' ) >= 0 )
3497 {
3498
3499 }
3500 else
3501 {
3502 checkUnknownAttribute( parser, name, tagName, strict );
3503 }
3504 }
3505 java.util.Set<String> parsed = new java.util.HashSet<String>();
3506 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3507 {
3508 if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
3509 {
3510 java.util.List<Plugin> plugins = new java.util.ArrayList<Plugin>();
3511 while ( parser.nextTag() == XmlPullParser.START_TAG )
3512 {
3513 if ( "plugin".equals( parser.getName() ) )
3514 {
3515 plugins.add( parsePlugin( parser, strict, source ) );
3516 }
3517 else
3518 {
3519 checkUnknownElement( parser, strict );
3520 }
3521 }
3522 pluginManagement.setPlugins( plugins );
3523 }
3524 else
3525 {
3526 checkUnknownElement( parser, strict );
3527 }
3528 }
3529 return pluginManagement;
3530 }
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543 private Prerequisites parsePrerequisites( XmlPullParser parser, boolean strict, InputSource source )
3544 throws IOException, XmlPullParserException
3545 {
3546 String tagName = parser.getName();
3547 Prerequisites prerequisites = new Prerequisites();
3548 InputLocation _location;
3549 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3550 prerequisites.setLocation( "", _location );
3551 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3552 {
3553 String name = parser.getAttributeName( i );
3554 String value = parser.getAttributeValue( i );
3555
3556 if ( name.indexOf( ':' ) >= 0 )
3557 {
3558
3559 }
3560 else
3561 {
3562 checkUnknownAttribute( parser, name, tagName, strict );
3563 }
3564 }
3565 java.util.Set<String> parsed = new java.util.HashSet<String>();
3566 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3567 {
3568 if ( checkFieldWithDuplicate( parser, "maven", null, parsed ) )
3569 {
3570 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3571 prerequisites.setLocation( "maven", _location );
3572 prerequisites.setMaven( interpolatedTrimmed( parser.nextText(), "maven" ) );
3573 }
3574 else
3575 {
3576 checkUnknownElement( parser, strict );
3577 }
3578 }
3579 return prerequisites;
3580 }
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593 private Profile parseProfile( XmlPullParser parser, boolean strict, InputSource source )
3594 throws IOException, XmlPullParserException
3595 {
3596 String tagName = parser.getName();
3597 Profile profile = new Profile();
3598 InputLocation _location;
3599 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3600 profile.setLocation( "", _location );
3601 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3602 {
3603 String name = parser.getAttributeName( i );
3604 String value = parser.getAttributeValue( i );
3605
3606 if ( name.indexOf( ':' ) >= 0 )
3607 {
3608
3609 }
3610 else
3611 {
3612 checkUnknownAttribute( parser, name, tagName, strict );
3613 }
3614 }
3615 java.util.Set<String> parsed = new java.util.HashSet<String>();
3616 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3617 {
3618 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
3619 {
3620 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3621 profile.setLocation( "id", _location );
3622 profile.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
3623 }
3624 else if ( checkFieldWithDuplicate( parser, "activation", null, parsed ) )
3625 {
3626 profile.setActivation( parseActivation( parser, strict, source ) );
3627 }
3628 else if ( checkFieldWithDuplicate( parser, "build", null, parsed ) )
3629 {
3630 profile.setBuild( parseBuildBase( parser, strict, source ) );
3631 }
3632 else if ( checkFieldWithDuplicate( parser, "modules", null, parsed ) )
3633 {
3634 java.util.List<String> modules = new java.util.ArrayList<String>();
3635 InputLocation _locations;
3636 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3637 profile.setLocation( "modules", _locations );
3638 while ( parser.nextTag() == XmlPullParser.START_TAG )
3639 {
3640 if ( "module".equals( parser.getName() ) )
3641 {
3642 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3643 _locations.setLocation( Integer.valueOf(modules.size()), _location );
3644 modules.add( interpolatedTrimmed( parser.nextText(), "modules" ) );
3645 }
3646 else
3647 {
3648 checkUnknownElement( parser, strict );
3649 }
3650 }
3651 profile.setModules( modules );
3652 }
3653 else if ( checkFieldWithDuplicate( parser, "distributionManagement", null, parsed ) )
3654 {
3655 profile.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
3656 }
3657 else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
3658 {
3659 InputLocation _locations;
3660 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3661 profile.setLocation( "properties", _locations );
3662 while ( parser.nextTag() == XmlPullParser.START_TAG )
3663 {
3664 String key = parser.getName();
3665 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3666 _locations.setLocation( key, _location );
3667 String value = parser.nextText().trim();
3668 profile.addProperty( key, value );
3669 }
3670 }
3671 else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
3672 {
3673 profile.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
3674 }
3675 else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
3676 {
3677 java.util.List<Dependency> dependencies = new java.util.ArrayList<Dependency>();
3678 while ( parser.nextTag() == XmlPullParser.START_TAG )
3679 {
3680 if ( "dependency".equals( parser.getName() ) )
3681 {
3682 dependencies.add( parseDependency( parser, strict, source ) );
3683 }
3684 else
3685 {
3686 checkUnknownElement( parser, strict );
3687 }
3688 }
3689 profile.setDependencies( dependencies );
3690 }
3691 else if ( checkFieldWithDuplicate( parser, "repositories", null, parsed ) )
3692 {
3693 java.util.List<Repository> repositories = new java.util.ArrayList<Repository>();
3694 while ( parser.nextTag() == XmlPullParser.START_TAG )
3695 {
3696 if ( "repository".equals( parser.getName() ) )
3697 {
3698 repositories.add( parseRepository( parser, strict, source ) );
3699 }
3700 else
3701 {
3702 checkUnknownElement( parser, strict );
3703 }
3704 }
3705 profile.setRepositories( repositories );
3706 }
3707 else if ( checkFieldWithDuplicate( parser, "pluginRepositories", null, parsed ) )
3708 {
3709 java.util.List<Repository> pluginRepositories = new java.util.ArrayList<Repository>();
3710 while ( parser.nextTag() == XmlPullParser.START_TAG )
3711 {
3712 if ( "pluginRepository".equals( parser.getName() ) )
3713 {
3714 pluginRepositories.add( parseRepository( parser, strict, source ) );
3715 }
3716 else
3717 {
3718 checkUnknownElement( parser, strict );
3719 }
3720 }
3721 profile.setPluginRepositories( pluginRepositories );
3722 }
3723 else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
3724 {
3725 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3726 profile.setLocation( "reports", _location );
3727 profile.setReports( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
3728 }
3729 else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
3730 {
3731 profile.setReporting( parseReporting( parser, strict, source ) );
3732 }
3733 else
3734 {
3735 checkUnknownElement( parser, strict );
3736 }
3737 }
3738 return profile;
3739 }
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752 private Relocation parseRelocation( XmlPullParser parser, boolean strict, InputSource source )
3753 throws IOException, XmlPullParserException
3754 {
3755 String tagName = parser.getName();
3756 Relocation relocation = new Relocation();
3757 InputLocation _location;
3758 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3759 relocation.setLocation( "", _location );
3760 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3761 {
3762 String name = parser.getAttributeName( i );
3763 String value = parser.getAttributeValue( i );
3764
3765 if ( name.indexOf( ':' ) >= 0 )
3766 {
3767
3768 }
3769 else
3770 {
3771 checkUnknownAttribute( parser, name, tagName, strict );
3772 }
3773 }
3774 java.util.Set<String> parsed = new java.util.HashSet<String>();
3775 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3776 {
3777 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
3778 {
3779 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3780 relocation.setLocation( "groupId", _location );
3781 relocation.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
3782 }
3783 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
3784 {
3785 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3786 relocation.setLocation( "artifactId", _location );
3787 relocation.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
3788 }
3789 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
3790 {
3791 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3792 relocation.setLocation( "version", _location );
3793 relocation.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
3794 }
3795 else if ( checkFieldWithDuplicate( parser, "message", null, parsed ) )
3796 {
3797 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3798 relocation.setLocation( "message", _location );
3799 relocation.setMessage( interpolatedTrimmed( parser.nextText(), "message" ) );
3800 }
3801 else
3802 {
3803 checkUnknownElement( parser, strict );
3804 }
3805 }
3806 return relocation;
3807 }
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820 private ReportPlugin parseReportPlugin( XmlPullParser parser, boolean strict, InputSource source )
3821 throws IOException, XmlPullParserException
3822 {
3823 String tagName = parser.getName();
3824 ReportPlugin reportPlugin = new ReportPlugin();
3825 InputLocation _location;
3826 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3827 reportPlugin.setLocation( "", _location );
3828 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3829 {
3830 String name = parser.getAttributeName( i );
3831 String value = parser.getAttributeValue( i );
3832
3833 if ( name.indexOf( ':' ) >= 0 )
3834 {
3835
3836 }
3837 else
3838 {
3839 checkUnknownAttribute( parser, name, tagName, strict );
3840 }
3841 }
3842 java.util.Set<String> parsed = new java.util.HashSet<String>();
3843 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3844 {
3845 if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
3846 {
3847 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3848 reportPlugin.setLocation( "groupId", _location );
3849 reportPlugin.setGroupId( interpolatedTrimmed( parser.nextText(), "groupId" ) );
3850 }
3851 else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
3852 {
3853 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3854 reportPlugin.setLocation( "artifactId", _location );
3855 reportPlugin.setArtifactId( interpolatedTrimmed( parser.nextText(), "artifactId" ) );
3856 }
3857 else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
3858 {
3859 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3860 reportPlugin.setLocation( "version", _location );
3861 reportPlugin.setVersion( interpolatedTrimmed( parser.nextText(), "version" ) );
3862 }
3863 else if ( checkFieldWithDuplicate( parser, "reportSets", null, parsed ) )
3864 {
3865 java.util.List<ReportSet> reportSets = new java.util.ArrayList<ReportSet>();
3866 while ( parser.nextTag() == XmlPullParser.START_TAG )
3867 {
3868 if ( "reportSet".equals( parser.getName() ) )
3869 {
3870 reportSets.add( parseReportSet( parser, strict, source ) );
3871 }
3872 else
3873 {
3874 checkUnknownElement( parser, strict );
3875 }
3876 }
3877 reportPlugin.setReportSets( reportSets );
3878 }
3879 else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
3880 {
3881 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3882 reportPlugin.setLocation( "inherited", _location );
3883 reportPlugin.setInherited( interpolatedTrimmed( parser.nextText(), "inherited" ) );
3884 }
3885 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
3886 {
3887 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3888 reportPlugin.setLocation( "configuration", _location );
3889 reportPlugin.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
3890 }
3891 else
3892 {
3893 checkUnknownElement( parser, strict );
3894 }
3895 }
3896 return reportPlugin;
3897 }
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910 private ReportSet parseReportSet( XmlPullParser parser, boolean strict, InputSource source )
3911 throws IOException, XmlPullParserException
3912 {
3913 String tagName = parser.getName();
3914 ReportSet reportSet = new ReportSet();
3915 InputLocation _location;
3916 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3917 reportSet.setLocation( "", _location );
3918 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
3919 {
3920 String name = parser.getAttributeName( i );
3921 String value = parser.getAttributeValue( i );
3922
3923 if ( name.indexOf( ':' ) >= 0 )
3924 {
3925
3926 }
3927 else
3928 {
3929 checkUnknownAttribute( parser, name, tagName, strict );
3930 }
3931 }
3932 java.util.Set<String> parsed = new java.util.HashSet<String>();
3933 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
3934 {
3935 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
3936 {
3937 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3938 reportSet.setLocation( "id", _location );
3939 reportSet.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
3940 }
3941 else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
3942 {
3943 java.util.List<String> reports = new java.util.ArrayList<String>();
3944 InputLocation _locations;
3945 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3946 reportSet.setLocation( "reports", _locations );
3947 while ( parser.nextTag() == XmlPullParser.START_TAG )
3948 {
3949 if ( "report".equals( parser.getName() ) )
3950 {
3951 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3952 _locations.setLocation( Integer.valueOf(reports.size()), _location );
3953 reports.add( interpolatedTrimmed( parser.nextText(), "reports" ) );
3954 }
3955 else
3956 {
3957 checkUnknownElement( parser, strict );
3958 }
3959 }
3960 reportSet.setReports( reports );
3961 }
3962 else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
3963 {
3964 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3965 reportSet.setLocation( "inherited", _location );
3966 reportSet.setInherited( interpolatedTrimmed( parser.nextText(), "inherited" ) );
3967 }
3968 else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
3969 {
3970 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
3971 reportSet.setLocation( "configuration", _location );
3972 reportSet.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true, new Xpp3DomBuilderInputLocationBuilder( _location ) ) );
3973 }
3974 else
3975 {
3976 checkUnknownElement( parser, strict );
3977 }
3978 }
3979 return reportSet;
3980 }
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993 private Reporting parseReporting( XmlPullParser parser, boolean strict, InputSource source )
3994 throws IOException, XmlPullParserException
3995 {
3996 String tagName = parser.getName();
3997 Reporting reporting = new Reporting();
3998 InputLocation _location;
3999 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4000 reporting.setLocation( "", _location );
4001 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4002 {
4003 String name = parser.getAttributeName( i );
4004 String value = parser.getAttributeValue( i );
4005
4006 if ( name.indexOf( ':' ) >= 0 )
4007 {
4008
4009 }
4010 else
4011 {
4012 checkUnknownAttribute( parser, name, tagName, strict );
4013 }
4014 }
4015 java.util.Set<String> parsed = new java.util.HashSet<String>();
4016 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4017 {
4018 if ( checkFieldWithDuplicate( parser, "excludeDefaults", null, parsed ) )
4019 {
4020 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4021 reporting.setLocation( "excludeDefaults", _location );
4022 reporting.setExcludeDefaults( interpolatedTrimmed( parser.nextText(), "excludeDefaults" ) );
4023 }
4024 else if ( checkFieldWithDuplicate( parser, "outputDirectory", null, parsed ) )
4025 {
4026 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4027 reporting.setLocation( "outputDirectory", _location );
4028 reporting.setOutputDirectory( interpolatedTrimmed( parser.nextText(), "outputDirectory" ) );
4029 }
4030 else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
4031 {
4032 java.util.List<ReportPlugin> plugins = new java.util.ArrayList<ReportPlugin>();
4033 while ( parser.nextTag() == XmlPullParser.START_TAG )
4034 {
4035 if ( "plugin".equals( parser.getName() ) )
4036 {
4037 plugins.add( parseReportPlugin( parser, strict, source ) );
4038 }
4039 else
4040 {
4041 checkUnknownElement( parser, strict );
4042 }
4043 }
4044 reporting.setPlugins( plugins );
4045 }
4046 else
4047 {
4048 checkUnknownElement( parser, strict );
4049 }
4050 }
4051 return reporting;
4052 }
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065 private Repository parseRepository( XmlPullParser parser, boolean strict, InputSource source )
4066 throws IOException, XmlPullParserException
4067 {
4068 String tagName = parser.getName();
4069 Repository repository = new Repository();
4070 InputLocation _location;
4071 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4072 repository.setLocation( "", _location );
4073 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4074 {
4075 String name = parser.getAttributeName( i );
4076 String value = parser.getAttributeValue( i );
4077
4078 if ( name.indexOf( ':' ) >= 0 )
4079 {
4080
4081 }
4082 else
4083 {
4084 checkUnknownAttribute( parser, name, tagName, strict );
4085 }
4086 }
4087 java.util.Set<String> parsed = new java.util.HashSet<String>();
4088 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4089 {
4090 if ( checkFieldWithDuplicate( parser, "releases", null, parsed ) )
4091 {
4092 repository.setReleases( parseRepositoryPolicy( parser, strict, source ) );
4093 }
4094 else if ( checkFieldWithDuplicate( parser, "snapshots", null, parsed ) )
4095 {
4096 repository.setSnapshots( parseRepositoryPolicy( parser, strict, source ) );
4097 }
4098 else if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
4099 {
4100 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4101 repository.setLocation( "id", _location );
4102 repository.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
4103 }
4104 else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
4105 {
4106 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4107 repository.setLocation( "name", _location );
4108 repository.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
4109 }
4110 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
4111 {
4112 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4113 repository.setLocation( "url", _location );
4114 repository.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
4115 }
4116 else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
4117 {
4118 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4119 repository.setLocation( "layout", _location );
4120 repository.setLayout( interpolatedTrimmed( parser.nextText(), "layout" ) );
4121 }
4122 else
4123 {
4124 checkUnknownElement( parser, strict );
4125 }
4126 }
4127 return repository;
4128 }
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141 private RepositoryBase parseRepositoryBase( XmlPullParser parser, boolean strict, InputSource source )
4142 throws IOException, XmlPullParserException
4143 {
4144 String tagName = parser.getName();
4145 RepositoryBase repositoryBase = new RepositoryBase();
4146 InputLocation _location;
4147 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4148 repositoryBase.setLocation( "", _location );
4149 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4150 {
4151 String name = parser.getAttributeName( i );
4152 String value = parser.getAttributeValue( i );
4153
4154 if ( name.indexOf( ':' ) >= 0 )
4155 {
4156
4157 }
4158 else
4159 {
4160 checkUnknownAttribute( parser, name, tagName, strict );
4161 }
4162 }
4163 java.util.Set<String> parsed = new java.util.HashSet<String>();
4164 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4165 {
4166 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
4167 {
4168 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4169 repositoryBase.setLocation( "id", _location );
4170 repositoryBase.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
4171 }
4172 else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
4173 {
4174 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4175 repositoryBase.setLocation( "name", _location );
4176 repositoryBase.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
4177 }
4178 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
4179 {
4180 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4181 repositoryBase.setLocation( "url", _location );
4182 repositoryBase.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
4183 }
4184 else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
4185 {
4186 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4187 repositoryBase.setLocation( "layout", _location );
4188 repositoryBase.setLayout( interpolatedTrimmed( parser.nextText(), "layout" ) );
4189 }
4190 else
4191 {
4192 checkUnknownElement( parser, strict );
4193 }
4194 }
4195 return repositoryBase;
4196 }
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209 private RepositoryPolicy parseRepositoryPolicy( XmlPullParser parser, boolean strict, InputSource source )
4210 throws IOException, XmlPullParserException
4211 {
4212 String tagName = parser.getName();
4213 RepositoryPolicy repositoryPolicy = new RepositoryPolicy();
4214 InputLocation _location;
4215 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4216 repositoryPolicy.setLocation( "", _location );
4217 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4218 {
4219 String name = parser.getAttributeName( i );
4220 String value = parser.getAttributeValue( i );
4221
4222 if ( name.indexOf( ':' ) >= 0 )
4223 {
4224
4225 }
4226 else
4227 {
4228 checkUnknownAttribute( parser, name, tagName, strict );
4229 }
4230 }
4231 java.util.Set<String> parsed = new java.util.HashSet<String>();
4232 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4233 {
4234 if ( checkFieldWithDuplicate( parser, "enabled", null, parsed ) )
4235 {
4236 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4237 repositoryPolicy.setLocation( "enabled", _location );
4238 repositoryPolicy.setEnabled( interpolatedTrimmed( parser.nextText(), "enabled" ) );
4239 }
4240 else if ( checkFieldWithDuplicate( parser, "updatePolicy", null, parsed ) )
4241 {
4242 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4243 repositoryPolicy.setLocation( "updatePolicy", _location );
4244 repositoryPolicy.setUpdatePolicy( interpolatedTrimmed( parser.nextText(), "updatePolicy" ) );
4245 }
4246 else if ( checkFieldWithDuplicate( parser, "checksumPolicy", null, parsed ) )
4247 {
4248 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4249 repositoryPolicy.setLocation( "checksumPolicy", _location );
4250 repositoryPolicy.setChecksumPolicy( interpolatedTrimmed( parser.nextText(), "checksumPolicy" ) );
4251 }
4252 else
4253 {
4254 checkUnknownElement( parser, strict );
4255 }
4256 }
4257 return repositoryPolicy;
4258 }
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271 private Resource parseResource( XmlPullParser parser, boolean strict, InputSource source )
4272 throws IOException, XmlPullParserException
4273 {
4274 String tagName = parser.getName();
4275 Resource resource = new Resource();
4276 InputLocation _location;
4277 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4278 resource.setLocation( "", _location );
4279 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4280 {
4281 String name = parser.getAttributeName( i );
4282 String value = parser.getAttributeValue( i );
4283
4284 if ( name.indexOf( ':' ) >= 0 )
4285 {
4286
4287 }
4288 else
4289 {
4290 checkUnknownAttribute( parser, name, tagName, strict );
4291 }
4292 }
4293 java.util.Set<String> parsed = new java.util.HashSet<String>();
4294 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4295 {
4296 if ( checkFieldWithDuplicate( parser, "targetPath", null, parsed ) )
4297 {
4298 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4299 resource.setLocation( "targetPath", _location );
4300 resource.setTargetPath( interpolatedTrimmed( parser.nextText(), "targetPath" ) );
4301 }
4302 else if ( checkFieldWithDuplicate( parser, "filtering", null, parsed ) )
4303 {
4304 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4305 resource.setLocation( "filtering", _location );
4306 resource.setFiltering( interpolatedTrimmed( parser.nextText(), "filtering" ) );
4307 }
4308 else if ( checkFieldWithDuplicate( parser, "directory", null, parsed ) )
4309 {
4310 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4311 resource.setLocation( "directory", _location );
4312 resource.setDirectory( interpolatedTrimmed( parser.nextText(), "directory" ) );
4313 }
4314 else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
4315 {
4316 java.util.List<String> includes = new java.util.ArrayList<String>();
4317 InputLocation _locations;
4318 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4319 resource.setLocation( "includes", _locations );
4320 while ( parser.nextTag() == XmlPullParser.START_TAG )
4321 {
4322 if ( "include".equals( parser.getName() ) )
4323 {
4324 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4325 _locations.setLocation( Integer.valueOf(includes.size()), _location );
4326 includes.add( interpolatedTrimmed( parser.nextText(), "includes" ) );
4327 }
4328 else
4329 {
4330 checkUnknownElement( parser, strict );
4331 }
4332 }
4333 resource.setIncludes( includes );
4334 }
4335 else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
4336 {
4337 java.util.List<String> excludes = new java.util.ArrayList<String>();
4338 InputLocation _locations;
4339 _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4340 resource.setLocation( "excludes", _locations );
4341 while ( parser.nextTag() == XmlPullParser.START_TAG )
4342 {
4343 if ( "exclude".equals( parser.getName() ) )
4344 {
4345 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4346 _locations.setLocation( Integer.valueOf(excludes.size()), _location );
4347 excludes.add( interpolatedTrimmed( parser.nextText(), "excludes" ) );
4348 }
4349 else
4350 {
4351 checkUnknownElement( parser, strict );
4352 }
4353 }
4354 resource.setExcludes( excludes );
4355 }
4356 else
4357 {
4358 checkUnknownElement( parser, strict );
4359 }
4360 }
4361 return resource;
4362 }
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375 private Scm parseScm( XmlPullParser parser, boolean strict, InputSource source )
4376 throws IOException, XmlPullParserException
4377 {
4378 String tagName = parser.getName();
4379 Scm scm = new Scm();
4380 InputLocation _location;
4381 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4382 scm.setLocation( "", _location );
4383 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4384 {
4385 String name = parser.getAttributeName( i );
4386 String value = parser.getAttributeValue( i );
4387
4388 if ( name.indexOf( ':' ) >= 0 )
4389 {
4390
4391 }
4392 else if ( "child.scm.connection.inherit.append.path".equals( name ) )
4393 {
4394 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4395 scm.setLocation( "childScmConnectionInheritAppendPath", _location );
4396 scm.setChildScmConnectionInheritAppendPath( interpolatedTrimmed( value, "child.scm.connection.inherit.append.path" ) );
4397 }
4398 else if ( "child.scm.developerConnection.inherit.append.path".equals( name ) )
4399 {
4400 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4401 scm.setLocation( "childScmDeveloperConnectionInheritAppendPath", _location );
4402 scm.setChildScmDeveloperConnectionInheritAppendPath( interpolatedTrimmed( value, "child.scm.developerConnection.inherit.append.path" ) );
4403 }
4404 else if ( "child.scm.url.inherit.append.path".equals( name ) )
4405 {
4406 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4407 scm.setLocation( "childScmUrlInheritAppendPath", _location );
4408 scm.setChildScmUrlInheritAppendPath( interpolatedTrimmed( value, "child.scm.url.inherit.append.path" ) );
4409 }
4410 else
4411 {
4412 checkUnknownAttribute( parser, name, tagName, strict );
4413 }
4414 }
4415 java.util.Set<String> parsed = new java.util.HashSet<String>();
4416 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4417 {
4418 if ( checkFieldWithDuplicate( parser, "connection", null, parsed ) )
4419 {
4420 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4421 scm.setLocation( "connection", _location );
4422 scm.setConnection( interpolatedTrimmed( parser.nextText(), "connection" ) );
4423 }
4424 else if ( checkFieldWithDuplicate( parser, "developerConnection", null, parsed ) )
4425 {
4426 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4427 scm.setLocation( "developerConnection", _location );
4428 scm.setDeveloperConnection( interpolatedTrimmed( parser.nextText(), "developerConnection" ) );
4429 }
4430 else if ( checkFieldWithDuplicate( parser, "tag", null, parsed ) )
4431 {
4432 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4433 scm.setLocation( "tag", _location );
4434 scm.setTag( interpolatedTrimmed( parser.nextText(), "tag" ) );
4435 }
4436 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
4437 {
4438 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4439 scm.setLocation( "url", _location );
4440 scm.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
4441 }
4442 else
4443 {
4444 checkUnknownElement( parser, strict );
4445 }
4446 }
4447 return scm;
4448 }
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461 private Site parseSite( XmlPullParser parser, boolean strict, InputSource source )
4462 throws IOException, XmlPullParserException
4463 {
4464 String tagName = parser.getName();
4465 Site site = new Site();
4466 InputLocation _location;
4467 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4468 site.setLocation( "", _location );
4469 for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
4470 {
4471 String name = parser.getAttributeName( i );
4472 String value = parser.getAttributeValue( i );
4473
4474 if ( name.indexOf( ':' ) >= 0 )
4475 {
4476
4477 }
4478 else if ( "child.site.url.inherit.append.path".equals( name ) )
4479 {
4480 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4481 site.setLocation( "childSiteUrlInheritAppendPath", _location );
4482 site.setChildSiteUrlInheritAppendPath( interpolatedTrimmed( value, "child.site.url.inherit.append.path" ) );
4483 }
4484 else
4485 {
4486 checkUnknownAttribute( parser, name, tagName, strict );
4487 }
4488 }
4489 java.util.Set<String> parsed = new java.util.HashSet<String>();
4490 while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
4491 {
4492 if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
4493 {
4494 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4495 site.setLocation( "id", _location );
4496 site.setId( interpolatedTrimmed( parser.nextText(), "id" ) );
4497 }
4498 else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
4499 {
4500 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4501 site.setLocation( "name", _location );
4502 site.setName( interpolatedTrimmed( parser.nextText(), "name" ) );
4503 }
4504 else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
4505 {
4506 _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
4507 site.setLocation( "url", _location );
4508 site.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
4509 }
4510 else
4511 {
4512 checkUnknownElement( parser, strict );
4513 }
4514 }
4515 return site;
4516 }
4517
4518
4519
4520
4521
4522
4523 public void setAddDefaultEntities( boolean addDefaultEntities )
4524 {
4525 this.addDefaultEntities = addDefaultEntities;
4526 }
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538 private static class Xpp3DomBuilderInputLocationBuilder
4539 implements org.codehaus.plexus.util.xml.Xpp3DomBuilder.InputLocationBuilder
4540 {
4541
4542
4543
4544
4545
4546
4547
4548
4549 private final InputLocation rootLocation;
4550
4551
4552
4553
4554
4555
4556 public Xpp3DomBuilderInputLocationBuilder(InputLocation rootLocation)
4557 {
4558 this.rootLocation = rootLocation;
4559 }
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572 public Object toInputLocation( XmlPullParser parser )
4573 {
4574 return new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), rootLocation.getSource() );
4575 }
4576
4577 }
4578
4579 public static interface ContentTransformer
4580 {
4581
4582
4583
4584
4585
4586
4587
4588 String transform( String source, String fieldName );
4589 }
4590
4591 }