KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > transform > SourceLocator


1 /*
2  * @(#)SourceLocator.java 1.12 04/07/26
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.xml.transform;
8
9 /**
10  * This interface is primarily for the purposes of reporting where
11  * an error occurred in the XML source or transformation instructions.
12  */

13 public interface SourceLocator {
14
15     /**
16      * Return the public identifier for the current document event.
17      *
18      * <p>The return value is the public identifier of the document
19      * entity or of the external parsed entity in which the markup that
20      * triggered the event appears.</p>
21      *
22      * @return A string containing the public identifier, or
23      * null if none is available.
24      * @see #getSystemId
25      */

26     public String JavaDoc getPublicId();
27
28     /**
29      * Return the system identifier for the current document event.
30      *
31      * <p>The return value is the system identifier of the document
32      * entity or of the external parsed entity in which the markup that
33      * triggered the event appears.</p>
34      *
35      * <p>If the system identifier is a URL, the parser must resolve it
36      * fully before passing it to the application.</p>
37      *
38      * @return A string containing the system identifier, or null
39      * if none is available.
40      * @see #getPublicId
41      */

42     public String JavaDoc getSystemId();
43
44     /**
45      * Return the line number where the current document event ends.
46      *
47      * <p><strong>Warning:</strong> The return value from the method
48      * is intended only as an approximation for the sake of error
49      * reporting; it is not intended to provide sufficient information
50      * to edit the character content of the original XML document.</p>
51      *
52      * <p>The return value is an approximation of the line number
53      * in the document entity or external parsed entity where the
54      * markup that triggered the event appears.</p>
55      *
56      * @return The line number, or -1 if none is available.
57      * @see #getColumnNumber
58      */

59     public int getLineNumber();
60
61     /**
62      * Return the character position where the current document event ends.
63      *
64      * <p><strong>Warning:</strong> The return value from the method
65      * is intended only as an approximation for the sake of error
66      * reporting; it is not intended to provide sufficient information
67      * to edit the character content of the original XML document.</p>
68      *
69      * <p>The return value is an approximation of the column number
70      * in the document entity or external parsed entity where the
71      * markup that triggered the event appears.</p>
72      *
73      * @return The column number, or -1 if none is available.
74      * @see #getLineNumber
75      */

76     public int getColumnNumber();
77 }
78
Popular Tags