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