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