FileDocCategorySizeDatePackage
SAXSourceLocator.javaAPI DocJava SE 5 API5096Fri Aug 26 14:56:04 BST 2005com.sun.org.apache.xml.internal.utils

SAXSourceLocator

public class SAXSourceLocator extends LocatorImpl implements Serializable, SourceLocator
Class SAXSourceLocator extends org.xml.sax.helpers.LocatorImpl for the purpose of implementing the SourceLocator interface, and thus can be both a SourceLocator and a SAX Locator.

Fields Summary
Locator
m_locator
The SAX Locator object.
Constructors Summary
public SAXSourceLocator()
Constructor SAXSourceLocator

public SAXSourceLocator(Locator locator)
Constructor SAXSourceLocator

param
locator Source locator

    m_locator = locator;
    this.setColumnNumber(locator.getColumnNumber());
    this.setLineNumber(locator.getLineNumber());
    this.setPublicId(locator.getPublicId());
    this.setSystemId(locator.getSystemId());
  
public SAXSourceLocator(SourceLocator locator)
Constructor SAXSourceLocator

param
locator Source locator

    m_locator = null;
    this.setColumnNumber(locator.getColumnNumber());
    this.setLineNumber(locator.getLineNumber());
    this.setPublicId(locator.getPublicId());
    this.setSystemId(locator.getSystemId());
  
public SAXSourceLocator(SAXParseException spe)
Constructor SAXSourceLocator

param
spe SAXParseException exception.

    this.setLineNumber( spe.getLineNumber() );
    this.setColumnNumber( spe.getColumnNumber() );
    this.setPublicId( spe.getPublicId() );
    this.setSystemId( spe.getSystemId() );
  
Methods Summary
public intgetColumnNumber()
Return the column number where the current document event ends.

Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.

The return value is an approximation of the column number in the document entity or external parsed entity where the markup triggering the event appears.

return
The column number, or -1 if none is available.
see
#getLineNumber

    return (null == m_locator) ? super.getColumnNumber() : m_locator.getColumnNumber();
  
public intgetLineNumber()
Return the line number where the current document event ends.

Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.

The return value is an approximation of the line number in the document entity or external parsed entity where the markup triggering the event appears.

return
The line number, or -1 if none is available.
see
#getColumnNumber

    return (null == m_locator) ? super.getLineNumber() : m_locator.getLineNumber();
  
public java.lang.StringgetPublicId()
Return the public identifier for the current document event.

The return value is the public identifier of the document entity or of the external parsed entity in which the markup triggering the event appears.

return
A string containing the public identifier, or null if none is available.
see
#getSystemId

    return (null == m_locator) ? super.getPublicId() : m_locator.getPublicId();
  
public java.lang.StringgetSystemId()
Return the system identifier for the current document event.

The return value is the system identifier of the document entity or of the external parsed entity in which the markup triggering the event appears.

If the system identifier is a URL, the parser must resolve it fully before passing it to the application.

return
A string containing the system identifier, or null if none is available.
see
#getPublicId

    return (null == m_locator) ? super.getSystemId() : m_locator.getSystemId();