2
* Copyright 2003-2004 The Apache Software Foundation.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
// $Id: SourceLocator.java 226183 2005-04-08 10:39:14Z neeraj $
19
package javax.xml.transform;
22
* This interface is primarily for the purposes of reporting where
23
* an error occurred in the XML source or transformation instructions.
25
public interface SourceLocator {
28
* Return the public identifier for the current document event.
30
* <p>The return value is the public identifier of the document
31
* entity or of the external parsed entity in which the markup that
32
* triggered the event appears.</p>
34
* @return A string containing the public identifier, or
35
* null if none is available.
38
public String getPublicId();
41
* Return the system identifier for the current document event.
43
* <p>The return value is the system identifier of the document
44
* entity or of the external parsed entity in which the markup that
45
* triggered the event appears.</p>
47
* <p>If the system identifier is a URL, the parser must resolve it
48
* fully before passing it to the application.</p>
50
* @return A string containing the system identifier, or null
51
* if none is available.
54
public String getSystemId();
57
* Return the line number where the current document event ends.
59
* <p><strong>Warning:</strong> The return value from the method
60
* is intended only as an approximation for the sake of error
61
* reporting; it is not intended to provide sufficient information
62
* to edit the character content of the original XML document.</p>
64
* <p>The return value is an approximation of the line number
65
* in the document entity or external parsed entity where the
66
* markup that triggered the event appears.</p>
68
* @return The line number, or -1 if none is available.
69
* @see #getColumnNumber
71
public int getLineNumber();
74
* Return the character position where the current document event ends.
76
* <p><strong>Warning:</strong> The return value from the method
77
* is intended only as an approximation for the sake of error
78
* reporting; it is not intended to provide sufficient information
79
* to edit the character content of the original XML document.</p>
81
* <p>The return value is an approximation of the column number
82
* in the document entity or external parsed entity where the
83
* markup that triggered the event appears.</p>
85
* @return The column number, or -1 if none is available.
88
public int getColumnNumber();