View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.1.2,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.buildcache.xml.config.io.xpp3;
7   
8     //---------------------------------/
9    //- Imported classes and packages -/
10  //---------------------------------/
11  
12  import java.io.IOException;
13  import java.io.InputStream;
14  import java.io.Reader;
15  import java.text.DateFormat;
16  import org.apache.maven.buildcache.xml.config.AttachedOutputs;
17  import org.apache.maven.buildcache.xml.config.CacheConfig;
18  import org.apache.maven.buildcache.xml.config.Configuration;
19  import org.apache.maven.buildcache.xml.config.CoordinatesBase;
20  import org.apache.maven.buildcache.xml.config.DirScanConfig;
21  import org.apache.maven.buildcache.xml.config.Discovery;
22  import org.apache.maven.buildcache.xml.config.EffectivePom;
23  import org.apache.maven.buildcache.xml.config.Exclude;
24  import org.apache.maven.buildcache.xml.config.Executables;
25  import org.apache.maven.buildcache.xml.config.ExecutionConfigurationScan;
26  import org.apache.maven.buildcache.xml.config.ExecutionControl;
27  import org.apache.maven.buildcache.xml.config.ExecutionIdsList;
28  import org.apache.maven.buildcache.xml.config.GoalId;
29  import org.apache.maven.buildcache.xml.config.GoalReconciliation;
30  import org.apache.maven.buildcache.xml.config.GoalsList;
31  import org.apache.maven.buildcache.xml.config.Include;
32  import org.apache.maven.buildcache.xml.config.Input;
33  import org.apache.maven.buildcache.xml.config.Local;
34  import org.apache.maven.buildcache.xml.config.MultiModule;
35  import org.apache.maven.buildcache.xml.config.Output;
36  import org.apache.maven.buildcache.xml.config.OutputExclude;
37  import org.apache.maven.buildcache.xml.config.PathSet;
38  import org.apache.maven.buildcache.xml.config.PluginConfigurationScan;
39  import org.apache.maven.buildcache.xml.config.PluginSet;
40  import org.apache.maven.buildcache.xml.config.ProjectVersioning;
41  import org.apache.maven.buildcache.xml.config.PropertyName;
42  import org.apache.maven.buildcache.xml.config.Reconcile;
43  import org.apache.maven.buildcache.xml.config.Remote;
44  import org.apache.maven.buildcache.xml.config.TagExclude;
45  import org.apache.maven.buildcache.xml.config.TagScanConfig;
46  import org.apache.maven.buildcache.xml.config.TrackedProperty;
47  import org.codehaus.plexus.util.ReaderFactory;
48  import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
49  import org.codehaus.plexus.util.xml.pull.MXParser;
50  import org.codehaus.plexus.util.xml.pull.XmlPullParser;
51  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
52  
53  /**
54   * Class BuildCacheConfigXpp3Reader.
55   * 
56   * @version $Revision$ $Date$
57   */
58  @SuppressWarnings( "all" )
59  public class BuildCacheConfigXpp3Reader
60  {
61  
62        //--------------------------/
63       //- Class/Member Variables -/
64      //--------------------------/
65  
66      /**
67       * If set the parser will be loaded with all single characters
68       * from the XHTML specification.
69       * The entities used:
70       * <ul>
71       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</li>
72       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li>
73       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li>
74       * </ul>
75       */
76      private boolean addDefaultEntities = true;
77  
78      /**
79       * Field contentTransformer.
80       */
81      public final ContentTransformer contentTransformer;
82  
83  
84        //----------------/
85       //- Constructors -/
86      //----------------/
87  
88      public BuildCacheConfigXpp3Reader()
89      {
90          this( new ContentTransformer()
91          {
92              public String transform( String source, String fieldName )
93              {
94                  return source;
95              }
96          } );
97      } //-- org.apache.maven.buildcache.xml.config.io.xpp3.BuildCacheConfigXpp3Reader()
98  
99      public BuildCacheConfigXpp3Reader(ContentTransformer contentTransformer)
100     {
101         this.contentTransformer = contentTransformer;
102     } //-- org.apache.maven.buildcache.xml.config.io.xpp3.BuildCacheConfigXpp3Reader(ContentTransformer)
103 
104 
105       //-----------/
106      //- Methods -/
107     //-----------/
108 
109     /**
110      * Method checkFieldWithDuplicate.
111      * 
112      * @param parser a parser object.
113      * @param parsed a parsed object.
114      * @param alias a alias object.
115      * @param tagName a tagName object.
116      * @throws XmlPullParserException XmlPullParserException if
117      * any.
118      * @return boolean
119      */
120     private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set parsed )
121         throws XmlPullParserException
122     {
123         if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
124         {
125             return false;
126         }
127         if ( !parsed.add( tagName ) )
128         {
129             throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
130         }
131         return true;
132     } //-- boolean checkFieldWithDuplicate( XmlPullParser, String, String, java.util.Set )
133 
134     /**
135      * Method checkUnknownAttribute.
136      * 
137      * @param parser a parser object.
138      * @param strict a strict object.
139      * @param tagName a tagName object.
140      * @param attribute a attribute object.
141      * @throws XmlPullParserException XmlPullParserException if
142      * any.
143      * @throws IOException IOException if any.
144      */
145     private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict )
146         throws XmlPullParserException, IOException
147     {
148         // strictXmlAttributes = true for model: if strict == true, not only elements are checked but attributes too
149         if ( strict )
150         {
151             throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null );
152         }
153     } //-- void checkUnknownAttribute( XmlPullParser, String, String, boolean )
154 
155     /**
156      * Method checkUnknownElement.
157      * 
158      * @param parser a parser object.
159      * @param strict a strict object.
160      * @throws XmlPullParserException XmlPullParserException if
161      * any.
162      * @throws IOException IOException if any.
163      */
164     private void checkUnknownElement( XmlPullParser parser, boolean strict )
165         throws XmlPullParserException, IOException
166     {
167         if ( strict )
168         {
169             throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
170         }
171 
172         for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; )
173         {
174             int eventType = parser.next();
175             if ( eventType == XmlPullParser.START_TAG )
176             {
177                 unrecognizedTagCount++;
178             }
179             else if ( eventType == XmlPullParser.END_TAG )
180             {
181                 unrecognizedTagCount--;
182             }
183         }
184     } //-- void checkUnknownElement( XmlPullParser, boolean )
185 
186     /**
187      * Returns the state of the "add default entities" flag.
188      * 
189      * @return boolean
190      */
191     public boolean getAddDefaultEntities()
192     {
193         return addDefaultEntities;
194     } //-- boolean getAddDefaultEntities()
195 
196     /**
197      * Method getBooleanValue.
198      * 
199      * @param s a s object.
200      * @param parser a parser object.
201      * @param attribute a attribute object.
202      * @throws XmlPullParserException XmlPullParserException if
203      * any.
204      * @return boolean
205      */
206     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
207         throws XmlPullParserException
208     {
209         return getBooleanValue( s, attribute, parser, null );
210     } //-- boolean getBooleanValue( String, String, XmlPullParser )
211 
212     /**
213      * Method getBooleanValue.
214      * 
215      * @param s a s object.
216      * @param defaultValue a defaultValue object.
217      * @param parser a parser object.
218      * @param attribute a attribute object.
219      * @throws XmlPullParserException XmlPullParserException if
220      * any.
221      * @return boolean
222      */
223     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
224         throws XmlPullParserException
225     {
226         if ( s != null && s.length() != 0 )
227         {
228             return Boolean.valueOf( s ).booleanValue();
229         }
230         if ( defaultValue != null )
231         {
232             return Boolean.valueOf( defaultValue ).booleanValue();
233         }
234         return false;
235     } //-- boolean getBooleanValue( String, String, XmlPullParser, String )
236 
237     /**
238      * Method getByteValue.
239      * 
240      * @param s a s object.
241      * @param strict a strict object.
242      * @param parser a parser object.
243      * @param attribute a attribute object.
244      * @throws XmlPullParserException XmlPullParserException if
245      * any.
246      * @return byte
247      */
248     private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
249         throws XmlPullParserException
250     {
251         if ( s != null )
252         {
253             try
254             {
255                 return Byte.valueOf( s ).byteValue();
256             }
257             catch ( NumberFormatException nfe )
258             {
259                 if ( strict )
260                 {
261                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe );
262                 }
263             }
264         }
265         return 0;
266     } //-- byte getByteValue( String, String, XmlPullParser, boolean )
267 
268     /**
269      * Method getCharacterValue.
270      * 
271      * @param s a s object.
272      * @param parser a parser object.
273      * @param attribute a attribute object.
274      * @throws XmlPullParserException XmlPullParserException if
275      * any.
276      * @return char
277      */
278     private char getCharacterValue( String s, String attribute, XmlPullParser parser )
279         throws XmlPullParserException
280     {
281         if ( s != null )
282         {
283             return s.charAt( 0 );
284         }
285         return 0;
286     } //-- char getCharacterValue( String, String, XmlPullParser )
287 
288     /**
289      * Method getDateValue.
290      * 
291      * @param s a s object.
292      * @param parser a parser object.
293      * @param attribute a attribute object.
294      * @throws XmlPullParserException XmlPullParserException if
295      * any.
296      * @return Date
297      */
298     private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser )
299         throws XmlPullParserException
300     {
301         return getDateValue( s, attribute, null, parser );
302     } //-- java.util.Date getDateValue( String, String, XmlPullParser )
303 
304     /**
305      * Method getDateValue.
306      * 
307      * @param s a s object.
308      * @param parser a parser object.
309      * @param dateFormat a dateFormat object.
310      * @param attribute a attribute object.
311      * @throws XmlPullParserException XmlPullParserException if
312      * any.
313      * @return Date
314      */
315     private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
316         throws XmlPullParserException
317     {
318         if ( s != null )
319         {
320             String effectiveDateFormat = dateFormat;
321             if ( dateFormat == null )
322             {
323                 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
324             }
325             if ( "long".equals( effectiveDateFormat ) )
326             {
327                 try
328                 {
329                     return new java.util.Date( Long.parseLong( s ) );
330                 }
331                 catch ( NumberFormatException e )
332                 {
333                     throw new XmlPullParserException( e.getMessage(), parser, e );
334                 }
335             }
336             else
337             {
338                 try
339                 {
340                     DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
341                     return dateParser.parse( s );
342                 }
343                 catch ( java.text.ParseException e )
344                 {
345                     throw new XmlPullParserException( e.getMessage(), parser, e );
346                 }
347             }
348         }
349         return null;
350     } //-- java.util.Date getDateValue( String, String, String, XmlPullParser )
351 
352     /**
353      * Method getDoubleValue.
354      * 
355      * @param s a s object.
356      * @param strict a strict object.
357      * @param parser a parser object.
358      * @param attribute a attribute object.
359      * @throws XmlPullParserException XmlPullParserException if
360      * any.
361      * @return double
362      */
363     private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
364         throws XmlPullParserException
365     {
366         if ( s != null )
367         {
368             try
369             {
370                 return Double.valueOf( s ).doubleValue();
371             }
372             catch ( NumberFormatException nfe )
373             {
374                 if ( strict )
375                 {
376                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
377                 }
378             }
379         }
380         return 0;
381     } //-- double getDoubleValue( String, String, XmlPullParser, boolean )
382 
383     /**
384      * Method getFloatValue.
385      * 
386      * @param s a s object.
387      * @param strict a strict object.
388      * @param parser a parser object.
389      * @param attribute a attribute object.
390      * @throws XmlPullParserException XmlPullParserException if
391      * any.
392      * @return float
393      */
394     private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
395         throws XmlPullParserException
396     {
397         if ( s != null )
398         {
399             try
400             {
401                 return Float.valueOf( s ).floatValue();
402             }
403             catch ( NumberFormatException nfe )
404             {
405                 if ( strict )
406                 {
407                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
408                 }
409             }
410         }
411         return 0;
412     } //-- float getFloatValue( String, String, XmlPullParser, boolean )
413 
414     /**
415      * Method getIntegerValue.
416      * 
417      * @param s a s object.
418      * @param strict a strict object.
419      * @param parser a parser object.
420      * @param attribute a attribute object.
421      * @throws XmlPullParserException XmlPullParserException if
422      * any.
423      * @return int
424      */
425     private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
426         throws XmlPullParserException
427     {
428         if ( s != null )
429         {
430             try
431             {
432                 return Integer.valueOf( s ).intValue();
433             }
434             catch ( NumberFormatException nfe )
435             {
436                 if ( strict )
437                 {
438                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe );
439                 }
440             }
441         }
442         return 0;
443     } //-- int getIntegerValue( String, String, XmlPullParser, boolean )
444 
445     /**
446      * Method getLongValue.
447      * 
448      * @param s a s object.
449      * @param strict a strict object.
450      * @param parser a parser object.
451      * @param attribute a attribute object.
452      * @throws XmlPullParserException XmlPullParserException if
453      * any.
454      * @return long
455      */
456     private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
457         throws XmlPullParserException
458     {
459         if ( s != null )
460         {
461             try
462             {
463                 return Long.valueOf( s ).longValue();
464             }
465             catch ( NumberFormatException nfe )
466             {
467                 if ( strict )
468                 {
469                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe );
470                 }
471             }
472         }
473         return 0;
474     } //-- long getLongValue( String, String, XmlPullParser, boolean )
475 
476     /**
477      * Method getRequiredAttributeValue.
478      * 
479      * @param s a s object.
480      * @param strict a strict object.
481      * @param parser a parser object.
482      * @param attribute a attribute object.
483      * @throws XmlPullParserException XmlPullParserException if
484      * any.
485      * @return String
486      */
487     private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
488         throws XmlPullParserException
489     {
490         if ( s == null )
491         {
492             if ( strict )
493             {
494                 throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
495             }
496         }
497         return s;
498     } //-- String getRequiredAttributeValue( String, String, XmlPullParser, boolean )
499 
500     /**
501      * Method getShortValue.
502      * 
503      * @param s a s object.
504      * @param strict a strict object.
505      * @param parser a parser object.
506      * @param attribute a attribute object.
507      * @throws XmlPullParserException XmlPullParserException if
508      * any.
509      * @return short
510      */
511     private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
512         throws XmlPullParserException
513     {
514         if ( s != null )
515         {
516             try
517             {
518                 return Short.valueOf( s ).shortValue();
519             }
520             catch ( NumberFormatException nfe )
521             {
522                 if ( strict )
523                 {
524                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe );
525                 }
526             }
527         }
528         return 0;
529     } //-- short getShortValue( String, String, XmlPullParser, boolean )
530 
531     /**
532      * Method getTrimmedValue.
533      * 
534      * @param s a s object.
535      * @return String
536      */
537     private String getTrimmedValue( String s )
538     {
539         if ( s != null )
540         {
541             s = s.trim();
542         }
543         return s;
544     } //-- String getTrimmedValue( String )
545 
546     /**
547      * Method interpolatedTrimmed.
548      * 
549      * @param value a value object.
550      * @param context a context object.
551      * @return String
552      */
553     private String interpolatedTrimmed( String value, String context )
554     {
555         return getTrimmedValue( contentTransformer.transform( value, context ) );
556     } //-- String interpolatedTrimmed( String, String )
557 
558     /**
559      * Method nextTag.
560      * 
561      * @param parser a parser object.
562      * @throws IOException IOException if any.
563      * @throws XmlPullParserException XmlPullParserException if
564      * any.
565      * @return int
566      */
567     private int nextTag( XmlPullParser parser )
568         throws IOException, XmlPullParserException
569     {
570         int eventType = parser.next();
571         if ( eventType == XmlPullParser.TEXT )
572         {
573             eventType = parser.next();
574         }
575         if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG )
576         {
577             throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null );
578         }
579         return eventType;
580     } //-- int nextTag( XmlPullParser )
581 
582     /**
583      * Method read.
584      * 
585      * @param parser a parser object.
586      * @param strict a strict object.
587      * @throws IOException IOException if any.
588      * @throws XmlPullParserException XmlPullParserException if
589      * any.
590      * @return CacheConfig
591      */
592     public CacheConfig read( XmlPullParser parser, boolean strict )
593         throws IOException, XmlPullParserException
594     {
595         CacheConfig cacheConfig = null;
596         int eventType = parser.getEventType();
597         boolean parsed = false;
598         while ( eventType != XmlPullParser.END_DOCUMENT )
599         {
600             if ( eventType == XmlPullParser.START_TAG )
601             {
602                 if ( strict && ! "cache".equals( parser.getName() ) )
603                 {
604                     throw new XmlPullParserException( "Expected root element 'cache' but found '" + parser.getName() + "'", parser, null );
605                 }
606                 else if ( parsed )
607                 {
608                     // fallback, already expected a XmlPullParserException due to invalid XML
609                     throw new XmlPullParserException( "Duplicated tag: 'cache'", parser, null );
610                 }
611                 cacheConfig = parseCacheConfig( parser, strict );
612                 cacheConfig.setModelEncoding( parser.getInputEncoding() );
613                 parsed = true;
614             }
615             eventType = parser.next();
616         }
617         if ( parsed )
618         {
619             return cacheConfig;
620         }
621         throw new XmlPullParserException( "Expected root element 'cache' but found no element at all: invalid XML document", parser, null );
622     } //-- CacheConfig read( XmlPullParser, boolean )
623 
624     /**
625      * @see ReaderFactory#newXmlReader
626      * 
627      * @param reader a reader object.
628      * @param strict a strict object.
629      * @throws IOException IOException if any.
630      * @throws XmlPullParserException XmlPullParserException if
631      * any.
632      * @return CacheConfig
633      */
634     public CacheConfig read( Reader reader, boolean strict )
635         throws IOException, XmlPullParserException
636     {
637         XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
638 
639         parser.setInput( reader );
640 
641 
642         return read( parser, strict );
643     } //-- CacheConfig read( Reader, boolean )
644 
645     /**
646      * @see ReaderFactory#newXmlReader
647      * 
648      * @param reader a reader object.
649      * @throws IOException IOException if any.
650      * @throws XmlPullParserException XmlPullParserException if
651      * any.
652      * @return CacheConfig
653      */
654     public CacheConfig read( Reader reader )
655         throws IOException, XmlPullParserException
656     {
657         return read( reader, true );
658     } //-- CacheConfig read( Reader )
659 
660     /**
661      * Method read.
662      * 
663      * @param in a in object.
664      * @param strict a strict object.
665      * @throws IOException IOException if any.
666      * @throws XmlPullParserException XmlPullParserException if
667      * any.
668      * @return CacheConfig
669      */
670     public CacheConfig read( InputStream in, boolean strict )
671         throws IOException, XmlPullParserException
672     {
673         return read( ReaderFactory.newXmlReader( in ), strict );
674     } //-- CacheConfig read( InputStream, boolean )
675 
676     /**
677      * Method read.
678      * 
679      * @param in a in object.
680      * @throws IOException IOException if any.
681      * @throws XmlPullParserException XmlPullParserException if
682      * any.
683      * @return CacheConfig
684      */
685     public CacheConfig read( InputStream in )
686         throws IOException, XmlPullParserException
687     {
688         return read( ReaderFactory.newXmlReader( in ) );
689     } //-- CacheConfig read( InputStream )
690 
691     /**
692      * Method parseAttachedOutputs.
693      * 
694      * @param parser a parser object.
695      * @param strict a strict object.
696      * @throws IOException IOException if any.
697      * @throws XmlPullParserException XmlPullParserException if
698      * any.
699      * @return AttachedOutputs
700      */
701     private AttachedOutputs parseAttachedOutputs( XmlPullParser parser, boolean strict )
702         throws IOException, XmlPullParserException
703     {
704         String tagName = parser.getName();
705         AttachedOutputs attachedOutputs = new AttachedOutputs();
706         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
707         {
708             String name = parser.getAttributeName( i );
709             String value = parser.getAttributeValue( i );
710 
711             if ( name.indexOf( ':' ) >= 0 )
712             {
713                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
714             }
715             else
716             {
717                 checkUnknownAttribute( parser, name, tagName, strict );
718             }
719         }
720         java.util.Set parsed = new java.util.HashSet();
721         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
722         {
723             if ( checkFieldWithDuplicate( parser, "dirNames", null, parsed ) )
724             {
725                 java.util.List<String> dirNames = new java.util.ArrayList<String>();
726                 while ( parser.nextTag() == XmlPullParser.START_TAG )
727                 {
728                     if ( "dirName".equals( parser.getName() ) )
729                     {
730                         dirNames.add( interpolatedTrimmed( parser.nextText(), "dirNames" ) );
731                     }
732                     else
733                     {
734                         checkUnknownElement( parser, strict );
735                     }
736                 }
737                 attachedOutputs.setDirNames( dirNames );
738             }
739             else
740             {
741                 checkUnknownElement( parser, strict );
742             }
743         }
744         return attachedOutputs;
745     } //-- AttachedOutputs parseAttachedOutputs( XmlPullParser, boolean )
746 
747     /**
748      * Method parseCacheConfig.
749      * 
750      * @param parser a parser object.
751      * @param strict a strict object.
752      * @throws IOException IOException if any.
753      * @throws XmlPullParserException XmlPullParserException if
754      * any.
755      * @return CacheConfig
756      */
757     private CacheConfig parseCacheConfig( XmlPullParser parser, boolean strict )
758         throws IOException, XmlPullParserException
759     {
760         String tagName = parser.getName();
761         CacheConfig cacheConfig = new CacheConfig();
762         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
763         {
764             String name = parser.getAttributeName( i );
765             String value = parser.getAttributeValue( i );
766 
767             if ( name.indexOf( ':' ) >= 0 )
768             {
769                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
770             }
771             else if ( "xmlns".equals( name ) )
772             {
773                 // ignore xmlns attribute in root class, which is a reserved attribute name
774             }
775             else
776             {
777                 checkUnknownAttribute( parser, name, tagName, strict );
778             }
779         }
780         java.util.Set parsed = new java.util.HashSet();
781         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
782         {
783             if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
784             {
785                 cacheConfig.setConfiguration( parseConfiguration( parser, strict ) );
786             }
787             else if ( checkFieldWithDuplicate( parser, "input", null, parsed ) )
788             {
789                 cacheConfig.setInput( parseInput( parser, strict ) );
790             }
791             else if ( checkFieldWithDuplicate( parser, "output", null, parsed ) )
792             {
793                 cacheConfig.setOutput( parseOutput( parser, strict ) );
794             }
795             else if ( checkFieldWithDuplicate( parser, "executionControl", null, parsed ) )
796             {
797                 cacheConfig.setExecutionControl( parseExecutionControl( parser, strict ) );
798             }
799             else
800             {
801                 checkUnknownElement( parser, strict );
802             }
803         }
804         return cacheConfig;
805     } //-- CacheConfig parseCacheConfig( XmlPullParser, boolean )
806 
807     /**
808      * Method parseConfiguration.
809      * 
810      * @param parser a parser object.
811      * @param strict a strict object.
812      * @throws IOException IOException if any.
813      * @throws XmlPullParserException XmlPullParserException if
814      * any.
815      * @return Configuration
816      */
817     private Configuration parseConfiguration( XmlPullParser parser, boolean strict )
818         throws IOException, XmlPullParserException
819     {
820         String tagName = parser.getName();
821         Configuration configuration = new Configuration();
822         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
823         {
824             String name = parser.getAttributeName( i );
825             String value = parser.getAttributeValue( i );
826 
827             if ( name.indexOf( ':' ) >= 0 )
828             {
829                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
830             }
831             else
832             {
833                 checkUnknownAttribute( parser, name, tagName, strict );
834             }
835         }
836         java.util.Set parsed = new java.util.HashSet();
837         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
838         {
839             if ( checkFieldWithDuplicate( parser, "enabled", null, parsed ) )
840             {
841                 configuration.setEnabled( getBooleanValue( interpolatedTrimmed( parser.nextText(), "enabled" ), "enabled", parser, "true" ) );
842             }
843             else if ( checkFieldWithDuplicate( parser, "hashAlgorithm", null, parsed ) )
844             {
845                 configuration.setHashAlgorithm( interpolatedTrimmed( parser.nextText(), "hashAlgorithm" ) );
846             }
847             else if ( checkFieldWithDuplicate( parser, "validateXml", null, parsed ) )
848             {
849                 configuration.setValidateXml( getBooleanValue( interpolatedTrimmed( parser.nextText(), "validateXml" ), "validateXml", parser, "false" ) );
850             }
851             else if ( checkFieldWithDuplicate( parser, "multiModule", null, parsed ) )
852             {
853                 configuration.setMultiModule( parseMultiModule( parser, strict ) );
854             }
855             else if ( checkFieldWithDuplicate( parser, "projectVersioning", null, parsed ) )
856             {
857                 configuration.setProjectVersioning( parseProjectVersioning( parser, strict ) );
858             }
859             else if ( checkFieldWithDuplicate( parser, "remote", null, parsed ) )
860             {
861                 configuration.setRemote( parseRemote( parser, strict ) );
862             }
863             else if ( checkFieldWithDuplicate( parser, "attachedOutputs", null, parsed ) )
864             {
865                 configuration.setAttachedOutputs( parseAttachedOutputs( parser, strict ) );
866             }
867             else if ( checkFieldWithDuplicate( parser, "local", null, parsed ) )
868             {
869                 configuration.setLocal( parseLocal( parser, strict ) );
870             }
871             else if ( checkFieldWithDuplicate( parser, "debugs", null, parsed ) )
872             {
873                 java.util.List<String> debugs = new java.util.ArrayList<String>();
874                 while ( parser.nextTag() == XmlPullParser.START_TAG )
875                 {
876                     if ( "debug".equals( parser.getName() ) )
877                     {
878                         debugs.add( interpolatedTrimmed( parser.nextText(), "debugs" ) );
879                     }
880                     else
881                     {
882                         checkUnknownElement( parser, strict );
883                     }
884                 }
885                 configuration.setDebugs( debugs );
886             }
887             else
888             {
889                 checkUnknownElement( parser, strict );
890             }
891         }
892         return configuration;
893     } //-- Configuration parseConfiguration( XmlPullParser, boolean )
894 
895     /**
896      * Method parseCoordinatesBase.
897      * 
898      * @param parser a parser object.
899      * @param strict a strict object.
900      * @throws IOException IOException if any.
901      * @throws XmlPullParserException XmlPullParserException if
902      * any.
903      * @return CoordinatesBase
904      */
905     private CoordinatesBase parseCoordinatesBase( XmlPullParser parser, boolean strict )
906         throws IOException, XmlPullParserException
907     {
908         String tagName = parser.getName();
909         CoordinatesBase coordinatesBase = new CoordinatesBase();
910         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
911         {
912             String name = parser.getAttributeName( i );
913             String value = parser.getAttributeValue( i );
914 
915             if ( name.indexOf( ':' ) >= 0 )
916             {
917                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
918             }
919             else if ( "groupId".equals( name ) )
920             {
921                 coordinatesBase.setGroupId( interpolatedTrimmed( value, "groupId" ) );
922             }
923             else if ( "artifactId".equals( name ) )
924             {
925                 coordinatesBase.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
926             }
927             else
928             {
929                 checkUnknownAttribute( parser, name, tagName, strict );
930             }
931         }
932         java.util.Set parsed = new java.util.HashSet();
933         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
934         {
935             checkUnknownElement( parser, strict );
936         }
937         return coordinatesBase;
938     } //-- CoordinatesBase parseCoordinatesBase( XmlPullParser, boolean )
939 
940     /**
941      * Method parseDirScanConfig.
942      * 
943      * @param parser a parser object.
944      * @param strict a strict object.
945      * @throws IOException IOException if any.
946      * @throws XmlPullParserException XmlPullParserException if
947      * any.
948      * @return DirScanConfig
949      */
950     private DirScanConfig parseDirScanConfig( XmlPullParser parser, boolean strict )
951         throws IOException, XmlPullParserException
952     {
953         String tagName = parser.getName();
954         DirScanConfig dirScanConfig = new DirScanConfig();
955         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
956         {
957             String name = parser.getAttributeName( i );
958             String value = parser.getAttributeValue( i );
959 
960             if ( name.indexOf( ':' ) >= 0 )
961             {
962                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
963             }
964             else if ( "ignoreParent".equals( name ) )
965             {
966                 dirScanConfig.setIgnoreParent( getBooleanValue( interpolatedTrimmed( value, "ignoreParent" ), "ignoreParent", parser, "false" ) );
967             }
968             else if ( "mode".equals( name ) )
969             {
970                 dirScanConfig.setMode( interpolatedTrimmed( value, "mode" ) );
971             }
972             else
973             {
974                 checkUnknownAttribute( parser, name, tagName, strict );
975             }
976         }
977         java.util.Set parsed = new java.util.HashSet();
978         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
979         {
980             if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
981             {
982                 java.util.List<TagScanConfig> includes = new java.util.ArrayList<TagScanConfig>();
983                 while ( parser.nextTag() == XmlPullParser.START_TAG )
984                 {
985                     if ( "include".equals( parser.getName() ) )
986                     {
987                         includes.add( parseTagScanConfig( parser, strict ) );
988                     }
989                     else
990                     {
991                         checkUnknownElement( parser, strict );
992                     }
993                 }
994                 dirScanConfig.setIncludes( includes );
995             }
996             else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
997             {
998                 java.util.List<TagExclude> excludes = new java.util.ArrayList<TagExclude>();
999                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1000                 {
1001                     if ( "exclude".equals( parser.getName() ) )
1002                     {
1003                         excludes.add( parseTagExclude( parser, strict ) );
1004                     }
1005                     else
1006                     {
1007                         checkUnknownElement( parser, strict );
1008                     }
1009                 }
1010                 dirScanConfig.setExcludes( excludes );
1011             }
1012             else if ( checkFieldWithDuplicate( parser, "tagScanConfigs", null, parsed ) )
1013             {
1014                 java.util.List<TagScanConfig> tagScanConfigs = new java.util.ArrayList<TagScanConfig>();
1015                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1016                 {
1017                     if ( "tagScanConfig".equals( parser.getName() ) )
1018                     {
1019                         tagScanConfigs.add( parseTagScanConfig( parser, strict ) );
1020                     }
1021                     else
1022                     {
1023                         checkUnknownElement( parser, strict );
1024                     }
1025                 }
1026                 dirScanConfig.setTagScanConfigs( tagScanConfigs );
1027             }
1028             else
1029             {
1030                 checkUnknownElement( parser, strict );
1031             }
1032         }
1033         return dirScanConfig;
1034     } //-- DirScanConfig parseDirScanConfig( XmlPullParser, boolean )
1035 
1036     /**
1037      * Method parseDiscovery.
1038      * 
1039      * @param parser a parser object.
1040      * @param strict a strict object.
1041      * @throws IOException IOException if any.
1042      * @throws XmlPullParserException XmlPullParserException if
1043      * any.
1044      * @return Discovery
1045      */
1046     private Discovery parseDiscovery( XmlPullParser parser, boolean strict )
1047         throws IOException, XmlPullParserException
1048     {
1049         String tagName = parser.getName();
1050         Discovery discovery = new Discovery();
1051         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1052         {
1053             String name = parser.getAttributeName( i );
1054             String value = parser.getAttributeValue( i );
1055 
1056             if ( name.indexOf( ':' ) >= 0 )
1057             {
1058                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1059             }
1060             else
1061             {
1062                 checkUnknownAttribute( parser, name, tagName, strict );
1063             }
1064         }
1065         java.util.Set parsed = new java.util.HashSet();
1066         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1067         {
1068             if ( checkFieldWithDuplicate( parser, "scanProfiles", null, parsed ) )
1069             {
1070                 java.util.List<String> scanProfiles = new java.util.ArrayList<String>();
1071                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1072                 {
1073                     if ( "scanProfile".equals( parser.getName() ) )
1074                     {
1075                         scanProfiles.add( interpolatedTrimmed( parser.nextText(), "scanProfiles" ) );
1076                     }
1077                     else
1078                     {
1079                         checkUnknownElement( parser, strict );
1080                     }
1081                 }
1082                 discovery.setScanProfiles( scanProfiles );
1083             }
1084             else
1085             {
1086                 checkUnknownElement( parser, strict );
1087             }
1088         }
1089         return discovery;
1090     } //-- Discovery parseDiscovery( XmlPullParser, boolean )
1091 
1092     /**
1093      * Method parseEffectivePom.
1094      * 
1095      * @param parser a parser object.
1096      * @param strict a strict object.
1097      * @throws IOException IOException if any.
1098      * @throws XmlPullParserException XmlPullParserException if
1099      * any.
1100      * @return EffectivePom
1101      */
1102     private EffectivePom parseEffectivePom( XmlPullParser parser, boolean strict )
1103         throws IOException, XmlPullParserException
1104     {
1105         String tagName = parser.getName();
1106         EffectivePom effectivePom = new EffectivePom();
1107         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1108         {
1109             String name = parser.getAttributeName( i );
1110             String value = parser.getAttributeValue( i );
1111 
1112             if ( name.indexOf( ':' ) >= 0 )
1113             {
1114                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1115             }
1116             else
1117             {
1118                 checkUnknownAttribute( parser, name, tagName, strict );
1119             }
1120         }
1121         java.util.Set parsed = new java.util.HashSet();
1122         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1123         {
1124             if ( checkFieldWithDuplicate( parser, "excludeProperties", null, parsed ) )
1125             {
1126                 java.util.List<String> excludeProperties = new java.util.ArrayList<String>();
1127                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1128                 {
1129                     if ( "excludeProperty".equals( parser.getName() ) )
1130                     {
1131                         excludeProperties.add( interpolatedTrimmed( parser.nextText(), "excludeProperties" ) );
1132                     }
1133                     else
1134                     {
1135                         checkUnknownElement( parser, strict );
1136                     }
1137                 }
1138                 effectivePom.setExcludeProperties( excludeProperties );
1139             }
1140             else
1141             {
1142                 checkUnknownElement( parser, strict );
1143             }
1144         }
1145         return effectivePom;
1146     } //-- EffectivePom parseEffectivePom( XmlPullParser, boolean )
1147 
1148     /**
1149      * Method parseExclude.
1150      * 
1151      * @param parser a parser object.
1152      * @param strict a strict object.
1153      * @throws IOException IOException if any.
1154      * @throws XmlPullParserException XmlPullParserException if
1155      * any.
1156      * @return Exclude
1157      */
1158     private Exclude parseExclude( XmlPullParser parser, boolean strict )
1159         throws IOException, XmlPullParserException
1160     {
1161         String tagName = parser.getName();
1162         Exclude exclude = new Exclude();
1163         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1164         {
1165             String name = parser.getAttributeName( i );
1166             String value = parser.getAttributeValue( i );
1167 
1168             if ( name.indexOf( ':' ) >= 0 )
1169             {
1170                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1171             }
1172             else if ( "glob".equals( name ) )
1173             {
1174                 exclude.setGlob( interpolatedTrimmed( value, "glob" ) );
1175             }
1176             else if ( "entryType".equals( name ) )
1177             {
1178                 exclude.setEntryType( interpolatedTrimmed( value, "entryType" ) );
1179             }
1180             else if ( "matcherType".equals( name ) )
1181             {
1182                 exclude.setMatcherType( interpolatedTrimmed( value, "matcherType" ) );
1183             }
1184             else
1185             {
1186                 checkUnknownAttribute( parser, name, tagName, strict );
1187             }
1188         }
1189         exclude.setValue( interpolatedTrimmed( parser.nextText(), "value" ) );
1190         return exclude;
1191     } //-- Exclude parseExclude( XmlPullParser, boolean )
1192 
1193     /**
1194      * Method parseExecutables.
1195      * 
1196      * @param parser a parser object.
1197      * @param strict a strict object.
1198      * @throws IOException IOException if any.
1199      * @throws XmlPullParserException XmlPullParserException if
1200      * any.
1201      * @return Executables
1202      */
1203     private Executables parseExecutables( XmlPullParser parser, boolean strict )
1204         throws IOException, XmlPullParserException
1205     {
1206         String tagName = parser.getName();
1207         Executables executables = new Executables();
1208         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1209         {
1210             String name = parser.getAttributeName( i );
1211             String value = parser.getAttributeValue( i );
1212 
1213             if ( name.indexOf( ':' ) >= 0 )
1214             {
1215                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1216             }
1217             else
1218             {
1219                 checkUnknownAttribute( parser, name, tagName, strict );
1220             }
1221         }
1222         java.util.Set parsed = new java.util.HashSet();
1223         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1224         {
1225             if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
1226             {
1227                 java.util.List<PluginSet> plugins = new java.util.ArrayList<PluginSet>();
1228                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1229                 {
1230                     if ( "plugin".equals( parser.getName() ) )
1231                     {
1232                         plugins.add( parsePluginSet( parser, strict ) );
1233                     }
1234                     else
1235                     {
1236                         checkUnknownElement( parser, strict );
1237                     }
1238                 }
1239                 executables.setPlugins( plugins );
1240             }
1241             else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) )
1242             {
1243                 java.util.List<ExecutionIdsList> executions = new java.util.ArrayList<ExecutionIdsList>();
1244                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1245                 {
1246                     if ( "execution".equals( parser.getName() ) )
1247                     {
1248                         executions.add( parseExecutionIdsList( parser, strict ) );
1249                     }
1250                     else
1251                     {
1252                         checkUnknownElement( parser, strict );
1253                     }
1254                 }
1255                 executables.setExecutions( executions );
1256             }
1257             else if ( checkFieldWithDuplicate( parser, "goalsLists", null, parsed ) )
1258             {
1259                 java.util.List<GoalsList> goalsLists = new java.util.ArrayList<GoalsList>();
1260                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1261                 {
1262                     if ( "goalsList".equals( parser.getName() ) )
1263                     {
1264                         goalsLists.add( parseGoalsList( parser, strict ) );
1265                     }
1266                     else
1267                     {
1268                         checkUnknownElement( parser, strict );
1269                     }
1270                 }
1271                 executables.setGoalsLists( goalsLists );
1272             }
1273             else
1274             {
1275                 checkUnknownElement( parser, strict );
1276             }
1277         }
1278         return executables;
1279     } //-- Executables parseExecutables( XmlPullParser, boolean )
1280 
1281     /**
1282      * Method parseExecutionConfigurationScan.
1283      * 
1284      * @param parser a parser object.
1285      * @param strict a strict object.
1286      * @throws IOException IOException if any.
1287      * @throws XmlPullParserException XmlPullParserException if
1288      * any.
1289      * @return ExecutionConfigurationScan
1290      */
1291     private ExecutionConfigurationScan parseExecutionConfigurationScan( XmlPullParser parser, boolean strict )
1292         throws IOException, XmlPullParserException
1293     {
1294         String tagName = parser.getName();
1295         ExecutionConfigurationScan executionConfigurationScan = new ExecutionConfigurationScan();
1296         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1297         {
1298             String name = parser.getAttributeName( i );
1299             String value = parser.getAttributeValue( i );
1300 
1301             if ( name.indexOf( ':' ) >= 0 )
1302             {
1303                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1304             }
1305             else if ( "ignoreParentConfig".equals( name ) )
1306             {
1307                 executionConfigurationScan.setIgnoreParentConfig( getBooleanValue( interpolatedTrimmed( value, "ignoreParentConfig" ), "ignoreParentConfig", parser, "false" ) );
1308             }
1309             else
1310             {
1311                 checkUnknownAttribute( parser, name, tagName, strict );
1312             }
1313         }
1314         java.util.Set parsed = new java.util.HashSet();
1315         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1316         {
1317             if ( checkFieldWithDuplicate( parser, "execIds", null, parsed ) )
1318             {
1319                 java.util.List<String> execIds = new java.util.ArrayList<String>();
1320                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1321                 {
1322                     if ( "execId".equals( parser.getName() ) )
1323                     {
1324                         execIds.add( interpolatedTrimmed( parser.nextText(), "execIds" ) );
1325                     }
1326                     else
1327                     {
1328                         checkUnknownElement( parser, strict );
1329                     }
1330                 }
1331                 executionConfigurationScan.setExecIds( execIds );
1332             }
1333             else if ( checkFieldWithDuplicate( parser, "dirScan", null, parsed ) )
1334             {
1335                 executionConfigurationScan.setDirScan( parseDirScanConfig( parser, strict ) );
1336             }
1337             else
1338             {
1339                 checkUnknownElement( parser, strict );
1340             }
1341         }
1342         return executionConfigurationScan;
1343     } //-- ExecutionConfigurationScan parseExecutionConfigurationScan( XmlPullParser, boolean )
1344 
1345     /**
1346      * Method parseExecutionControl.
1347      * 
1348      * @param parser a parser object.
1349      * @param strict a strict object.
1350      * @throws IOException IOException if any.
1351      * @throws XmlPullParserException XmlPullParserException if
1352      * any.
1353      * @return ExecutionControl
1354      */
1355     private ExecutionControl parseExecutionControl( XmlPullParser parser, boolean strict )
1356         throws IOException, XmlPullParserException
1357     {
1358         String tagName = parser.getName();
1359         ExecutionControl executionControl = new ExecutionControl();
1360         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1361         {
1362             String name = parser.getAttributeName( i );
1363             String value = parser.getAttributeValue( i );
1364 
1365             if ( name.indexOf( ':' ) >= 0 )
1366             {
1367                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1368             }
1369             else
1370             {
1371                 checkUnknownAttribute( parser, name, tagName, strict );
1372             }
1373         }
1374         java.util.Set parsed = new java.util.HashSet();
1375         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1376         {
1377             if ( checkFieldWithDuplicate( parser, "runAlways", null, parsed ) )
1378             {
1379                 executionControl.setRunAlways( parseExecutables( parser, strict ) );
1380             }
1381             else if ( checkFieldWithDuplicate( parser, "ignoreMissing", null, parsed ) )
1382             {
1383                 executionControl.setIgnoreMissing( parseExecutables( parser, strict ) );
1384             }
1385             else if ( checkFieldWithDuplicate( parser, "reconcile", null, parsed ) )
1386             {
1387                 executionControl.setReconcile( parseReconcile( parser, strict ) );
1388             }
1389             else
1390             {
1391                 checkUnknownElement( parser, strict );
1392             }
1393         }
1394         return executionControl;
1395     } //-- ExecutionControl parseExecutionControl( XmlPullParser, boolean )
1396 
1397     /**
1398      * Method parseExecutionIdsList.
1399      * 
1400      * @param parser a parser object.
1401      * @param strict a strict object.
1402      * @throws IOException IOException if any.
1403      * @throws XmlPullParserException XmlPullParserException if
1404      * any.
1405      * @return ExecutionIdsList
1406      */
1407     private ExecutionIdsList parseExecutionIdsList( XmlPullParser parser, boolean strict )
1408         throws IOException, XmlPullParserException
1409     {
1410         String tagName = parser.getName();
1411         ExecutionIdsList executionIdsList = new ExecutionIdsList();
1412         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1413         {
1414             String name = parser.getAttributeName( i );
1415             String value = parser.getAttributeValue( i );
1416 
1417             if ( name.indexOf( ':' ) >= 0 )
1418             {
1419                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1420             }
1421             else if ( "groupId".equals( name ) )
1422             {
1423                 executionIdsList.setGroupId( interpolatedTrimmed( value, "groupId" ) );
1424             }
1425             else if ( "artifactId".equals( name ) )
1426             {
1427                 executionIdsList.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
1428             }
1429             else
1430             {
1431                 checkUnknownAttribute( parser, name, tagName, strict );
1432             }
1433         }
1434         java.util.Set parsed = new java.util.HashSet();
1435         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1436         {
1437             if ( checkFieldWithDuplicate( parser, "execIds", null, parsed ) )
1438             {
1439                 java.util.List<String> execIds = new java.util.ArrayList<String>();
1440                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1441                 {
1442                     if ( "execId".equals( parser.getName() ) )
1443                     {
1444                         execIds.add( interpolatedTrimmed( parser.nextText(), "execIds" ) );
1445                     }
1446                     else
1447                     {
1448                         checkUnknownElement( parser, strict );
1449                     }
1450                 }
1451                 executionIdsList.setExecIds( execIds );
1452             }
1453             else
1454             {
1455                 checkUnknownElement( parser, strict );
1456             }
1457         }
1458         return executionIdsList;
1459     } //-- ExecutionIdsList parseExecutionIdsList( XmlPullParser, boolean )
1460 
1461     /**
1462      * Method parseGoalId.
1463      * 
1464      * @param parser a parser object.
1465      * @param strict a strict object.
1466      * @throws IOException IOException if any.
1467      * @throws XmlPullParserException XmlPullParserException if
1468      * any.
1469      * @return GoalId
1470      */
1471     private GoalId parseGoalId( XmlPullParser parser, boolean strict )
1472         throws IOException, XmlPullParserException
1473     {
1474         String tagName = parser.getName();
1475         GoalId goalId = new GoalId();
1476         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1477         {
1478             String name = parser.getAttributeName( i );
1479             String value = parser.getAttributeValue( i );
1480 
1481             if ( name.indexOf( ':' ) >= 0 )
1482             {
1483                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1484             }
1485             else if ( "goal".equals( name ) )
1486             {
1487                 goalId.setGoal( interpolatedTrimmed( value, "goal" ) );
1488             }
1489             else if ( "groupId".equals( name ) )
1490             {
1491                 goalId.setGroupId( interpolatedTrimmed( value, "groupId" ) );
1492             }
1493             else if ( "artifactId".equals( name ) )
1494             {
1495                 goalId.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
1496             }
1497             else
1498             {
1499                 checkUnknownAttribute( parser, name, tagName, strict );
1500             }
1501         }
1502         java.util.Set parsed = new java.util.HashSet();
1503         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1504         {
1505             checkUnknownElement( parser, strict );
1506         }
1507         return goalId;
1508     } //-- GoalId parseGoalId( XmlPullParser, boolean )
1509 
1510     /**
1511      * Method parseGoalReconciliation.
1512      * 
1513      * @param parser a parser object.
1514      * @param strict a strict object.
1515      * @throws IOException IOException if any.
1516      * @throws XmlPullParserException XmlPullParserException if
1517      * any.
1518      * @return GoalReconciliation
1519      */
1520     private GoalReconciliation parseGoalReconciliation( XmlPullParser parser, boolean strict )
1521         throws IOException, XmlPullParserException
1522     {
1523         String tagName = parser.getName();
1524         GoalReconciliation goalReconciliation = new GoalReconciliation();
1525         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1526         {
1527             String name = parser.getAttributeName( i );
1528             String value = parser.getAttributeValue( i );
1529 
1530             if ( name.indexOf( ':' ) >= 0 )
1531             {
1532                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1533             }
1534             else if ( "goal".equals( name ) )
1535             {
1536                 goalReconciliation.setGoal( interpolatedTrimmed( value, "goal" ) );
1537             }
1538             else if ( "groupId".equals( name ) )
1539             {
1540                 goalReconciliation.setGroupId( interpolatedTrimmed( value, "groupId" ) );
1541             }
1542             else if ( "artifactId".equals( name ) )
1543             {
1544                 goalReconciliation.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
1545             }
1546             else
1547             {
1548                 checkUnknownAttribute( parser, name, tagName, strict );
1549             }
1550         }
1551         java.util.Set parsed = new java.util.HashSet();
1552         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1553         {
1554             if ( checkFieldWithDuplicate( parser, "reconciles", null, parsed ) )
1555             {
1556                 java.util.List<TrackedProperty> reconciles = new java.util.ArrayList<TrackedProperty>();
1557                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1558                 {
1559                     if ( "reconcile".equals( parser.getName() ) )
1560                     {
1561                         reconciles.add( parseTrackedProperty( parser, strict ) );
1562                     }
1563                     else
1564                     {
1565                         checkUnknownElement( parser, strict );
1566                     }
1567                 }
1568                 goalReconciliation.setReconciles( reconciles );
1569             }
1570             else if ( checkFieldWithDuplicate( parser, "logs", null, parsed ) )
1571             {
1572                 java.util.List<PropertyName> logs = new java.util.ArrayList<PropertyName>();
1573                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1574                 {
1575                     if ( "log".equals( parser.getName() ) )
1576                     {
1577                         logs.add( parsePropertyName( parser, strict ) );
1578                     }
1579                     else
1580                     {
1581                         checkUnknownElement( parser, strict );
1582                     }
1583                 }
1584                 goalReconciliation.setLogs( logs );
1585             }
1586             else if ( checkFieldWithDuplicate( parser, "nologs", null, parsed ) )
1587             {
1588                 java.util.List<PropertyName> nologs = new java.util.ArrayList<PropertyName>();
1589                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1590                 {
1591                     if ( "nolog".equals( parser.getName() ) )
1592                     {
1593                         nologs.add( parsePropertyName( parser, strict ) );
1594                     }
1595                     else
1596                     {
1597                         checkUnknownElement( parser, strict );
1598                     }
1599                 }
1600                 goalReconciliation.setNologs( nologs );
1601             }
1602             else if ( checkFieldWithDuplicate( parser, "logAll", null, parsed ) )
1603             {
1604                 goalReconciliation.setLogAll( getBooleanValue( interpolatedTrimmed( parser.nextText(), "logAll" ), "logAll", parser, "true" ) );
1605             }
1606             else
1607             {
1608                 checkUnknownElement( parser, strict );
1609             }
1610         }
1611         return goalReconciliation;
1612     } //-- GoalReconciliation parseGoalReconciliation( XmlPullParser, boolean )
1613 
1614     /**
1615      * Method parseGoalsList.
1616      * 
1617      * @param parser a parser object.
1618      * @param strict a strict object.
1619      * @throws IOException IOException if any.
1620      * @throws XmlPullParserException XmlPullParserException if
1621      * any.
1622      * @return GoalsList
1623      */
1624     private GoalsList parseGoalsList( XmlPullParser parser, boolean strict )
1625         throws IOException, XmlPullParserException
1626     {
1627         String tagName = parser.getName();
1628         GoalsList goalsList = new GoalsList();
1629         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1630         {
1631             String name = parser.getAttributeName( i );
1632             String value = parser.getAttributeValue( i );
1633 
1634             if ( name.indexOf( ':' ) >= 0 )
1635             {
1636                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1637             }
1638             else if ( "groupId".equals( name ) )
1639             {
1640                 goalsList.setGroupId( interpolatedTrimmed( value, "groupId" ) );
1641             }
1642             else if ( "artifactId".equals( name ) )
1643             {
1644                 goalsList.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
1645             }
1646             else
1647             {
1648                 checkUnknownAttribute( parser, name, tagName, strict );
1649             }
1650         }
1651         java.util.Set parsed = new java.util.HashSet();
1652         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1653         {
1654             if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) )
1655             {
1656                 java.util.List<String> goals = new java.util.ArrayList<String>();
1657                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1658                 {
1659                     if ( "goal".equals( parser.getName() ) )
1660                     {
1661                         goals.add( interpolatedTrimmed( parser.nextText(), "goals" ) );
1662                     }
1663                     else
1664                     {
1665                         checkUnknownElement( parser, strict );
1666                     }
1667                 }
1668                 goalsList.setGoals( goals );
1669             }
1670             else
1671             {
1672                 checkUnknownElement( parser, strict );
1673             }
1674         }
1675         return goalsList;
1676     } //-- GoalsList parseGoalsList( XmlPullParser, boolean )
1677 
1678     /**
1679      * Method parseInclude.
1680      * 
1681      * @param parser a parser object.
1682      * @param strict a strict object.
1683      * @throws IOException IOException if any.
1684      * @throws XmlPullParserException XmlPullParserException if
1685      * any.
1686      * @return Include
1687      */
1688     private Include parseInclude( XmlPullParser parser, boolean strict )
1689         throws IOException, XmlPullParserException
1690     {
1691         String tagName = parser.getName();
1692         Include include = new Include();
1693         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1694         {
1695             String name = parser.getAttributeName( i );
1696             String value = parser.getAttributeValue( i );
1697 
1698             if ( name.indexOf( ':' ) >= 0 )
1699             {
1700                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1701             }
1702             else if ( "recursive".equals( name ) )
1703             {
1704                 include.setRecursive( getBooleanValue( interpolatedTrimmed( value, "recursive" ), "recursive", parser, "true" ) );
1705             }
1706             else if ( "glob".equals( name ) )
1707             {
1708                 include.setGlob( interpolatedTrimmed( value, "glob" ) );
1709             }
1710             else
1711             {
1712                 checkUnknownAttribute( parser, name, tagName, strict );
1713             }
1714         }
1715         include.setValue( interpolatedTrimmed( parser.nextText(), "value" ) );
1716         return include;
1717     } //-- Include parseInclude( XmlPullParser, boolean )
1718 
1719     /**
1720      * Method parseInput.
1721      * 
1722      * @param parser a parser object.
1723      * @param strict a strict object.
1724      * @throws IOException IOException if any.
1725      * @throws XmlPullParserException XmlPullParserException if
1726      * any.
1727      * @return Input
1728      */
1729     private Input parseInput( XmlPullParser parser, boolean strict )
1730         throws IOException, XmlPullParserException
1731     {
1732         String tagName = parser.getName();
1733         Input input = new Input();
1734         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1735         {
1736             String name = parser.getAttributeName( i );
1737             String value = parser.getAttributeValue( i );
1738 
1739             if ( name.indexOf( ':' ) >= 0 )
1740             {
1741                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1742             }
1743             else
1744             {
1745                 checkUnknownAttribute( parser, name, tagName, strict );
1746             }
1747         }
1748         java.util.Set parsed = new java.util.HashSet();
1749         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1750         {
1751             if ( checkFieldWithDuplicate( parser, "global", null, parsed ) )
1752             {
1753                 input.setGlobal( parsePathSet( parser, strict ) );
1754             }
1755             else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
1756             {
1757                 java.util.List<PluginConfigurationScan> plugins = new java.util.ArrayList<PluginConfigurationScan>();
1758                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1759                 {
1760                     if ( "plugin".equals( parser.getName() ) )
1761                     {
1762                         plugins.add( parsePluginConfigurationScan( parser, strict ) );
1763                     }
1764                     else
1765                     {
1766                         checkUnknownElement( parser, strict );
1767                     }
1768                 }
1769                 input.setPlugins( plugins );
1770             }
1771             else
1772             {
1773                 checkUnknownElement( parser, strict );
1774             }
1775         }
1776         return input;
1777     } //-- Input parseInput( XmlPullParser, boolean )
1778 
1779     /**
1780      * Method parseLocal.
1781      * 
1782      * @param parser a parser object.
1783      * @param strict a strict object.
1784      * @throws IOException IOException if any.
1785      * @throws XmlPullParserException XmlPullParserException if
1786      * any.
1787      * @return Local
1788      */
1789     private Local parseLocal( XmlPullParser parser, boolean strict )
1790         throws IOException, XmlPullParserException
1791     {
1792         String tagName = parser.getName();
1793         Local local = new Local();
1794         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1795         {
1796             String name = parser.getAttributeName( i );
1797             String value = parser.getAttributeValue( i );
1798 
1799             if ( name.indexOf( ':' ) >= 0 )
1800             {
1801                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1802             }
1803             else
1804             {
1805                 checkUnknownAttribute( parser, name, tagName, strict );
1806             }
1807         }
1808         java.util.Set parsed = new java.util.HashSet();
1809         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1810         {
1811             if ( checkFieldWithDuplicate( parser, "location", null, parsed ) )
1812             {
1813                 local.setLocation( interpolatedTrimmed( parser.nextText(), "location" ) );
1814             }
1815             else if ( checkFieldWithDuplicate( parser, "maxBuildsCached", null, parsed ) )
1816             {
1817                 local.setMaxBuildsCached( getIntegerValue( interpolatedTrimmed( parser.nextText(), "maxBuildsCached" ), "maxBuildsCached", parser, strict ) );
1818             }
1819             else
1820             {
1821                 checkUnknownElement( parser, strict );
1822             }
1823         }
1824         return local;
1825     } //-- Local parseLocal( XmlPullParser, boolean )
1826 
1827     /**
1828      * Method parseMultiModule.
1829      * 
1830      * @param parser a parser object.
1831      * @param strict a strict object.
1832      * @throws IOException IOException if any.
1833      * @throws XmlPullParserException XmlPullParserException if
1834      * any.
1835      * @return MultiModule
1836      */
1837     private MultiModule parseMultiModule( XmlPullParser parser, boolean strict )
1838         throws IOException, XmlPullParserException
1839     {
1840         String tagName = parser.getName();
1841         MultiModule multiModule = new MultiModule();
1842         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1843         {
1844             String name = parser.getAttributeName( i );
1845             String value = parser.getAttributeValue( i );
1846 
1847             if ( name.indexOf( ':' ) >= 0 )
1848             {
1849                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1850             }
1851             else
1852             {
1853                 checkUnknownAttribute( parser, name, tagName, strict );
1854             }
1855         }
1856         java.util.Set parsed = new java.util.HashSet();
1857         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1858         {
1859             if ( checkFieldWithDuplicate( parser, "discovery", null, parsed ) )
1860             {
1861                 multiModule.setDiscovery( parseDiscovery( parser, strict ) );
1862             }
1863             else
1864             {
1865                 checkUnknownElement( parser, strict );
1866             }
1867         }
1868         return multiModule;
1869     } //-- MultiModule parseMultiModule( XmlPullParser, boolean )
1870 
1871     /**
1872      * Method parseOutput.
1873      * 
1874      * @param parser a parser object.
1875      * @param strict a strict object.
1876      * @throws IOException IOException if any.
1877      * @throws XmlPullParserException XmlPullParserException if
1878      * any.
1879      * @return Output
1880      */
1881     private Output parseOutput( XmlPullParser parser, boolean strict )
1882         throws IOException, XmlPullParserException
1883     {
1884         String tagName = parser.getName();
1885         Output output = new Output();
1886         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1887         {
1888             String name = parser.getAttributeName( i );
1889             String value = parser.getAttributeValue( i );
1890 
1891             if ( name.indexOf( ':' ) >= 0 )
1892             {
1893                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1894             }
1895             else
1896             {
1897                 checkUnknownAttribute( parser, name, tagName, strict );
1898             }
1899         }
1900         java.util.Set parsed = new java.util.HashSet();
1901         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1902         {
1903             if ( checkFieldWithDuplicate( parser, "exclude", null, parsed ) )
1904             {
1905                 output.setExclude( parseOutputExclude( parser, strict ) );
1906             }
1907             else
1908             {
1909                 checkUnknownElement( parser, strict );
1910             }
1911         }
1912         return output;
1913     } //-- Output parseOutput( XmlPullParser, boolean )
1914 
1915     /**
1916      * Method parseOutputExclude.
1917      * 
1918      * @param parser a parser object.
1919      * @param strict a strict object.
1920      * @throws IOException IOException if any.
1921      * @throws XmlPullParserException XmlPullParserException if
1922      * any.
1923      * @return OutputExclude
1924      */
1925     private OutputExclude parseOutputExclude( XmlPullParser parser, boolean strict )
1926         throws IOException, XmlPullParserException
1927     {
1928         String tagName = parser.getName();
1929         OutputExclude outputExclude = new OutputExclude();
1930         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1931         {
1932             String name = parser.getAttributeName( i );
1933             String value = parser.getAttributeValue( i );
1934 
1935             if ( name.indexOf( ':' ) >= 0 )
1936             {
1937                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1938             }
1939             else
1940             {
1941                 checkUnknownAttribute( parser, name, tagName, strict );
1942             }
1943         }
1944         java.util.Set parsed = new java.util.HashSet();
1945         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
1946         {
1947             if ( checkFieldWithDuplicate( parser, "patterns", null, parsed ) )
1948             {
1949                 java.util.List<String> patterns = new java.util.ArrayList<String>();
1950                 while ( parser.nextTag() == XmlPullParser.START_TAG )
1951                 {
1952                     if ( "pattern".equals( parser.getName() ) )
1953                     {
1954                         patterns.add( interpolatedTrimmed( parser.nextText(), "patterns" ) );
1955                     }
1956                     else
1957                     {
1958                         checkUnknownElement( parser, strict );
1959                     }
1960                 }
1961                 outputExclude.setPatterns( patterns );
1962             }
1963             else
1964             {
1965                 checkUnknownElement( parser, strict );
1966             }
1967         }
1968         return outputExclude;
1969     } //-- OutputExclude parseOutputExclude( XmlPullParser, boolean )
1970 
1971     /**
1972      * Method parsePathSet.
1973      * 
1974      * @param parser a parser object.
1975      * @param strict a strict object.
1976      * @throws IOException IOException if any.
1977      * @throws XmlPullParserException XmlPullParserException if
1978      * any.
1979      * @return PathSet
1980      */
1981     private PathSet parsePathSet( XmlPullParser parser, boolean strict )
1982         throws IOException, XmlPullParserException
1983     {
1984         String tagName = parser.getName();
1985         PathSet pathSet = new PathSet();
1986         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
1987         {
1988             String name = parser.getAttributeName( i );
1989             String value = parser.getAttributeValue( i );
1990 
1991             if ( name.indexOf( ':' ) >= 0 )
1992             {
1993                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
1994             }
1995             else
1996             {
1997                 checkUnknownAttribute( parser, name, tagName, strict );
1998             }
1999         }
2000         java.util.Set parsed = new java.util.HashSet();
2001         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2002         {
2003             if ( checkFieldWithDuplicate( parser, "glob", null, parsed ) )
2004             {
2005                 pathSet.setGlob( interpolatedTrimmed( parser.nextText(), "glob" ) );
2006             }
2007             else if ( checkFieldWithDuplicate( parser, "includes", null, parsed ) )
2008             {
2009                 java.util.List<Include> includes = new java.util.ArrayList<Include>();
2010                 while ( parser.nextTag() == XmlPullParser.START_TAG )
2011                 {
2012                     if ( "include".equals( parser.getName() ) )
2013                     {
2014                         includes.add( parseInclude( parser, strict ) );
2015                     }
2016                     else
2017                     {
2018                         checkUnknownElement( parser, strict );
2019                     }
2020                 }
2021                 pathSet.setIncludes( includes );
2022             }
2023             else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
2024             {
2025                 java.util.List<Exclude> excludes = new java.util.ArrayList<Exclude>();
2026                 while ( parser.nextTag() == XmlPullParser.START_TAG )
2027                 {
2028                     if ( "exclude".equals( parser.getName() ) )
2029                     {
2030                         excludes.add( parseExclude( parser, strict ) );
2031                     }
2032                     else
2033                     {
2034                         checkUnknownElement( parser, strict );
2035                     }
2036                 }
2037                 pathSet.setExcludes( excludes );
2038             }
2039             else
2040             {
2041                 checkUnknownElement( parser, strict );
2042             }
2043         }
2044         return pathSet;
2045     } //-- PathSet parsePathSet( XmlPullParser, boolean )
2046 
2047     /**
2048      * Method parsePluginConfigurationScan.
2049      * 
2050      * @param parser a parser object.
2051      * @param strict a strict object.
2052      * @throws IOException IOException if any.
2053      * @throws XmlPullParserException XmlPullParserException if
2054      * any.
2055      * @return PluginConfigurationScan
2056      */
2057     private PluginConfigurationScan parsePluginConfigurationScan( XmlPullParser parser, boolean strict )
2058         throws IOException, XmlPullParserException
2059     {
2060         String tagName = parser.getName();
2061         PluginConfigurationScan pluginConfigurationScan = new PluginConfigurationScan();
2062         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2063         {
2064             String name = parser.getAttributeName( i );
2065             String value = parser.getAttributeValue( i );
2066 
2067             if ( name.indexOf( ':' ) >= 0 )
2068             {
2069                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2070             }
2071             else if ( "groupId".equals( name ) )
2072             {
2073                 pluginConfigurationScan.setGroupId( interpolatedTrimmed( value, "groupId" ) );
2074             }
2075             else if ( "artifactId".equals( name ) )
2076             {
2077                 pluginConfigurationScan.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
2078             }
2079             else
2080             {
2081                 checkUnknownAttribute( parser, name, tagName, strict );
2082             }
2083         }
2084         java.util.Set parsed = new java.util.HashSet();
2085         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2086         {
2087             if ( checkFieldWithDuplicate( parser, "effectivePom", null, parsed ) )
2088             {
2089                 pluginConfigurationScan.setEffectivePom( parseEffectivePom( parser, strict ) );
2090             }
2091             else if ( checkFieldWithDuplicate( parser, "dirScan", null, parsed ) )
2092             {
2093                 pluginConfigurationScan.setDirScan( parseDirScanConfig( parser, strict ) );
2094             }
2095             else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) )
2096             {
2097                 java.util.List<ExecutionConfigurationScan> executions = new java.util.ArrayList<ExecutionConfigurationScan>();
2098                 while ( parser.nextTag() == XmlPullParser.START_TAG )
2099                 {
2100                     if ( "execution".equals( parser.getName() ) )
2101                     {
2102                         executions.add( parseExecutionConfigurationScan( parser, strict ) );
2103                     }
2104                     else
2105                     {
2106                         checkUnknownElement( parser, strict );
2107                     }
2108                 }
2109                 pluginConfigurationScan.setExecutions( executions );
2110             }
2111             else
2112             {
2113                 checkUnknownElement( parser, strict );
2114             }
2115         }
2116         return pluginConfigurationScan;
2117     } //-- PluginConfigurationScan parsePluginConfigurationScan( XmlPullParser, boolean )
2118 
2119     /**
2120      * Method parsePluginSet.
2121      * 
2122      * @param parser a parser object.
2123      * @param strict a strict object.
2124      * @throws IOException IOException if any.
2125      * @throws XmlPullParserException XmlPullParserException if
2126      * any.
2127      * @return PluginSet
2128      */
2129     private PluginSet parsePluginSet( XmlPullParser parser, boolean strict )
2130         throws IOException, XmlPullParserException
2131     {
2132         String tagName = parser.getName();
2133         PluginSet pluginSet = new PluginSet();
2134         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2135         {
2136             String name = parser.getAttributeName( i );
2137             String value = parser.getAttributeValue( i );
2138 
2139             if ( name.indexOf( ':' ) >= 0 )
2140             {
2141                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2142             }
2143             else if ( "groupId".equals( name ) )
2144             {
2145                 pluginSet.setGroupId( interpolatedTrimmed( value, "groupId" ) );
2146             }
2147             else if ( "artifactId".equals( name ) )
2148             {
2149                 pluginSet.setArtifactId( interpolatedTrimmed( value, "artifactId" ) );
2150             }
2151             else
2152             {
2153                 checkUnknownAttribute( parser, name, tagName, strict );
2154             }
2155         }
2156         java.util.Set parsed = new java.util.HashSet();
2157         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2158         {
2159             checkUnknownElement( parser, strict );
2160         }
2161         return pluginSet;
2162     } //-- PluginSet parsePluginSet( XmlPullParser, boolean )
2163 
2164     /**
2165      * Method parseProjectVersioning.
2166      * 
2167      * @param parser a parser object.
2168      * @param strict a strict object.
2169      * @throws IOException IOException if any.
2170      * @throws XmlPullParserException XmlPullParserException if
2171      * any.
2172      * @return ProjectVersioning
2173      */
2174     private ProjectVersioning parseProjectVersioning( XmlPullParser parser, boolean strict )
2175         throws IOException, XmlPullParserException
2176     {
2177         String tagName = parser.getName();
2178         ProjectVersioning projectVersioning = new ProjectVersioning();
2179         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2180         {
2181             String name = parser.getAttributeName( i );
2182             String value = parser.getAttributeValue( i );
2183 
2184             if ( name.indexOf( ':' ) >= 0 )
2185             {
2186                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2187             }
2188             else if ( "adjustMetaInf".equals( name ) )
2189             {
2190                 projectVersioning.setAdjustMetaInf( getBooleanValue( interpolatedTrimmed( value, "adjustMetaInf" ), "adjustMetaInf", parser, "false" ) );
2191             }
2192             else
2193             {
2194                 checkUnknownAttribute( parser, name, tagName, strict );
2195             }
2196         }
2197         java.util.Set parsed = new java.util.HashSet();
2198         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2199         {
2200             checkUnknownElement( parser, strict );
2201         }
2202         return projectVersioning;
2203     } //-- ProjectVersioning parseProjectVersioning( XmlPullParser, boolean )
2204 
2205     /**
2206      * Method parsePropertyName.
2207      * 
2208      * @param parser a parser object.
2209      * @param strict a strict object.
2210      * @throws IOException IOException if any.
2211      * @throws XmlPullParserException XmlPullParserException if
2212      * any.
2213      * @return PropertyName
2214      */
2215     private PropertyName parsePropertyName( XmlPullParser parser, boolean strict )
2216         throws IOException, XmlPullParserException
2217     {
2218         String tagName = parser.getName();
2219         PropertyName propertyName = new PropertyName();
2220         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2221         {
2222             String name = parser.getAttributeName( i );
2223             String value = parser.getAttributeValue( i );
2224 
2225             if ( name.indexOf( ':' ) >= 0 )
2226             {
2227                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2228             }
2229             else if ( "propertyName".equals( name ) )
2230             {
2231                 propertyName.setPropertyName( interpolatedTrimmed( value, "propertyName" ) );
2232             }
2233             else
2234             {
2235                 checkUnknownAttribute( parser, name, tagName, strict );
2236             }
2237         }
2238         propertyName.setValue( interpolatedTrimmed( parser.nextText(), "value" ) );
2239         return propertyName;
2240     } //-- PropertyName parsePropertyName( XmlPullParser, boolean )
2241 
2242     /**
2243      * Method parseReconcile.
2244      * 
2245      * @param parser a parser object.
2246      * @param strict a strict object.
2247      * @throws IOException IOException if any.
2248      * @throws XmlPullParserException XmlPullParserException if
2249      * any.
2250      * @return Reconcile
2251      */
2252     private Reconcile parseReconcile( XmlPullParser parser, boolean strict )
2253         throws IOException, XmlPullParserException
2254     {
2255         String tagName = parser.getName();
2256         Reconcile reconcile = new Reconcile();
2257         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2258         {
2259             String name = parser.getAttributeName( i );
2260             String value = parser.getAttributeValue( i );
2261 
2262             if ( name.indexOf( ':' ) >= 0 )
2263             {
2264                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2265             }
2266             else if ( "logAllProperties".equals( name ) )
2267             {
2268                 reconcile.setLogAllProperties( getBooleanValue( interpolatedTrimmed( value, "logAllProperties" ), "logAllProperties", parser, "true" ) );
2269             }
2270             else
2271             {
2272                 checkUnknownAttribute( parser, name, tagName, strict );
2273             }
2274         }
2275         java.util.Set parsed = new java.util.HashSet();
2276         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2277         {
2278             if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
2279             {
2280                 java.util.List<GoalReconciliation> plugins = new java.util.ArrayList<GoalReconciliation>();
2281                 while ( parser.nextTag() == XmlPullParser.START_TAG )
2282                 {
2283                     if ( "plugin".equals( parser.getName() ) )
2284                     {
2285                         plugins.add( parseGoalReconciliation( parser, strict ) );
2286                     }
2287                     else
2288                     {
2289                         checkUnknownElement( parser, strict );
2290                     }
2291                 }
2292                 reconcile.setPlugins( plugins );
2293             }
2294             else
2295             {
2296                 checkUnknownElement( parser, strict );
2297             }
2298         }
2299         return reconcile;
2300     } //-- Reconcile parseReconcile( XmlPullParser, boolean )
2301 
2302     /**
2303      * Method parseRemote.
2304      * 
2305      * @param parser a parser object.
2306      * @param strict a strict object.
2307      * @throws IOException IOException if any.
2308      * @throws XmlPullParserException XmlPullParserException if
2309      * any.
2310      * @return Remote
2311      */
2312     private Remote parseRemote( XmlPullParser parser, boolean strict )
2313         throws IOException, XmlPullParserException
2314     {
2315         String tagName = parser.getName();
2316         Remote remote = new Remote();
2317         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2318         {
2319             String name = parser.getAttributeName( i );
2320             String value = parser.getAttributeValue( i );
2321 
2322             if ( name.indexOf( ':' ) >= 0 )
2323             {
2324                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2325             }
2326             else if ( "enabled".equals( name ) )
2327             {
2328                 remote.setEnabled( getBooleanValue( interpolatedTrimmed( value, "enabled" ), "enabled", parser, "true" ) );
2329             }
2330             else if ( "saveToRemote".equals( name ) )
2331             {
2332                 remote.setSaveToRemote( getBooleanValue( interpolatedTrimmed( value, "saveToRemote" ), "saveToRemote", parser, "false" ) );
2333             }
2334             else if ( "transport".equals( name ) )
2335             {
2336                 remote.setTransport( interpolatedTrimmed( value, "transport" ) );
2337             }
2338             else if ( "id".equals( name ) )
2339             {
2340                 remote.setId( interpolatedTrimmed( value, "id" ) );
2341             }
2342             else
2343             {
2344                 checkUnknownAttribute( parser, name, tagName, strict );
2345             }
2346         }
2347         java.util.Set parsed = new java.util.HashSet();
2348         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2349         {
2350             if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
2351             {
2352                 remote.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
2353             }
2354             else
2355             {
2356                 checkUnknownElement( parser, strict );
2357             }
2358         }
2359         return remote;
2360     } //-- Remote parseRemote( XmlPullParser, boolean )
2361 
2362     /**
2363      * Method parseTagExclude.
2364      * 
2365      * @param parser a parser object.
2366      * @param strict a strict object.
2367      * @throws IOException IOException if any.
2368      * @throws XmlPullParserException XmlPullParserException if
2369      * any.
2370      * @return TagExclude
2371      */
2372     private TagExclude parseTagExclude( XmlPullParser parser, boolean strict )
2373         throws IOException, XmlPullParserException
2374     {
2375         String tagName = parser.getName();
2376         TagExclude tagExclude = new TagExclude();
2377         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2378         {
2379             String name = parser.getAttributeName( i );
2380             String value = parser.getAttributeValue( i );
2381 
2382             if ( name.indexOf( ':' ) >= 0 )
2383             {
2384                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2385             }
2386             else if ( "tagName".equals( name ) )
2387             {
2388                 tagExclude.setTagName( interpolatedTrimmed( value, "tagName" ) );
2389             }
2390             else
2391             {
2392                 checkUnknownAttribute( parser, name, tagName, strict );
2393             }
2394         }
2395         java.util.Set parsed = new java.util.HashSet();
2396         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2397         {
2398             checkUnknownElement( parser, strict );
2399         }
2400         return tagExclude;
2401     } //-- TagExclude parseTagExclude( XmlPullParser, boolean )
2402 
2403     /**
2404      * Method parseTagScanConfig.
2405      * 
2406      * @param parser a parser object.
2407      * @param strict a strict object.
2408      * @throws IOException IOException if any.
2409      * @throws XmlPullParserException XmlPullParserException if
2410      * any.
2411      * @return TagScanConfig
2412      */
2413     private TagScanConfig parseTagScanConfig( XmlPullParser parser, boolean strict )
2414         throws IOException, XmlPullParserException
2415     {
2416         String tagName = parser.getName();
2417         TagScanConfig tagScanConfig = new TagScanConfig();
2418         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2419         {
2420             String name = parser.getAttributeName( i );
2421             String value = parser.getAttributeValue( i );
2422 
2423             if ( name.indexOf( ':' ) >= 0 )
2424             {
2425                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2426             }
2427             else if ( "recursive".equals( name ) )
2428             {
2429                 tagScanConfig.setRecursive( getBooleanValue( interpolatedTrimmed( value, "recursive" ), "recursive", parser, "true" ) );
2430             }
2431             else if ( "glob".equals( name ) )
2432             {
2433                 tagScanConfig.setGlob( interpolatedTrimmed( value, "glob" ) );
2434             }
2435             else if ( "tagName".equals( name ) )
2436             {
2437                 tagScanConfig.setTagName( interpolatedTrimmed( value, "tagName" ) );
2438             }
2439             else
2440             {
2441                 checkUnknownAttribute( parser, name, tagName, strict );
2442             }
2443         }
2444         java.util.Set parsed = new java.util.HashSet();
2445         while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
2446         {
2447             checkUnknownElement( parser, strict );
2448         }
2449         return tagScanConfig;
2450     } //-- TagScanConfig parseTagScanConfig( XmlPullParser, boolean )
2451 
2452     /**
2453      * Method parseTrackedProperty.
2454      * 
2455      * @param parser a parser object.
2456      * @param strict a strict object.
2457      * @throws IOException IOException if any.
2458      * @throws XmlPullParserException XmlPullParserException if
2459      * any.
2460      * @return TrackedProperty
2461      */
2462     private TrackedProperty parseTrackedProperty( XmlPullParser parser, boolean strict )
2463         throws IOException, XmlPullParserException
2464     {
2465         String tagName = parser.getName();
2466         TrackedProperty trackedProperty = new TrackedProperty();
2467         for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
2468         {
2469             String name = parser.getAttributeName( i );
2470             String value = parser.getAttributeValue( i );
2471 
2472             if ( name.indexOf( ':' ) >= 0 )
2473             {
2474                 // just ignore attributes with non-default namespace (for example: xmlns:xsi)
2475             }
2476             else if ( "propertyName".equals( name ) )
2477             {
2478                 trackedProperty.setPropertyName( interpolatedTrimmed( value, "propertyName" ) );
2479             }
2480             else if ( "skipValue".equals( name ) )
2481             {
2482                 trackedProperty.setSkipValue( interpolatedTrimmed( value, "skipValue" ) );
2483             }
2484             else if ( "defaultValue".equals( name ) )
2485             {
2486                 trackedProperty.setDefaultValue( interpolatedTrimmed( value, "defaultValue" ) );
2487             }
2488             else
2489             {
2490                 checkUnknownAttribute( parser, name, tagName, strict );
2491             }
2492         }
2493         trackedProperty.setValue( interpolatedTrimmed( parser.nextText(), "value" ) );
2494         return trackedProperty;
2495     } //-- TrackedProperty parseTrackedProperty( XmlPullParser, boolean )
2496 
2497     /**
2498      * Sets the state of the "add default entities" flag.
2499      * 
2500      * @param addDefaultEntities a addDefaultEntities object.
2501      */
2502     public void setAddDefaultEntities( boolean addDefaultEntities )
2503     {
2504         this.addDefaultEntities = addDefaultEntities;
2505     } //-- void setAddDefaultEntities( boolean )
2506 
2507     public static interface ContentTransformer
2508 {
2509     /**
2510      * Interpolate the value read from the xpp3 document
2511      * @param source The source value
2512      * @param fieldName A description of the field being interpolated. The implementation may use this to
2513      *                           log stuff.
2514      * @return The interpolated value.
2515      */
2516     String transform( String source, String fieldName );
2517 }
2518 
2519 }