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