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