KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > bind > ValidationEventLocator


1 /*
2  * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
3  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4  */

5
6 package javax.xml.bind;
7
8 /**
9  * Encapsulate the location of a ValidationEvent.
10  *
11  * <p>
12  * The <tt>ValidationEventLocator</tt> indicates where the <tt>ValidationEvent
13  * </tt> occurred. Different fields will be set depending on the type of
14  * validation that was being performed when the error or warning was detected.
15  * For example, on-demand validation would produce locators that contained
16  * references to objects in the Java content tree while unmarshal-time
17  * validation would produce locators containing information appropriate to the
18  * source of the XML data (file, url, Node, etc).
19  *
20  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
21  * @version $Revision: 1.2 $
22  * @see Validator
23  * @see ValidationEvent
24  * @since JAXB1.0
25  */

26 public interface ValidationEventLocator {
27
28     /**
29      * Return the name of the XML source as a URL if available
30      *
31      * @return the name of the XML source as a URL or null if unavailable
32      */

33     public java.net.URL JavaDoc getURL();
34     
35     /**
36      * Return the byte offset if available
37      *
38      * @return the byte offset into the input source or -1 if unavailable
39      */

40     public int getOffset();
41     
42     /**
43      * Return the line number if available
44      *
45      * @return the line number or -1 if unavailable
46      */

47     public int getLineNumber();
48     
49     /**
50      * Return the column number if available
51      *
52      * @return the column number or -1 if unavailable
53      */

54     public int getColumnNumber();
55     
56     /**
57      * Return a reference to the object in the Java content tree if available
58      *
59      * @return a reference to the object in the Java content tree or null if
60      * unavailable
61      */

62     public java.lang.Object JavaDoc getObject();
63     
64     /**
65      * Return a reference to the DOM Node if available
66      *
67      * @return a reference to the DOM Node or null if unavailable
68      */

69     public org.w3c.dom.Node JavaDoc getNode();
70     
71 }
72
Popular Tags