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