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