Top Description Fields Constructors Methods
org.apache.xerces.util

public Class LocatorProxy

extends Object
implements Locator2
Class Inheritance
All Implemented Interfaces
org.xml.sax.ext.Locator2, org.xml.sax.Locator
Imports
org.apache.xerces.xni.XMLLocator, org.xml.sax.Locator, org.xml.sax.ext.Locator2

Wraps XMLLocator and make it look like a SAX Locator.
Authors
Arnaud Le Hors, IBM, Andy Clark, IBM
Version
$Id: LocatorProxy.java 447241 2006-09-18 05:12:57Z mrglavas $

Field Summary

Modifier and TypeField and Description
private final XMLLocator
fLocator

XML locator.

Constructor Summary

AccessConstructor and Description
public
LocatorProxy(XMLLocator locator)

Constructs an XML locator proxy.

Method Summary

Modifier and TypeMethod and Description
public int
public String
getEncoding()

Implements org.xml.sax.ext.Locator2.getEncoding.

Returns the name of the character encoding for the entity.
public int
public String
getPublicId()

Implements org.xml.sax.Locator.getPublicId.

Public identifier.
public String
getSystemId()

Implements org.xml.sax.Locator.getSystemId.

System identifier.
public String
getXMLVersion()

Implements org.xml.sax.ext.Locator2.getXMLVersion.

Returns the version of XML used for the entity.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fLocatorback to summary
private final XMLLocator fLocator

XML locator.

Constructor Detail

LocatorProxyback to summary
public LocatorProxy(XMLLocator locator)

Constructs an XML locator proxy.

Method Detail

getColumnNumberback to summary
public int getColumnNumber()

Implements org.xml.sax.Locator.getColumnNumber.

Column number.

Returns:int

Doc from org.xml.sax.Locator.getColumnNumber.

The column number, or -1 if none is available.

getEncodingback to summary
public String getEncoding()

Implements org.xml.sax.ext.Locator2.getEncoding.

Doc from org.xml.sax.ext.Locator2.getEncoding.

Returns the name of the character encoding for the entity. If the encoding was declared externally (for example, in a MIME Content-Type header), that will be the name returned. Else if there was an <?xml ...encoding='...'?> declaration at the start of the document, that encoding name will be returned. Otherwise the encoding will been inferred (normally to be UTF-8, or some UTF-16 variant), and that inferred name will be returned.

When an InputSource is used to provide an entity's character stream, this method returns the encoding provided in that input stream.

Note that some recent W3C specifications require that text in some encodings be normalized, using Unicode Normalization Form C, before processing. Such normalization must be performed by applications, and would normally be triggered based on the value returned by this method.

Encoding names may be those used by the underlying JVM, and comparisons should be case-insensitive.

Returns:String

Name of the character encoding being used to interpret * the entity's text, or null if this was not provided for a * character stream passed through an InputSource or is otherwise not yet available in the current parsing state.

getLineNumberback to summary
public int getLineNumber()

Implements org.xml.sax.Locator.getLineNumber.

Line number.

Returns:int

Doc from org.xml.sax.Locator.getLineNumber.

The line number, or -1 if none is available.

getPublicIdback to summary
public String getPublicId()

Implements org.xml.sax.Locator.getPublicId.

Public identifier.

Returns:String

Doc from org.xml.sax.Locator.getPublicId.

A string containing the public identifier, or null if none is available.

getSystemIdback to summary
public String getSystemId()

Implements org.xml.sax.Locator.getSystemId.

System identifier.

Returns:String

Doc from org.xml.sax.Locator.getSystemId.

A string containing the system identifier, or null if none is available.

getXMLVersionback to summary
public String getXMLVersion()

Implements org.xml.sax.ext.Locator2.getXMLVersion.

Doc from org.xml.sax.ext.Locator2.getXMLVersion.

Returns the version of XML used for the entity. This will normally be the identifier from the current entity's <?xml version='...' ...?> declaration, or be defaulted by the parser.

Returns:String

Identifier for the XML version being used to interpret the entity's text, or null if that information is not yet available in the current parsing state.