Coverage Report - org.codehaus.plexus.util.xml.pull.XmlPullParserException
 
Classes in this File Line Coverage Branch Coverage Complexity
XmlPullParserException
0%
0/20
0%
0/10
1.833
 
 1  
 /* -*-             c-basic-offset: 4; indent-tabs-mode: nil; -*-  //------100-columns-wide------>|*/
 2  
 // for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)
 3  
 
 4  
 package org.codehaus.plexus.util.xml.pull;
 5  
 
 6  
 /**
 7  
  * This exception is thrown to signal XML Pull Parser related faults.
 8  
  *
 9  
  * @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
 10  
  */
 11  
 public class XmlPullParserException
 12  
     extends Exception
 13  
 {
 14  
     /**
 15  
      * @deprecated use generic getCause() method
 16  
      */
 17  
     protected Throwable detail;
 18  
 
 19  0
     protected int row = -1;
 20  
 
 21  0
     protected int column = -1;
 22  
 
 23  
     /*
 24  
      * public XmlPullParserException() { }
 25  
      */
 26  
 
 27  
     public XmlPullParserException( String s )
 28  
     {
 29  0
         super( s );
 30  0
     }
 31  
 
 32  
     /*
 33  
      * public XmlPullParserException(String s, Throwable throwable) { super(s); this.detail = throwable; } public
 34  
      * XmlPullParserException(String s, int row, int column) { super(s); this.row = row; this.column = column; }
 35  
      */
 36  
 
 37  
     public XmlPullParserException( String msg, XmlPullParser parser, Throwable chain )
 38  
     {
 39  0
         super( ( msg == null ? "" : msg + " " )
 40  
             + ( parser == null ? "" : "(position:" + parser.getPositionDescription() + ") " )
 41  
             + ( chain == null ? "" : "caused by: " + chain ), chain );
 42  
 
 43  0
         if ( parser != null )
 44  
         {
 45  0
             this.row = parser.getLineNumber();
 46  0
             this.column = parser.getColumnNumber();
 47  
         }
 48  0
         this.detail = chain;
 49  0
     }
 50  
 
 51  
     /**
 52  
      * @deprecated Use the generic <code>getCause()</code> method
 53  
      * @return
 54  
      */
 55  
     public Throwable getDetail()
 56  
     {
 57  0
         return getCause();
 58  
     }
 59  
 
 60  
     // public void setDetail(Throwable cause) { this.detail = cause; }
 61  
     public int getLineNumber()
 62  
     {
 63  0
         return row;
 64  
     }
 65  
 
 66  
     public int getColumnNumber()
 67  
     {
 68  0
         return column;
 69  
     }
 70  
 
 71  
     /*
 72  
      * public String getMessage() { if(detail == null) return super.getMessage(); else return super.getMessage() +
 73  
      * "; nested exception is: \n\t" + detail.getMessage(); }
 74  
      */
 75  
 
 76  
     // NOTE: code that prints this and detail is difficult in J2ME
 77  
     public void printStackTrace()
 78  
     {
 79  0
         if ( getCause() == null )
 80  
         {
 81  0
             super.printStackTrace();
 82  
         }
 83  
         else
 84  
         {
 85  0
             synchronized ( System.err )
 86  
             {
 87  0
                 System.err.println( super.getMessage() + "; nested exception is:" );
 88  0
                 getCause().printStackTrace();
 89  0
             }
 90  
         }
 91  0
     }
 92  
 
 93  
 }