KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > relaxng > datatype > DatatypeException


1 package org.relaxng.datatype;
2
3 /**
4  * Signals Datatype related exceptions.
5  *
6  * @author <a HREF="mailto:jjc@jclark.com">James Clark</a>
7  * @author <a HREF="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
8  */

9 public class DatatypeException extends Exception JavaDoc {
10     
11     public DatatypeException( int index, String JavaDoc msg ) {
12         super(msg);
13         this.index = index;
14     }
15     public DatatypeException( String JavaDoc msg ) {
16         this(UNKNOWN,msg);
17     }
18     /**
19      * A constructor for those datatype libraries which don't support any
20      * diagnostic information at all.
21      */

22     public DatatypeException() {
23         this(UNKNOWN,null);
24     }
25     
26     
27     private final int index;
28     
29     public static final int UNKNOWN = -1;
30
31     /**
32      * Gets the index of the content where the error occured.
33      * UNKNOWN can be returned to indicate that no index information
34      * is available.
35      */

36     public int getIndex() {
37         return index;
38     }
39 }
40
Popular Tags