org.apache.xerces.impl.xs.util
Class SimpleLocator

java.lang.Object
  extended by org.apache.xerces.impl.xs.util.SimpleLocator
All Implemented Interfaces:
XMLLocator

public class SimpleLocator
extends java.lang.Object
implements XMLLocator

An XMLLocator implementation used for schema error reporting.

Version:
$Id: SimpleLocator.java 449487 2006-09-24 21:11:28Z mrglavas $
Author:
Sandy Gao, IBM

Constructor Summary
SimpleLocator()
           
SimpleLocator(java.lang.String lsid, java.lang.String esid, int line, int column)
           
SimpleLocator(java.lang.String lsid, java.lang.String esid, int line, int column, int offset)
           
 
Method Summary
 java.lang.String getBaseSystemId()
          Returns the base system identifier.
 int getCharacterOffset()
          Returns the character offset, or -1 if no character offset is available.
 int getColumnNumber()
          Returns the column number, or -1 if no column number is available.
 java.lang.String getEncoding()
          Returns the encoding of the current entity.
 java.lang.String getExpandedSystemId()
          Returns the expanded system identifier.
 int getLineNumber()
          Returns the line number, or -1 if no line number is available.
 java.lang.String getLiteralSystemId()
          Returns the literal system identifier.
 java.lang.String getPublicId()
          Returns the public identifier.
 java.lang.String getXMLVersion()
          Returns the XML version of the current entity.
 void setBaseSystemId(java.lang.String systemId)
           
 void setCharacterOffset(int offset)
           
 void setColumnNumber(int col)
           
 void setExpandedSystemId(java.lang.String systemId)
           
 void setLineNumber(int line)
           
 void setLiteralSystemId(java.lang.String systemId)
           
 void setPublicId(java.lang.String publicId)
           
 void setValues(java.lang.String lsid, java.lang.String esid, int line, int column)
           
 void setValues(java.lang.String lsid, java.lang.String esid, int line, int column, int offset)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLocator

public SimpleLocator()

SimpleLocator

public SimpleLocator(java.lang.String lsid,
                     java.lang.String esid,
                     int line,
                     int column)

SimpleLocator

public SimpleLocator(java.lang.String lsid,
                     java.lang.String esid,
                     int line,
                     int column,
                     int offset)
Method Detail

setValues

public void setValues(java.lang.String lsid,
                      java.lang.String esid,
                      int line,
                      int column)

setValues

public void setValues(java.lang.String lsid,
                      java.lang.String esid,
                      int line,
                      int column,
                      int offset)

getLineNumber

public int getLineNumber()
Description copied from interface: XMLLocator
Returns the line number, or -1 if no line number is available.

Specified by:
getLineNumber in interface XMLLocator

getColumnNumber

public int getColumnNumber()
Description copied from interface: XMLLocator
Returns the column number, or -1 if no column number is available.

Specified by:
getColumnNumber in interface XMLLocator

getCharacterOffset

public int getCharacterOffset()
Description copied from interface: XMLLocator
Returns the character offset, or -1 if no character offset is available.

Specified by:
getCharacterOffset in interface XMLLocator

getPublicId

public java.lang.String getPublicId()
Description copied from interface: XMLLocator
Returns the public identifier.

Specified by:
getPublicId in interface XMLLocator

getExpandedSystemId

public java.lang.String getExpandedSystemId()
Description copied from interface: XMLLocator
Returns the expanded system identifier.

Specified by:
getExpandedSystemId in interface XMLLocator

getLiteralSystemId

public java.lang.String getLiteralSystemId()
Description copied from interface: XMLLocator
Returns the literal system identifier.

Specified by:
getLiteralSystemId in interface XMLLocator

getBaseSystemId

public java.lang.String getBaseSystemId()
Description copied from interface: XMLLocator
Returns the base system identifier.

Specified by:
getBaseSystemId in interface XMLLocator

setColumnNumber

public void setColumnNumber(int col)

setLineNumber

public void setLineNumber(int line)

setCharacterOffset

public void setCharacterOffset(int offset)

setBaseSystemId

public void setBaseSystemId(java.lang.String systemId)
See Also:
XMLResourceIdentifier.setBaseSystemId(String)

setExpandedSystemId

public void setExpandedSystemId(java.lang.String systemId)
See Also:
XMLResourceIdentifier.setExpandedSystemId(String)

setLiteralSystemId

public void setLiteralSystemId(java.lang.String systemId)
See Also:
XMLResourceIdentifier.setLiteralSystemId(String)

setPublicId

public void setPublicId(java.lang.String publicId)
See Also:
XMLResourceIdentifier.setPublicId(String)

getEncoding

public java.lang.String getEncoding()
Returns the encoding of the current entity. Since these locators are used in the construction of XMLParseExceptions, which know nothing about encodings, there is no point in having this object deal intelligently with encoding information.

Specified by:
getEncoding in interface XMLLocator

getXMLVersion

public java.lang.String getXMLVersion()
Description copied from interface: XMLLocator
Returns the XML version of the current entity. This will normally be the value from the XML or text declaration or defaulted by the parser. Note that that this value may be different than the version of the processing rules applied to the current entity. For instance, an XML 1.1 document may refer to XML 1.0 entities. In such a case the rules of XML 1.1 are applied to the entire document. Also note that, for a given entity, this value can only be considered final once the XML or text declaration has been read or once it has been determined that there is no such declaration.

Specified by:
getXMLVersion in interface XMLLocator