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