1
2
3
4
5
6
7
8
9
10
11 public class XmlPullParserException
12 extends Exception
13 {
14
15
16
17 @Deprecated
18 protected Throwable detail;
19
20 protected int row = -1;
21
22 protected int column = -1;
23
24
25
26
27
28 public XmlPullParserException( String s )
29 {
30 super( s );
31 }
32
33
34
35
36
37
38 public XmlPullParserException( String msg, XmlPullParser parser, Throwable chain )
39 {
40 super( ( msg == null ? "" : msg + " " )
41 + ( parser == null ? "" : "(position:" + parser.getPositionDescription() + ") " )
42 + ( chain == null ? "" : "caused by: " + chain ), chain );
43
44 if ( parser != null )
45 {
46 this.row = parser.getLineNumber();
47 this.column = parser.getColumnNumber();
48 }
49 this.detail = chain;
50 }
51
52
53
54
55
56 @Deprecated
57 public Throwable getDetail()
58 {
59 return getCause();
60 }
61
62
63 public int getLineNumber()
64 {
65 return row;
66 }
67
68 public int getColumnNumber()
69 {
70 return column;
71 }
72
73
74
75
76
77
78
79 @Override
80 public void printStackTrace()
81 {
82 if ( getCause() == null )
83 {
84 super.printStackTrace();
85 }
86 else
87 {
88 synchronized ( System.err )
89 {
90 System.err.println( super.getMessage() + "; nested exception is:" );
91 getCause().printStackTrace();
92 }
93 }
94 }
95
96 }