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