View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.continuum.buildagent.model.io.xpp3;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
12  //---------------------------------/
13  
14  import java.io.IOException;
15  import java.io.InputStream;
16  import java.io.Reader;
17  import java.text.DateFormat;
18  import java.util.Locale;
19  import org.apache.continuum.buildagent.model.ContinuumBuildAgentConfigurationModel;
20  import org.apache.continuum.buildagent.model.Installation;
21  import org.apache.continuum.buildagent.model.LocalRepository;
22  import org.codehaus.plexus.util.ReaderFactory;
23  import org.codehaus.plexus.util.xml.pull.MXParser;
24  import org.codehaus.plexus.util.xml.pull.XmlPullParser;
25  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
26  
27  /**
28   * Class ContinuumBuildAgentConfigurationModelXpp3Reader.
29   * 
30   * @version $Revision$ $Date$
31   */
32  @SuppressWarnings( "all" )
33  public class ContinuumBuildAgentConfigurationModelXpp3Reader
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * If set the parser will be loaded with all single characters
42       * from the XHTML specification.
43       * The entities used:
44       * <ul>
45       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</li>
46       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li>
47       * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li>
48       * </ul>
49       */
50      private boolean addDefaultEntities = true;
51  
52  
53        //-----------/
54       //- Methods -/
55      //-----------/
56  
57      /**
58       * Method checkFieldWithDuplicate.
59       * 
60       * @param parser
61       * @param parsed
62       * @param alias
63       * @param tagName
64       * @throws XmlPullParserException
65       * @return boolean
66       */
67      private boolean checkFieldWithDuplicate( XmlPullParser parser, String tagName, String alias, java.util.Set parsed )
68          throws XmlPullParserException
69      {
70          if ( !( parser.getName().equals( tagName ) || parser.getName().equals( alias ) ) )
71          {
72              return false;
73          }
74          if ( parsed.contains( tagName ) )
75          {
76              throw new XmlPullParserException( "Duplicated tag: '" + tagName + "'", parser, null );
77          }
78          parsed.add( tagName );
79          return true;
80      } //-- boolean checkFieldWithDuplicate( XmlPullParser, String, String, java.util.Set )
81  
82      /**
83       * Returns the state of the "add default entities" flag.
84       * 
85       * @return boolean
86       */
87      public boolean getAddDefaultEntities()
88      {
89          return addDefaultEntities;
90      } //-- boolean getAddDefaultEntities()
91  
92      /**
93       * Method getBooleanValue.
94       * 
95       * @param s
96       * @param parser
97       * @param attribute
98       * @throws XmlPullParserException
99       * @return boolean
100      */
101     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser )
102         throws XmlPullParserException
103     {
104         return getBooleanValue( s, attribute, parser, null );
105     } //-- boolean getBooleanValue( String, String, XmlPullParser )
106 
107     /**
108      * Method getBooleanValue.
109      * 
110      * @param s
111      * @param defaultValue
112      * @param parser
113      * @param attribute
114      * @throws XmlPullParserException
115      * @return boolean
116      */
117     private boolean getBooleanValue( String s, String attribute, XmlPullParser parser, String defaultValue )
118         throws XmlPullParserException
119     {
120         if ( s != null && s.length() != 0 )
121         {
122             return Boolean.valueOf( s ).booleanValue();
123         }
124         if ( defaultValue != null )
125         {
126             return Boolean.valueOf( defaultValue ).booleanValue();
127         }
128         return false;
129     } //-- boolean getBooleanValue( String, String, XmlPullParser, String )
130 
131     /**
132      * Method getByteValue.
133      * 
134      * @param s
135      * @param strict
136      * @param parser
137      * @param attribute
138      * @throws XmlPullParserException
139      * @return byte
140      */
141     private byte getByteValue( String s, String attribute, XmlPullParser parser, boolean strict )
142         throws XmlPullParserException
143     {
144         if ( s != null )
145         {
146             try
147             {
148                 return Byte.valueOf( s ).byteValue();
149             }
150             catch ( NumberFormatException e )
151             {
152                 if ( strict )
153                 {
154                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a byte", parser, null );
155                 }
156             }
157         }
158         return 0;
159     } //-- byte getByteValue( String, String, XmlPullParser, boolean )
160 
161     /**
162      * Method getCharacterValue.
163      * 
164      * @param s
165      * @param parser
166      * @param attribute
167      * @throws XmlPullParserException
168      * @return char
169      */
170     private char getCharacterValue( String s, String attribute, XmlPullParser parser )
171         throws XmlPullParserException
172     {
173         if ( s != null )
174         {
175             return s.charAt( 0 );
176         }
177         return 0;
178     } //-- char getCharacterValue( String, String, XmlPullParser )
179 
180     /**
181      * Method getDateValue.
182      * 
183      * @param s
184      * @param parser
185      * @param attribute
186      * @throws XmlPullParserException
187      * @return Date
188      */
189     private java.util.Date getDateValue( String s, String attribute, XmlPullParser parser )
190         throws XmlPullParserException
191     {
192         return getDateValue( s, attribute, null, parser );
193     } //-- java.util.Date getDateValue( String, String, XmlPullParser )
194 
195     /**
196      * Method getDateValue.
197      * 
198      * @param s
199      * @param parser
200      * @param dateFormat
201      * @param attribute
202      * @throws XmlPullParserException
203      * @return Date
204      */
205     private java.util.Date getDateValue( String s, String attribute, String dateFormat, XmlPullParser parser )
206         throws XmlPullParserException
207     {
208         if ( s != null )
209         {
210             String effectiveDateFormat = dateFormat;
211             if ( dateFormat == null )
212             {
213                 effectiveDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";
214             }
215             if ( "long".equals( effectiveDateFormat ) )
216             {
217                 try
218                 {
219                     return new java.util.Date( Long.parseLong( s ) );
220                 }
221                 catch ( NumberFormatException e )
222                 {
223                     throw new XmlPullParserException( e.getMessage() );
224                 }
225             }
226             else
227             {
228                 try
229                 {
230                     DateFormat dateParser = new java.text.SimpleDateFormat( effectiveDateFormat, Locale.US );
231                     return dateParser.parse( s );
232                 }
233                 catch ( java.text.ParseException e )
234                 {
235                     throw new XmlPullParserException( e.getMessage() );
236                 }
237             }
238         }
239         return null;
240     } //-- java.util.Date getDateValue( String, String, String, XmlPullParser )
241 
242     /**
243      * Method getDoubleValue.
244      * 
245      * @param s
246      * @param strict
247      * @param parser
248      * @param attribute
249      * @throws XmlPullParserException
250      * @return double
251      */
252     private double getDoubleValue( String s, String attribute, XmlPullParser parser, boolean strict )
253         throws XmlPullParserException
254     {
255         if ( s != null )
256         {
257             try
258             {
259                 return Double.valueOf( s ).doubleValue();
260             }
261             catch ( NumberFormatException e )
262             {
263                 if ( strict )
264                 {
265                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, null );
266                 }
267             }
268         }
269         return 0;
270     } //-- double getDoubleValue( String, String, XmlPullParser, boolean )
271 
272     /**
273      * Method getFloatValue.
274      * 
275      * @param s
276      * @param strict
277      * @param parser
278      * @param attribute
279      * @throws XmlPullParserException
280      * @return float
281      */
282     private float getFloatValue( String s, String attribute, XmlPullParser parser, boolean strict )
283         throws XmlPullParserException
284     {
285         if ( s != null )
286         {
287             try
288             {
289                 return Float.valueOf( s ).floatValue();
290             }
291             catch ( NumberFormatException e )
292             {
293                 if ( strict )
294                 {
295                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a floating point number", parser, null );
296                 }
297             }
298         }
299         return 0;
300     } //-- float getFloatValue( String, String, XmlPullParser, boolean )
301 
302     /**
303      * Method getIntegerValue.
304      * 
305      * @param s
306      * @param strict
307      * @param parser
308      * @param attribute
309      * @throws XmlPullParserException
310      * @return int
311      */
312     private int getIntegerValue( String s, String attribute, XmlPullParser parser, boolean strict )
313         throws XmlPullParserException
314     {
315         if ( s != null )
316         {
317             try
318             {
319                 return Integer.valueOf( s ).intValue();
320             }
321             catch ( NumberFormatException e )
322             {
323                 if ( strict )
324                 {
325                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be an integer", parser, null );
326                 }
327             }
328         }
329         return 0;
330     } //-- int getIntegerValue( String, String, XmlPullParser, boolean )
331 
332     /**
333      * Method getLongValue.
334      * 
335      * @param s
336      * @param strict
337      * @param parser
338      * @param attribute
339      * @throws XmlPullParserException
340      * @return long
341      */
342     private long getLongValue( String s, String attribute, XmlPullParser parser, boolean strict )
343         throws XmlPullParserException
344     {
345         if ( s != null )
346         {
347             try
348             {
349                 return Long.valueOf( s ).longValue();
350             }
351             catch ( NumberFormatException e )
352             {
353                 if ( strict )
354                 {
355                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a long integer", parser, null );
356                 }
357             }
358         }
359         return 0;
360     } //-- long getLongValue( String, String, XmlPullParser, boolean )
361 
362     /**
363      * Method getRequiredAttributeValue.
364      * 
365      * @param s
366      * @param strict
367      * @param parser
368      * @param attribute
369      * @throws XmlPullParserException
370      * @return String
371      */
372     private String getRequiredAttributeValue( String s, String attribute, XmlPullParser parser, boolean strict )
373         throws XmlPullParserException
374     {
375         if ( s == null )
376         {
377             if ( strict )
378             {
379                 throw new XmlPullParserException( "Missing required value for attribute '" + attribute + "'", parser, null );
380             }
381         }
382         return s;
383     } //-- String getRequiredAttributeValue( String, String, XmlPullParser, boolean )
384 
385     /**
386      * Method getShortValue.
387      * 
388      * @param s
389      * @param strict
390      * @param parser
391      * @param attribute
392      * @throws XmlPullParserException
393      * @return short
394      */
395     private short getShortValue( String s, String attribute, XmlPullParser parser, boolean strict )
396         throws XmlPullParserException
397     {
398         if ( s != null )
399         {
400             try
401             {
402                 return Short.valueOf( s ).shortValue();
403             }
404             catch ( NumberFormatException e )
405             {
406                 if ( strict )
407                 {
408                     throw new XmlPullParserException( "Unable to parse element '" + attribute + "', must be a short integer", parser, null );
409                 }
410             }
411         }
412         return 0;
413     } //-- short getShortValue( String, String, XmlPullParser, boolean )
414 
415     /**
416      * Method getTrimmedValue.
417      * 
418      * @param s
419      * @return String
420      */
421     private String getTrimmedValue( String s )
422     {
423         if ( s != null )
424         {
425             s = s.trim();
426         }
427         return s;
428     } //-- String getTrimmedValue( String )
429 
430     /**
431      * Method parseContinuumBuildAgentConfigurationModel.
432      * 
433      * @param tagName
434      * @param strict
435      * @param parser
436      * @throws IOException
437      * @throws XmlPullParserException
438      * @return ContinuumBuildAgentConfigurationModel
439      */
440     private ContinuumBuildAgentConfigurationModel parseContinuumBuildAgentConfigurationModel( String tagName, XmlPullParser parser, boolean strict )
441         throws IOException, XmlPullParserException
442     {
443         ContinuumBuildAgentConfigurationModel continuumBuildAgentConfigurationModel = new ContinuumBuildAgentConfigurationModel();
444         java.util.Set parsed = new java.util.HashSet();
445         int eventType = parser.getEventType();
446         boolean foundRoot = false;
447         continuumBuildAgentConfigurationModel.setModelEncoding( parser.getInputEncoding() );
448         while ( eventType != XmlPullParser.END_DOCUMENT )
449         {
450             if ( eventType == XmlPullParser.START_TAG )
451             {
452                 if ( parser.getName().equals( tagName ) )
453                 {
454                     foundRoot = true;
455                 }
456                 else if ( strict && ! foundRoot )
457                 {
458                     throw new XmlPullParserException( "Expected root element '" + tagName + "' but found '" + parser.getName() + "'", parser, null );
459                 }
460                 else if ( checkFieldWithDuplicate( parser, "buildOutputDirectory", null, parsed ) )
461                 {
462                     continuumBuildAgentConfigurationModel.setBuildOutputDirectory( getTrimmedValue( parser.nextText() ) );
463                 }
464                 else if ( checkFieldWithDuplicate( parser, "workingDirectory", null, parsed ) )
465                 {
466                     continuumBuildAgentConfigurationModel.setWorkingDirectory( getTrimmedValue( parser.nextText() ) );
467                 }
468                 else if ( checkFieldWithDuplicate( parser, "continuumServerUrl", null, parsed ) )
469                 {
470                     continuumBuildAgentConfigurationModel.setContinuumServerUrl( getTrimmedValue( parser.nextText() ) );
471                 }
472                 else if ( checkFieldWithDuplicate( parser, "installations", null, parsed ) )
473                 {
474                     java.util.List installations = new java.util.ArrayList/*<Installation>*/();
475                     continuumBuildAgentConfigurationModel.setInstallations( installations );
476                     while ( parser.nextTag() == XmlPullParser.START_TAG )
477                     {
478                         if ( parser.getName().equals( "installation" ) )
479                         {
480                             installations.add( parseInstallation( "installation", parser, strict ) );
481                         }
482                         else if ( strict )
483                         {
484                             throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
485                         }
486                         else
487                         {
488                             // swallow up to end tag since this is not valid
489                             while ( parser.next() != XmlPullParser.END_TAG ) {}
490                         }
491                     }
492                 }
493                 else if ( checkFieldWithDuplicate( parser, "localRepositories", null, parsed ) )
494                 {
495                     java.util.List localRepositories = new java.util.ArrayList/*<LocalRepository>*/();
496                     continuumBuildAgentConfigurationModel.setLocalRepositories( localRepositories );
497                     while ( parser.nextTag() == XmlPullParser.START_TAG )
498                     {
499                         if ( parser.getName().equals( "localRepository" ) )
500                         {
501                             localRepositories.add( parseLocalRepository( "localRepository", parser, strict ) );
502                         }
503                         else if ( strict )
504                         {
505                             throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
506                         }
507                         else
508                         {
509                             // swallow up to end tag since this is not valid
510                             while ( parser.next() != XmlPullParser.END_TAG ) {}
511                         }
512                     }
513                 }
514                 else if ( checkFieldWithDuplicate( parser, "sharedSecretPassword", null, parsed ) )
515                 {
516                     continuumBuildAgentConfigurationModel.setSharedSecretPassword( getTrimmedValue( parser.nextText() ) );
517                 }
518                 else if ( strict )
519                 {
520                     throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
521                 }
522             }
523             eventType = parser.next();
524         }
525         return continuumBuildAgentConfigurationModel;
526     } //-- ContinuumBuildAgentConfigurationModel parseContinuumBuildAgentConfigurationModel( String, XmlPullParser, boolean )
527 
528     /**
529      * Method parseInstallation.
530      * 
531      * @param tagName
532      * @param strict
533      * @param parser
534      * @throws IOException
535      * @throws XmlPullParserException
536      * @return Installation
537      */
538     private Installation parseInstallation( String tagName, XmlPullParser parser, boolean strict )
539         throws IOException, XmlPullParserException
540     {
541         Installation installation = new Installation();
542         java.util.Set parsed = new java.util.HashSet();
543         while ( parser.nextTag() == XmlPullParser.START_TAG )
544         {
545             if ( checkFieldWithDuplicate( parser, "type", null, parsed ) )
546             {
547                 installation.setType( getTrimmedValue( parser.nextText() ) );
548             }
549             else if ( checkFieldWithDuplicate( parser, "varValue", null, parsed ) )
550             {
551                 installation.setVarValue( getTrimmedValue( parser.nextText() ) );
552             }
553             else if ( checkFieldWithDuplicate( parser, "varName", null, parsed ) )
554             {
555                 installation.setVarName( getTrimmedValue( parser.nextText() ) );
556             }
557             else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
558             {
559                 installation.setName( getTrimmedValue( parser.nextText() ) );
560             }
561             else
562             {
563                 if ( strict )
564                 {
565                     throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
566                 }
567                 else
568                 {
569                     // swallow up to end tag since this is not valid
570                     while ( parser.next() != XmlPullParser.END_TAG ) {}
571                 }
572             }
573         }
574         return installation;
575     } //-- Installation parseInstallation( String, XmlPullParser, boolean )
576 
577     /**
578      * Method parseLocalRepository.
579      * 
580      * @param tagName
581      * @param strict
582      * @param parser
583      * @throws IOException
584      * @throws XmlPullParserException
585      * @return LocalRepository
586      */
587     private LocalRepository parseLocalRepository( String tagName, XmlPullParser parser, boolean strict )
588         throws IOException, XmlPullParserException
589     {
590         LocalRepository localRepository = new LocalRepository();
591         java.util.Set parsed = new java.util.HashSet();
592         while ( parser.nextTag() == XmlPullParser.START_TAG )
593         {
594             if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
595             {
596                 localRepository.setName( getTrimmedValue( parser.nextText() ) );
597             }
598             else if ( checkFieldWithDuplicate( parser, "location", null, parsed ) )
599             {
600                 localRepository.setLocation( getTrimmedValue( parser.nextText() ) );
601             }
602             else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
603             {
604                 localRepository.setLayout( getTrimmedValue( parser.nextText() ) );
605             }
606             else
607             {
608                 if ( strict )
609                 {
610                     throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
611                 }
612                 else
613                 {
614                     // swallow up to end tag since this is not valid
615                     while ( parser.next() != XmlPullParser.END_TAG ) {}
616                 }
617             }
618         }
619         return localRepository;
620     } //-- LocalRepository parseLocalRepository( String, XmlPullParser, boolean )
621 
622     /**
623      * @see ReaderFactory#newXmlReader
624      * 
625      * @param reader
626      * @param strict
627      * @throws IOException
628      * @throws XmlPullParserException
629      * @return ContinuumBuildAgentConfigurationModel
630      */
631     public ContinuumBuildAgentConfigurationModel read( Reader reader, boolean strict )
632         throws IOException, XmlPullParserException
633     {
634         XmlPullParser parser = new MXParser();
635 
636         parser.setInput( reader );
637 
638         if ( addDefaultEntities )
639         {
640             // ----------------------------------------------------------------------
641             // Latin 1 entities
642             // ----------------------------------------------------------------------
643 
644             parser.defineEntityReplacementText( "nbsp", "\u00a0" );
645             parser.defineEntityReplacementText( "iexcl", "\u00a1" );
646             parser.defineEntityReplacementText( "cent", "\u00a2" );
647             parser.defineEntityReplacementText( "pound", "\u00a3" );
648             parser.defineEntityReplacementText( "curren", "\u00a4" );
649             parser.defineEntityReplacementText( "yen", "\u00a5" );
650             parser.defineEntityReplacementText( "brvbar", "\u00a6" );
651             parser.defineEntityReplacementText( "sect", "\u00a7" );
652             parser.defineEntityReplacementText( "uml", "\u00a8" );
653             parser.defineEntityReplacementText( "copy", "\u00a9" );
654             parser.defineEntityReplacementText( "ordf", "\u00aa" );
655             parser.defineEntityReplacementText( "laquo", "\u00ab" );
656             parser.defineEntityReplacementText( "not", "\u00ac" );
657             parser.defineEntityReplacementText( "shy", "\u00ad" );
658             parser.defineEntityReplacementText( "reg", "\u00ae" );
659             parser.defineEntityReplacementText( "macr", "\u00af" );
660             parser.defineEntityReplacementText( "deg", "\u00b0" );
661             parser.defineEntityReplacementText( "plusmn", "\u00b1" );
662             parser.defineEntityReplacementText( "sup2", "\u00b2" );
663             parser.defineEntityReplacementText( "sup3", "\u00b3" );
664             parser.defineEntityReplacementText( "acute", "\u00b4" );
665             parser.defineEntityReplacementText( "micro", "\u00b5" );
666             parser.defineEntityReplacementText( "para", "\u00b6" );
667             parser.defineEntityReplacementText( "middot", "\u00b7" );
668             parser.defineEntityReplacementText( "cedil", "\u00b8" );
669             parser.defineEntityReplacementText( "sup1", "\u00b9" );
670             parser.defineEntityReplacementText( "ordm", "\u00ba" );
671             parser.defineEntityReplacementText( "raquo", "\u00bb" );
672             parser.defineEntityReplacementText( "frac14", "\u00bc" );
673             parser.defineEntityReplacementText( "frac12", "\u00bd" );
674             parser.defineEntityReplacementText( "frac34", "\u00be" );
675             parser.defineEntityReplacementText( "iquest", "\u00bf" );
676             parser.defineEntityReplacementText( "Agrave", "\u00c0" );
677             parser.defineEntityReplacementText( "Aacute", "\u00c1" );
678             parser.defineEntityReplacementText( "Acirc", "\u00c2" );
679             parser.defineEntityReplacementText( "Atilde", "\u00c3" );
680             parser.defineEntityReplacementText( "Auml", "\u00c4" );
681             parser.defineEntityReplacementText( "Aring", "\u00c5" );
682             parser.defineEntityReplacementText( "AElig", "\u00c6" );
683             parser.defineEntityReplacementText( "Ccedil", "\u00c7" );
684             parser.defineEntityReplacementText( "Egrave", "\u00c8" );
685             parser.defineEntityReplacementText( "Eacute", "\u00c9" );
686             parser.defineEntityReplacementText( "Ecirc", "\u00ca" );
687             parser.defineEntityReplacementText( "Euml", "\u00cb" );
688             parser.defineEntityReplacementText( "Igrave", "\u00cc" );
689             parser.defineEntityReplacementText( "Iacute", "\u00cd" );
690             parser.defineEntityReplacementText( "Icirc", "\u00ce" );
691             parser.defineEntityReplacementText( "Iuml", "\u00cf" );
692             parser.defineEntityReplacementText( "ETH", "\u00d0" );
693             parser.defineEntityReplacementText( "Ntilde", "\u00d1" );
694             parser.defineEntityReplacementText( "Ograve", "\u00d2" );
695             parser.defineEntityReplacementText( "Oacute", "\u00d3" );
696             parser.defineEntityReplacementText( "Ocirc", "\u00d4" );
697             parser.defineEntityReplacementText( "Otilde", "\u00d5" );
698             parser.defineEntityReplacementText( "Ouml", "\u00d6" );
699             parser.defineEntityReplacementText( "times", "\u00d7" );
700             parser.defineEntityReplacementText( "Oslash", "\u00d8" );
701             parser.defineEntityReplacementText( "Ugrave", "\u00d9" );
702             parser.defineEntityReplacementText( "Uacute", "\u00da" );
703             parser.defineEntityReplacementText( "Ucirc", "\u00db" );
704             parser.defineEntityReplacementText( "Uuml", "\u00dc" );
705             parser.defineEntityReplacementText( "Yacute", "\u00dd" );
706             parser.defineEntityReplacementText( "THORN", "\u00de" );
707             parser.defineEntityReplacementText( "szlig", "\u00df" );
708             parser.defineEntityReplacementText( "agrave", "\u00e0" );
709             parser.defineEntityReplacementText( "aacute", "\u00e1" );
710             parser.defineEntityReplacementText( "acirc", "\u00e2" );
711             parser.defineEntityReplacementText( "atilde", "\u00e3" );
712             parser.defineEntityReplacementText( "auml", "\u00e4" );
713             parser.defineEntityReplacementText( "aring", "\u00e5" );
714             parser.defineEntityReplacementText( "aelig", "\u00e6" );
715             parser.defineEntityReplacementText( "ccedil", "\u00e7" );
716             parser.defineEntityReplacementText( "egrave", "\u00e8" );
717             parser.defineEntityReplacementText( "eacute", "\u00e9" );
718             parser.defineEntityReplacementText( "ecirc", "\u00ea" );
719             parser.defineEntityReplacementText( "euml", "\u00eb" );
720             parser.defineEntityReplacementText( "igrave", "\u00ec" );
721             parser.defineEntityReplacementText( "iacute", "\u00ed" );
722             parser.defineEntityReplacementText( "icirc", "\u00ee" );
723             parser.defineEntityReplacementText( "iuml", "\u00ef" );
724             parser.defineEntityReplacementText( "eth", "\u00f0" );
725             parser.defineEntityReplacementText( "ntilde", "\u00f1" );
726             parser.defineEntityReplacementText( "ograve", "\u00f2" );
727             parser.defineEntityReplacementText( "oacute", "\u00f3" );
728             parser.defineEntityReplacementText( "ocirc", "\u00f4" );
729             parser.defineEntityReplacementText( "otilde", "\u00f5" );
730             parser.defineEntityReplacementText( "ouml", "\u00f6" );
731             parser.defineEntityReplacementText( "divide", "\u00f7" );
732             parser.defineEntityReplacementText( "oslash", "\u00f8" );
733             parser.defineEntityReplacementText( "ugrave", "\u00f9" );
734             parser.defineEntityReplacementText( "uacute", "\u00fa" );
735             parser.defineEntityReplacementText( "ucirc", "\u00fb" );
736             parser.defineEntityReplacementText( "uuml", "\u00fc" );
737             parser.defineEntityReplacementText( "yacute", "\u00fd" );
738             parser.defineEntityReplacementText( "thorn", "\u00fe" );
739             parser.defineEntityReplacementText( "yuml", "\u00ff" );
740 
741             // ----------------------------------------------------------------------
742             // Special entities
743             // ----------------------------------------------------------------------
744 
745             parser.defineEntityReplacementText( "OElig", "\u0152" );
746             parser.defineEntityReplacementText( "oelig", "\u0153" );
747             parser.defineEntityReplacementText( "Scaron", "\u0160" );
748             parser.defineEntityReplacementText( "scaron", "\u0161" );
749             parser.defineEntityReplacementText( "Yuml", "\u0178" );
750             parser.defineEntityReplacementText( "circ", "\u02c6" );
751             parser.defineEntityReplacementText( "tilde", "\u02dc" );
752             parser.defineEntityReplacementText( "ensp", "\u2002" );
753             parser.defineEntityReplacementText( "emsp", "\u2003" );
754             parser.defineEntityReplacementText( "thinsp", "\u2009" );
755             parser.defineEntityReplacementText( "zwnj", "\u200c" );
756             parser.defineEntityReplacementText( "zwj", "\u200d" );
757             parser.defineEntityReplacementText( "lrm", "\u200e" );
758             parser.defineEntityReplacementText( "rlm", "\u200f" );
759             parser.defineEntityReplacementText( "ndash", "\u2013" );
760             parser.defineEntityReplacementText( "mdash", "\u2014" );
761             parser.defineEntityReplacementText( "lsquo", "\u2018" );
762             parser.defineEntityReplacementText( "rsquo", "\u2019" );
763             parser.defineEntityReplacementText( "sbquo", "\u201a" );
764             parser.defineEntityReplacementText( "ldquo", "\u201c" );
765             parser.defineEntityReplacementText( "rdquo", "\u201d" );
766             parser.defineEntityReplacementText( "bdquo", "\u201e" );
767             parser.defineEntityReplacementText( "dagger", "\u2020" );
768             parser.defineEntityReplacementText( "Dagger", "\u2021" );
769             parser.defineEntityReplacementText( "permil", "\u2030" );
770             parser.defineEntityReplacementText( "lsaquo", "\u2039" );
771             parser.defineEntityReplacementText( "rsaquo", "\u203a" );
772             parser.defineEntityReplacementText( "euro", "\u20ac" );
773 
774             // ----------------------------------------------------------------------
775             // Symbol entities
776             // ----------------------------------------------------------------------
777 
778             parser.defineEntityReplacementText( "fnof", "\u0192" );
779             parser.defineEntityReplacementText( "Alpha", "\u0391" );
780             parser.defineEntityReplacementText( "Beta", "\u0392" );
781             parser.defineEntityReplacementText( "Gamma", "\u0393" );
782             parser.defineEntityReplacementText( "Delta", "\u0394" );
783             parser.defineEntityReplacementText( "Epsilon", "\u0395" );
784             parser.defineEntityReplacementText( "Zeta", "\u0396" );
785             parser.defineEntityReplacementText( "Eta", "\u0397" );
786             parser.defineEntityReplacementText( "Theta", "\u0398" );
787             parser.defineEntityReplacementText( "Iota", "\u0399" );
788             parser.defineEntityReplacementText( "Kappa", "\u039a" );
789             parser.defineEntityReplacementText( "Lambda", "\u039b" );
790             parser.defineEntityReplacementText( "Mu", "\u039c" );
791             parser.defineEntityReplacementText( "Nu", "\u039d" );
792             parser.defineEntityReplacementText( "Xi", "\u039e" );
793             parser.defineEntityReplacementText( "Omicron", "\u039f" );
794             parser.defineEntityReplacementText( "Pi", "\u03a0" );
795             parser.defineEntityReplacementText( "Rho", "\u03a1" );
796             parser.defineEntityReplacementText( "Sigma", "\u03a3" );
797             parser.defineEntityReplacementText( "Tau", "\u03a4" );
798             parser.defineEntityReplacementText( "Upsilon", "\u03a5" );
799             parser.defineEntityReplacementText( "Phi", "\u03a6" );
800             parser.defineEntityReplacementText( "Chi", "\u03a7" );
801             parser.defineEntityReplacementText( "Psi", "\u03a8" );
802             parser.defineEntityReplacementText( "Omega", "\u03a9" );
803             parser.defineEntityReplacementText( "alpha", "\u03b1" );
804             parser.defineEntityReplacementText( "beta", "\u03b2" );
805             parser.defineEntityReplacementText( "gamma", "\u03b3" );
806             parser.defineEntityReplacementText( "delta", "\u03b4" );
807             parser.defineEntityReplacementText( "epsilon", "\u03b5" );
808             parser.defineEntityReplacementText( "zeta", "\u03b6" );
809             parser.defineEntityReplacementText( "eta", "\u03b7" );
810             parser.defineEntityReplacementText( "theta", "\u03b8" );
811             parser.defineEntityReplacementText( "iota", "\u03b9" );
812             parser.defineEntityReplacementText( "kappa", "\u03ba" );
813             parser.defineEntityReplacementText( "lambda", "\u03bb" );
814             parser.defineEntityReplacementText( "mu", "\u03bc" );
815             parser.defineEntityReplacementText( "nu", "\u03bd" );
816             parser.defineEntityReplacementText( "xi", "\u03be" );
817             parser.defineEntityReplacementText( "omicron", "\u03bf" );
818             parser.defineEntityReplacementText( "pi", "\u03c0" );
819             parser.defineEntityReplacementText( "rho", "\u03c1" );
820             parser.defineEntityReplacementText( "sigmaf", "\u03c2" );
821             parser.defineEntityReplacementText( "sigma", "\u03c3" );
822             parser.defineEntityReplacementText( "tau", "\u03c4" );
823             parser.defineEntityReplacementText( "upsilon", "\u03c5" );
824             parser.defineEntityReplacementText( "phi", "\u03c6" );
825             parser.defineEntityReplacementText( "chi", "\u03c7" );
826             parser.defineEntityReplacementText( "psi", "\u03c8" );
827             parser.defineEntityReplacementText( "omega", "\u03c9" );
828             parser.defineEntityReplacementText( "thetasym", "\u03d1" );
829             parser.defineEntityReplacementText( "upsih", "\u03d2" );
830             parser.defineEntityReplacementText( "piv", "\u03d6" );
831             parser.defineEntityReplacementText( "bull", "\u2022" );
832             parser.defineEntityReplacementText( "hellip", "\u2026" );
833             parser.defineEntityReplacementText( "prime", "\u2032" );
834             parser.defineEntityReplacementText( "Prime", "\u2033" );
835             parser.defineEntityReplacementText( "oline", "\u203e" );
836             parser.defineEntityReplacementText( "frasl", "\u2044" );
837             parser.defineEntityReplacementText( "weierp", "\u2118" );
838             parser.defineEntityReplacementText( "image", "\u2111" );
839             parser.defineEntityReplacementText( "real", "\u211c" );
840             parser.defineEntityReplacementText( "trade", "\u2122" );
841             parser.defineEntityReplacementText( "alefsym", "\u2135" );
842             parser.defineEntityReplacementText( "larr", "\u2190" );
843             parser.defineEntityReplacementText( "uarr", "\u2191" );
844             parser.defineEntityReplacementText( "rarr", "\u2192" );
845             parser.defineEntityReplacementText( "darr", "\u2193" );
846             parser.defineEntityReplacementText( "harr", "\u2194" );
847             parser.defineEntityReplacementText( "crarr", "\u21b5" );
848             parser.defineEntityReplacementText( "lArr", "\u21d0" );
849             parser.defineEntityReplacementText( "uArr", "\u21d1" );
850             parser.defineEntityReplacementText( "rArr", "\u21d2" );
851             parser.defineEntityReplacementText( "dArr", "\u21d3" );
852             parser.defineEntityReplacementText( "hArr", "\u21d4" );
853             parser.defineEntityReplacementText( "forall", "\u2200" );
854             parser.defineEntityReplacementText( "part", "\u2202" );
855             parser.defineEntityReplacementText( "exist", "\u2203" );
856             parser.defineEntityReplacementText( "empty", "\u2205" );
857             parser.defineEntityReplacementText( "nabla", "\u2207" );
858             parser.defineEntityReplacementText( "isin", "\u2208" );
859             parser.defineEntityReplacementText( "notin", "\u2209" );
860             parser.defineEntityReplacementText( "ni", "\u220b" );
861             parser.defineEntityReplacementText( "prod", "\u220f" );
862             parser.defineEntityReplacementText( "sum", "\u2211" );
863             parser.defineEntityReplacementText( "minus", "\u2212" );
864             parser.defineEntityReplacementText( "lowast", "\u2217" );
865             parser.defineEntityReplacementText( "radic", "\u221a" );
866             parser.defineEntityReplacementText( "prop", "\u221d" );
867             parser.defineEntityReplacementText( "infin", "\u221e" );
868             parser.defineEntityReplacementText( "ang", "\u2220" );
869             parser.defineEntityReplacementText( "and", "\u2227" );
870             parser.defineEntityReplacementText( "or", "\u2228" );
871             parser.defineEntityReplacementText( "cap", "\u2229" );
872             parser.defineEntityReplacementText( "cup", "\u222a" );
873             parser.defineEntityReplacementText( "int", "\u222b" );
874             parser.defineEntityReplacementText( "there4", "\u2234" );
875             parser.defineEntityReplacementText( "sim", "\u223c" );
876             parser.defineEntityReplacementText( "cong", "\u2245" );
877             parser.defineEntityReplacementText( "asymp", "\u2248" );
878             parser.defineEntityReplacementText( "ne", "\u2260" );
879             parser.defineEntityReplacementText( "equiv", "\u2261" );
880             parser.defineEntityReplacementText( "le", "\u2264" );
881             parser.defineEntityReplacementText( "ge", "\u2265" );
882             parser.defineEntityReplacementText( "sub", "\u2282" );
883             parser.defineEntityReplacementText( "sup", "\u2283" );
884             parser.defineEntityReplacementText( "nsub", "\u2284" );
885             parser.defineEntityReplacementText( "sube", "\u2286" );
886             parser.defineEntityReplacementText( "supe", "\u2287" );
887             parser.defineEntityReplacementText( "oplus", "\u2295" );
888             parser.defineEntityReplacementText( "otimes", "\u2297" );
889             parser.defineEntityReplacementText( "perp", "\u22a5" );
890             parser.defineEntityReplacementText( "sdot", "\u22c5" );
891             parser.defineEntityReplacementText( "lceil", "\u2308" );
892             parser.defineEntityReplacementText( "rceil", "\u2309" );
893             parser.defineEntityReplacementText( "lfloor", "\u230a" );
894             parser.defineEntityReplacementText( "rfloor", "\u230b" );
895             parser.defineEntityReplacementText( "lang", "\u2329" );
896             parser.defineEntityReplacementText( "rang", "\u232a" );
897             parser.defineEntityReplacementText( "loz", "\u25ca" );
898             parser.defineEntityReplacementText( "spades", "\u2660" );
899             parser.defineEntityReplacementText( "clubs", "\u2663" );
900             parser.defineEntityReplacementText( "hearts", "\u2665" );
901             parser.defineEntityReplacementText( "diams", "\u2666" );
902 
903         }
904 
905         parser.next();
906         return parseContinuumBuildAgentConfigurationModel( "continuum-buildagent-configuration", parser, strict );
907     } //-- ContinuumBuildAgentConfigurationModel read( Reader, boolean )
908 
909     /**
910      * @see ReaderFactory#newXmlReader
911      * 
912      * @param reader
913      * @throws IOException
914      * @throws XmlPullParserException
915      * @return ContinuumBuildAgentConfigurationModel
916      */
917     public ContinuumBuildAgentConfigurationModel read( Reader reader )
918         throws IOException, XmlPullParserException
919     {
920         return read( reader, true );
921     } //-- ContinuumBuildAgentConfigurationModel read( Reader )
922 
923     /**
924      * Method read.
925      * 
926      * @param in
927      * @param strict
928      * @throws IOException
929      * @throws XmlPullParserException
930      * @return ContinuumBuildAgentConfigurationModel
931      */
932     public ContinuumBuildAgentConfigurationModel read( InputStream in, boolean strict )
933         throws IOException, XmlPullParserException
934     {
935         Reader reader = ReaderFactory.newXmlReader( in );
936 
937         return read( reader, strict );
938     } //-- ContinuumBuildAgentConfigurationModel read( InputStream, boolean )
939 
940     /**
941      * Method read.
942      * 
943      * @param in
944      * @throws IOException
945      * @throws XmlPullParserException
946      * @return ContinuumBuildAgentConfigurationModel
947      */
948     public ContinuumBuildAgentConfigurationModel read( InputStream in )
949         throws IOException, XmlPullParserException
950     {
951         Reader reader = ReaderFactory.newXmlReader( in );
952 
953         return read( reader );
954     } //-- ContinuumBuildAgentConfigurationModel read( InputStream )
955 
956     /**
957      * Sets the state of the "add default entities" flag.
958      * 
959      * @param addDefaultEntities
960      */
961     public void setAddDefaultEntities( boolean addDefaultEntities )
962     {
963         this.addDefaultEntities = addDefaultEntities;
964     } //-- void setAddDefaultEntities( boolean )
965 
966 }