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