01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.xerces.xni;
19:
20: /**
21: * Location information.
22: *
23: * @author Andy Clark, IBM
24: *
25: * @version $Id: XMLLocator.java 447247 2006-09-18 05:23:52Z mrglavas $
26: */
27: public interface XMLLocator {
28:
29: //
30: // XMLLocator methods
31: //
32:
33: /** Returns the public identifier. */
34: public String getPublicId();
35:
36: /** Returns the literal system identifier. */
37: public String getLiteralSystemId();
38:
39: /** Returns the base system identifier. */
40: public String getBaseSystemId();
41:
42: /** Returns the expanded system identifier. */
43: public String getExpandedSystemId();
44:
45: /** Returns the line number, or <code>-1</code> if no line number is available. */
46: public int getLineNumber();
47:
48: /** Returns the column number, or <code>-1</code> if no column number is available. */
49: public int getColumnNumber();
50:
51: /** Returns the character offset, or <code>-1</code> if no character offset is available. */
52: public int getCharacterOffset();
53:
54: /**
55: * Returns the encoding of the current entity.
56: * Note that, for a given entity, this value can only be
57: * considered final once the encoding declaration has been read (or once it
58: * has been determined that there is no such declaration) since, no encoding
59: * having been specified on the XMLInputSource, the parser
60: * will make an initial "guess" which could be in error.
61: */
62: public String getEncoding();
63:
64: /**
65: * Returns the XML version of the current entity. This will normally be the
66: * value from the XML or text declaration or defaulted by the parser. Note that
67: * that this value may be different than the version of the processing rules
68: * applied to the current entity. For instance, an XML 1.1 document may refer to
69: * XML 1.0 entities. In such a case the rules of XML 1.1 are applied to the entire
70: * document. Also note that, for a given entity, this value can only be considered
71: * final once the XML or text declaration has been read or once it has been
72: * determined that there is no such declaration.
73: */
74: public String getXMLVersion();
75:
76: } // interface XMLLocator
|