OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / lib / classpath / external / relaxngDatatype / org / relaxng / datatype / DatatypeException.java
1 package org.relaxng.datatype;\r
2 \r
3 /**\r
4  * Signals Datatype related exceptions.\r
5  * \r
6  * @author <a href="mailto:jjc@jclark.com">James Clark</a>\r
7  * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>\r
8  */\r
9 public class DatatypeException extends Exception {\r
10         \r
11         public DatatypeException( int index, String msg ) {\r
12                 super(msg);\r
13                 this.index = index;\r
14         }\r
15         public DatatypeException( String msg ) {\r
16                 this(UNKNOWN,msg);\r
17         }\r
18         /**\r
19          * A constructor for those datatype libraries which don't support any\r
20          * diagnostic information at all.\r
21          */\r
22         public DatatypeException() {\r
23                 this(UNKNOWN,null);\r
24         }\r
25         \r
26         \r
27         private final int index;\r
28         \r
29         public static final int UNKNOWN = -1;\r
30 \r
31         /**\r
32          * Gets the index of the content where the error occured.\r
33          * UNKNOWN can be returned to indicate that no index information\r
34          * is available.\r
35          */\r
36         public int getIndex() {\r
37                 return index;\r
38         }\r
39 }\r