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