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