001// =================== DO NOT EDIT THIS FILE ====================
002// Generated by Modello 1.8.1,
003// any modifications will be overwritten.
004// ==============================================================
005
006package org.apache.maven.plugin.lifecycle.io.xpp3;
007
008  //---------------------------------/
009 //- Imported classes and packages -/
010//---------------------------------/
011
012import java.io.IOException;
013import java.io.InputStream;
014import java.io.Reader;
015import java.text.DateFormat;
016import org.apache.maven.plugin.lifecycle.Execution;
017import org.apache.maven.plugin.lifecycle.Lifecycle;
018import org.apache.maven.plugin.lifecycle.LifecycleConfiguration;
019import org.apache.maven.plugin.lifecycle.Phase;
020import org.codehaus.plexus.util.ReaderFactory;
021import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
022import org.codehaus.plexus.util.xml.pull.MXParser;
023import org.codehaus.plexus.util.xml.pull.XmlPullParser;
024import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
025
026/**
027 * Class LifecycleMappingsXpp3Reader.
028 * 
029 * @version $Revision$ $Date$
030 */
031@SuppressWarnings( "all" )
032public class LifecycleMappingsXpp3Reader
033{
034
035      //--------------------------/
036     //- Class/Member Variables -/
037    //--------------------------/
038
039    /**
040     * If set the parser will be loaded with all single characters
041     * from the XHTML specification.
042     * The entities used:
043     * <ul>
044     * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</li>
045     * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li>
046     * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li>
047     * </ul>
048     */
049    private boolean addDefaultEntities = true;
050
051
052      //-----------/
053     //- Methods -/
054    //-----------/
055
056    /**
057     * Method checkFieldWithDuplicate.
058     * 
059     * @param parser
060     * @param parsed
061     * @param alias
062     * @param tagName
063     * @throws XmlPullParserException
064     * @return boolean
065     */
066    private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set parsed )
067        throws XmlPullParserException
068    {
069        if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
070        {
071            return false;
072        }
073        if ( !parsed.add( tagName ) )
074        {
075            throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
076        }
077        return true;
078    } //-- boolean checkFieldWithDuplicate( XmlPullParser, String, String, java.util.Set )
079
080    /**
081     * Method checkUnknownAttribute.
082     * 
083     * @param parser
084     * @param strict
085     * @param tagName
086     * @param attribute
087     * @throws XmlPullParserException
088     * @throws IOException
089     */
090    private void checkUnknownAttribute( XmlPullParser parser, String attribute, String tagName, boolean strict )
091        throws XmlPullParserException, IOException
092    {
093        // strictXmlAttributes = true for model: if strict == true, not only elements are checked but attributes too
094        if ( strict )
095        {
096            throw new XmlPullParserException( "Unknown attribute '" + attribute + "' for tag '" + tagName + "'", parser, null );
097        }
098    } //-- void checkUnknownAttribute( XmlPullParser, String, String, boolean )
099
100    /**
101     * Method checkUnknownElement.
102     * 
103     * @param parser
104     * @param strict
105     * @throws XmlPullParserException
106     * @throws IOException
107     */
108    private void checkUnknownElement( XmlPullParser parser, boolean strict )
109        throws XmlPullParserException, IOException
110    {
111        if ( strict )
112        {
113            throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
114        }
115
116        for ( int unrecognizedTagCount = 1; unrecognizedTagCount > 0; )
117        {
118            int eventType = parser.next();
119            if ( eventType == XmlPullParser.START_TAG )
120            {
121                unrecognizedTagCount++;
122            }
123            else if ( eventType == XmlPullParser.END_TAG )
124            {
125                unrecognizedTagCount--;
126            }
127        }
128    } //-- void checkUnknownElement( XmlPullParser, boolean )
129
130    /**
131     * Returns the state of the "add default entities" flag.
132     * 
133     * @return boolean
134     */
135    public boolean getAddDefaultEntities()
136    {
137        return addDefaultEntities;
138    } //-- boolean getAddDefaultEntities()
139
140    /**
141     * Method getBooleanValue.
142     * 
143     * @param s
144     * @param parser
145     * @param attribute
146     * @throws XmlPullParserException
147     * @return boolean
148     */
149    private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
150        throws XmlPullParserException
151    {
152        return getBooleanValue( s, attribute, parser, null );
153    } //-- boolean getBooleanValue( String, String, XmlPullParser )
154
155    /**
156     * Method getBooleanValue.
157     * 
158     * @param s
159     * @param defaultValue
160     * @param parser
161     * @param attribute
162     * @throws XmlPullParserException
163     * @return boolean
164     */
165    private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
166        throws XmlPullParserException
167    {
168        if ( s != null && s.length() != 0 )
169        {
170            return Boolean.valueOf( s ).booleanValue();
171        }
172        if ( defaultValue != null )
173        {
174            return Boolean.valueOf( defaultValue ).booleanValue();
175        }
176        return false;
177    } //-- boolean getBooleanValue( String, String, XmlPullParser, String )
178
179    /**
180     * Method getByteValue.
181     * 
182     * @param s
183     * @param strict
184     * @param parser
185     * @param attribute
186     * @throws XmlPullParserException
187     * @return byte
188     */
189    private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
190        throws XmlPullParserException
191    {
192        if ( s != null )
193        {
194            try
195            {
196                return Byte.valueOf( s ).byteValue();
197            }
198            catch ( NumberFormatException nfe )
199            {
200                if ( strict )
201                {
202                    throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, nfe );
203                }
204            }
205        }
206        return 0;
207    } //-- byte getByteValue( String, String, XmlPullParser, boolean )
208
209    /**
210     * Method getCharacterValue.
211     * 
212     * @param s
213     * @param parser
214     * @param attribute
215     * @throws XmlPullParserException
216     * @return char
217     */
218    private char getCharacterValue( String s, String attribute, XmlPullParser parser )
219        throws XmlPullParserException
220    {
221        if ( s != null )
222        {
223            return s.charAt( 0 );
224        }
225        return 0;
226    } //-- char getCharacterValue( String, String, XmlPullParser )
227
228    /**
229     * Method getDateValue.
230     * 
231     * @param s
232     * @param parser
233     * @param attribute
234     * @throws XmlPullParserException
235     * @return Date
236     */
237    private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser )
238        throws XmlPullParserException
239    {
240        return getDateValue( s, attribute, null, parser );
241    } //-- java.util.Date getDateValue( String, String, XmlPullParser )
242
243    /**
244     * Method getDateValue.
245     * 
246     * @param s
247     * @param parser
248     * @param dateFormat
249     * @param attribute
250     * @throws XmlPullParserException
251     * @return Date
252     */
253    private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
254        throws XmlPullParserException
255    {
256        if ( s != null )
257        {
258            String effectiveDateFormat = dateFormat;
259            if ( dateFormat == null )
260            {
261                effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
262            }
263            if ( "long".equals( effectiveDateFormat ) )
264            {
265                try
266                {
267                    return new java.util.Date( Long.parseLong( s ) );
268                }
269                catch ( NumberFormatException e )
270                {
271                    throw new XmlPullParserException( e.getMessage(), parser, e );
272                }
273            }
274            else
275            {
276                try
277                {
278                    DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, java.util.Locale.US );
279                    return dateParser.parse( s );
280                }
281                catch ( java.text.ParseException e )
282                {
283                    throw new XmlPullParserException( e.getMessage(), parser, e );
284                }
285            }
286        }
287        return null;
288    } //-- java.util.Date getDateValue( String, String, String, XmlPullParser )
289
290    /**
291     * Method getDoubleValue.
292     * 
293     * @param s
294     * @param strict
295     * @param parser
296     * @param attribute
297     * @throws XmlPullParserException
298     * @return double
299     */
300    private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
301        throws XmlPullParserException
302    {
303        if ( s != null )
304        {
305            try
306            {
307                return Double.valueOf( s ).doubleValue();
308            }
309            catch ( NumberFormatException nfe )
310            {
311                if ( strict )
312                {
313                    throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
314                }
315            }
316        }
317        return 0;
318    } //-- double getDoubleValue( String, String, XmlPullParser, boolean )
319
320    /**
321     * Method getFloatValue.
322     * 
323     * @param s
324     * @param strict
325     * @param parser
326     * @param attribute
327     * @throws XmlPullParserException
328     * @return float
329     */
330    private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
331        throws XmlPullParserException
332    {
333        if ( s != null )
334        {
335            try
336            {
337                return Float.valueOf( s ).floatValue();
338            }
339            catch ( NumberFormatException nfe )
340            {
341                if ( strict )
342                {
343                    throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, nfe );
344                }
345            }
346        }
347        return 0;
348    } //-- float getFloatValue( String, String, XmlPullParser, boolean )
349
350    /**
351     * Method getIntegerValue.
352     * 
353     * @param s
354     * @param strict
355     * @param parser
356     * @param attribute
357     * @throws XmlPullParserException
358     * @return int
359     */
360    private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
361        throws XmlPullParserException
362    {
363        if ( s != null )
364        {
365            try
366            {
367                return Integer.valueOf( s ).intValue();
368            }
369            catch ( NumberFormatException nfe )
370            {
371                if ( strict )
372                {
373                    throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, nfe );
374                }
375            }
376        }
377        return 0;
378    } //-- int getIntegerValue( String, String, XmlPullParser, boolean )
379
380    /**
381     * Method getLongValue.
382     * 
383     * @param s
384     * @param strict
385     * @param parser
386     * @param attribute
387     * @throws XmlPullParserException
388     * @return long
389     */
390    private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
391        throws XmlPullParserException
392    {
393        if ( s != null )
394        {
395            try
396            {
397                return Long.valueOf( s ).longValue();
398            }
399            catch ( NumberFormatException nfe )
400            {
401                if ( strict )
402                {
403                    throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, nfe );
404                }
405            }
406        }
407        return 0;
408    } //-- long getLongValue( String, String, XmlPullParser, boolean )
409
410    /**
411     * Method getRequiredAttributeValue.
412     * 
413     * @param s
414     * @param strict
415     * @param parser
416     * @param attribute
417     * @throws XmlPullParserException
418     * @return String
419     */
420    private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
421        throws XmlPullParserException
422    {
423        if ( s == null )
424        {
425            if ( strict )
426            {
427                throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
428            }
429        }
430        return s;
431    } //-- String getRequiredAttributeValue( String, String, XmlPullParser, boolean )
432
433    /**
434     * Method getShortValue.
435     * 
436     * @param s
437     * @param strict
438     * @param parser
439     * @param attribute
440     * @throws XmlPullParserException
441     * @return short
442     */
443    private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
444        throws XmlPullParserException
445    {
446        if ( s != null )
447        {
448            try
449            {
450                return Short.valueOf( s ).shortValue();
451            }
452            catch ( NumberFormatException nfe )
453            {
454                if ( strict )
455                {
456                    throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, nfe );
457                }
458            }
459        }
460        return 0;
461    } //-- short getShortValue( String, String, XmlPullParser, boolean )
462
463    /**
464     * Method getTrimmedValue.
465     * 
466     * @param s
467     * @return String
468     */
469    private String getTrimmedValue( String s )
470    {
471        if ( s != null )
472        {
473            s = s.trim();
474        }
475        return s;
476    } //-- String getTrimmedValue( String )
477
478    /**
479     * Method nextTag.
480     * 
481     * @param parser
482     * @throws IOException
483     * @throws XmlPullParserException
484     * @return int
485     */
486    private int nextTag( XmlPullParser parser )
487        throws IOException, XmlPullParserException
488    {
489        int eventType = parser.next();
490        if ( eventType == XmlPullParser.TEXT )
491        {
492            eventType = parser.next();
493        }
494        if ( eventType != XmlPullParser.START_TAG && eventType != XmlPullParser.END_TAG )
495        {
496            throw new XmlPullParserException( "expected START_TAG or END_TAG not " + XmlPullParser.TYPES[eventType], parser, null );
497        }
498        return eventType;
499    } //-- int nextTag( XmlPullParser )
500
501    /**
502     * @see ReaderFactory#newXmlReader
503     * 
504     * @param reader
505     * @param strict
506     * @throws IOException
507     * @throws XmlPullParserException
508     * @return LifecycleConfiguration
509     */
510    public LifecycleConfiguration read( Reader reader, boolean strict )
511        throws IOException, XmlPullParserException
512    {
513        XmlPullParser parser = addDefaultEntities ? new MXParser(EntityReplacementMap.defaultEntityReplacementMap) : new MXParser( );
514
515        parser.setInput( reader );
516
517
518        return read( parser, strict );
519    } //-- LifecycleConfiguration read( Reader, boolean )
520
521    /**
522     * @see ReaderFactory#newXmlReader
523     * 
524     * @param reader
525     * @throws IOException
526     * @throws XmlPullParserException
527     * @return LifecycleConfiguration
528     */
529    public LifecycleConfiguration read( Reader reader )
530        throws IOException, XmlPullParserException
531    {
532        return read( reader, true );
533    } //-- LifecycleConfiguration read( Reader )
534
535    /**
536     * Method read.
537     * 
538     * @param in
539     * @param strict
540     * @throws IOException
541     * @throws XmlPullParserException
542     * @return LifecycleConfiguration
543     */
544    public LifecycleConfiguration read( InputStream in, boolean strict )
545        throws IOException, XmlPullParserException
546    {
547        return read( ReaderFactory.newXmlReader( in ), strict );
548    } //-- LifecycleConfiguration read( InputStream, boolean )
549
550    /**
551     * Method read.
552     * 
553     * @param in
554     * @throws IOException
555     * @throws XmlPullParserException
556     * @return LifecycleConfiguration
557     */
558    public LifecycleConfiguration read( InputStream in )
559        throws IOException, XmlPullParserException
560    {
561        return read( ReaderFactory.newXmlReader( in ) );
562    } //-- LifecycleConfiguration read( InputStream )
563
564    /**
565     * Method parseExecution.
566     * 
567     * @param parser
568     * @param strict
569     * @throws IOException
570     * @throws XmlPullParserException
571     * @return Execution
572     */
573    private Execution parseExecution( XmlPullParser parser, boolean strict )
574        throws IOException, XmlPullParserException
575    {
576        String tagName = parser.getName();
577        Execution execution = new Execution();
578        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
579        {
580            String name = parser.getAttributeName( i );
581            String value = parser.getAttributeValue( i );
582
583            if ( name.indexOf( ':' ) >= 0 )
584            {
585                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
586            }
587            else
588            {
589                checkUnknownAttribute( parser, name, tagName, strict );
590            }
591        }
592        java.util.Set parsed = new java.util.HashSet();
593        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
594        {
595            if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
596            {
597                execution.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true ) );
598            }
599            else if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) )
600            {
601                java.util.List goals = new java.util.ArrayList/*<String>*/();
602                execution.setGoals( goals );
603                while ( parser.nextTag() == XmlPullParser.START_TAG )
604                {
605                    if ( "goal".equals( parser.getName() ) )
606                    {
607                        goals.add( getTrimmedValue( parser.nextText() ) );
608                    }
609                    else
610                    {
611                        checkUnknownElement( parser, strict );
612                    }
613                }
614            }
615            else
616            {
617                checkUnknownElement( parser, strict );
618            }
619        }
620        return execution;
621    } //-- Execution parseExecution( XmlPullParser, boolean )
622
623    /**
624     * Method parseLifecycle.
625     * 
626     * @param parser
627     * @param strict
628     * @throws IOException
629     * @throws XmlPullParserException
630     * @return Lifecycle
631     */
632    private Lifecycle parseLifecycle( XmlPullParser parser, boolean strict )
633        throws IOException, XmlPullParserException
634    {
635        String tagName = parser.getName();
636        Lifecycle lifecycle = new Lifecycle();
637        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
638        {
639            String name = parser.getAttributeName( i );
640            String value = parser.getAttributeValue( i );
641
642            if ( name.indexOf( ':' ) >= 0 )
643            {
644                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
645            }
646            else
647            {
648                checkUnknownAttribute( parser, name, tagName, strict );
649            }
650        }
651        java.util.Set parsed = new java.util.HashSet();
652        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
653        {
654            if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
655            {
656                lifecycle.setId( getTrimmedValue( parser.nextText() ) );
657            }
658            else if ( checkFieldWithDuplicate( parser, "phases", null, parsed ) )
659            {
660                java.util.List phases = new java.util.ArrayList/*<Phase>*/();
661                lifecycle.setPhases( phases );
662                while ( parser.nextTag() == XmlPullParser.START_TAG )
663                {
664                    if ( "phase".equals( parser.getName() ) )
665                    {
666                        phases.add( parsePhase( parser, strict ) );
667                    }
668                    else
669                    {
670                        checkUnknownElement( parser, strict );
671                    }
672                }
673            }
674            else
675            {
676                checkUnknownElement( parser, strict );
677            }
678        }
679        return lifecycle;
680    } //-- Lifecycle parseLifecycle( XmlPullParser, boolean )
681
682    /**
683     * Method parseLifecycleConfiguration.
684     * 
685     * @param parser
686     * @param strict
687     * @throws IOException
688     * @throws XmlPullParserException
689     * @return LifecycleConfiguration
690     */
691    private LifecycleConfiguration parseLifecycleConfiguration( XmlPullParser parser, boolean strict )
692        throws IOException, XmlPullParserException
693    {
694        String tagName = parser.getName();
695        LifecycleConfiguration lifecycleConfiguration = new LifecycleConfiguration();
696        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
697        {
698            String name = parser.getAttributeName( i );
699            String value = parser.getAttributeValue( i );
700
701            if ( name.indexOf( ':' ) >= 0 )
702            {
703                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
704            }
705            else if ( "xmlns".equals( name ) )
706            {
707                // ignore xmlns attribute in root class, which is a reserved attribute name
708            }
709            else
710            {
711                checkUnknownAttribute( parser, name, tagName, strict );
712            }
713        }
714        java.util.Set parsed = new java.util.HashSet();
715        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
716        {
717            if ( "lifecycle".equals( parser.getName() ) )
718            {
719                java.util.List lifecycles = lifecycleConfiguration.getLifecycles();
720                if ( lifecycles == null )
721                {
722                    lifecycles = new java.util.ArrayList/*<Lifecycle>*/();
723                    lifecycleConfiguration.setLifecycles( lifecycles );
724                }
725                lifecycles.add( parseLifecycle( parser, strict ) );
726            }
727            else
728            {
729                checkUnknownElement( parser, strict );
730            }
731        }
732        return lifecycleConfiguration;
733    } //-- LifecycleConfiguration parseLifecycleConfiguration( XmlPullParser, boolean )
734
735    /**
736     * Method parsePhase.
737     * 
738     * @param parser
739     * @param strict
740     * @throws IOException
741     * @throws XmlPullParserException
742     * @return Phase
743     */
744    private Phase parsePhase( XmlPullParser parser, boolean strict )
745        throws IOException, XmlPullParserException
746    {
747        String tagName = parser.getName();
748        Phase phase = new Phase();
749        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
750        {
751            String name = parser.getAttributeName( i );
752            String value = parser.getAttributeValue( i );
753
754            if ( name.indexOf( ':' ) >= 0 )
755            {
756                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
757            }
758            else
759            {
760                checkUnknownAttribute( parser, name, tagName, strict );
761            }
762        }
763        java.util.Set parsed = new java.util.HashSet();
764        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
765        {
766            if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
767            {
768                phase.setId( getTrimmedValue( parser.nextText() ) );
769            }
770            else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) )
771            {
772                java.util.List executions = new java.util.ArrayList/*<Execution>*/();
773                phase.setExecutions( executions );
774                while ( parser.nextTag() == XmlPullParser.START_TAG )
775                {
776                    if ( "execution".equals( parser.getName() ) )
777                    {
778                        executions.add( parseExecution( parser, strict ) );
779                    }
780                    else
781                    {
782                        checkUnknownElement( parser, strict );
783                    }
784                }
785            }
786            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
787            {
788                phase.setConfiguration( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true ) );
789            }
790            else
791            {
792                checkUnknownElement( parser, strict );
793            }
794        }
795        return phase;
796    } //-- Phase parsePhase( XmlPullParser, boolean )
797
798    /**
799     * Method read.
800     * 
801     * @param parser
802     * @param strict
803     * @throws IOException
804     * @throws XmlPullParserException
805     * @return LifecycleConfiguration
806     */
807    private LifecycleConfiguration read( XmlPullParser parser, boolean strict )
808        throws IOException, XmlPullParserException
809    {
810        int eventType = parser.getEventType();
811        while ( eventType != XmlPullParser.END_DOCUMENT )
812        {
813            if ( eventType == XmlPullParser.START_TAG )
814            {
815                if ( strict && ! "lifecycles".equals( parser.getName() ) )
816                {
817                    throw new XmlPullParserException( "Expected root element 'lifecycles' but found '" + parser.getName() + "'", parser, null );
818                }
819                LifecycleConfiguration lifecycleConfiguration = parseLifecycleConfiguration( parser, strict );
820                lifecycleConfiguration.setModelEncoding( parser.getInputEncoding() );
821                return lifecycleConfiguration;
822            }
823            eventType = parser.next();
824        }
825        throw new XmlPullParserException( "Expected root element 'lifecycles' but found no element at all: invalid XML document", parser, null );
826    } //-- LifecycleConfiguration read( XmlPullParser, boolean )
827
828    /**
829     * Sets the state of the "add default entities" flag.
830     * 
831     * @param addDefaultEntities
832     */
833    public void setAddDefaultEntities( boolean addDefaultEntities )
834    {
835        this.addDefaultEntities = addDefaultEntities;
836    } //-- void setAddDefaultEntities( boolean )
837
838}