FileDocCategorySizeDatePackage
XMLParseException.javaAPI DocApache Xerces 3.0.15660Fri Sep 14 20:33:56 BST 2007org.apache.xerces.xni.parser

XMLParseException

public class XMLParseException extends org.apache.xerces.xni.XNIException
A parsing exception. This exception is different from the standard XNI exception in that it stores the location in the document (or its entities) where the exception occurred.
author
Andy Clark, IBM
version
$Id: XMLParseException.java 447244 2006-09-18 05:20:40Z mrglavas $

Fields Summary
static final long
serialVersionUID
Serialization version.
protected String
fPublicId
Public identifier.
protected String
fLiteralSystemId
literal System identifier.
protected String
fExpandedSystemId
expanded System identifier.
protected String
fBaseSystemId
Base system identifier.
protected int
fLineNumber
Line number.
protected int
fColumnNumber
Column number.
protected int
fCharacterOffset
Character offset.
Constructors Summary
public XMLParseException(org.apache.xerces.xni.XMLLocator locator, String message)
Constructs a parse exception.


    //
    // Constructors
    //

         
         
        super(message);
        if (locator != null) {
            fPublicId = locator.getPublicId();
            fLiteralSystemId = locator.getLiteralSystemId();
            fExpandedSystemId = locator.getExpandedSystemId();
            fBaseSystemId = locator.getBaseSystemId();
            fLineNumber = locator.getLineNumber();
            fColumnNumber = locator.getColumnNumber();
            fCharacterOffset = locator.getCharacterOffset();
        }
    
public XMLParseException(org.apache.xerces.xni.XMLLocator locator, String message, Exception exception)
Constructs a parse exception.

        super(message, exception);
        if (locator != null) {
            fPublicId = locator.getPublicId();
            fLiteralSystemId = locator.getLiteralSystemId();
            fExpandedSystemId = locator.getExpandedSystemId();
            fBaseSystemId = locator.getBaseSystemId();
            fLineNumber = locator.getLineNumber();
            fColumnNumber = locator.getColumnNumber();
            fCharacterOffset = locator.getCharacterOffset();
        }
    
Methods Summary
public java.lang.StringgetBaseSystemId()
Returns the base system identifier.

        return fBaseSystemId;
    
public intgetCharacterOffset()
Returns the character offset.

        return fCharacterOffset;
    
public intgetColumnNumber()
Returns the row number.

        return fColumnNumber;
    
public java.lang.StringgetExpandedSystemId()
Returns the expanded system identifier.

        return fExpandedSystemId;
    
public intgetLineNumber()
Returns the line number.

        return fLineNumber;
    
public java.lang.StringgetLiteralSystemId()
Returns the literal system identifier.

        return fLiteralSystemId;
    
public java.lang.StringgetPublicId()
Returns the public identifier.

        return fPublicId;
    
public java.lang.StringtoString()
Returns a string representation of this object.


        StringBuffer str = new StringBuffer();
        if (fPublicId != null) {
            str.append(fPublicId);
        }
        str.append(':");
        if (fLiteralSystemId != null) {
            str.append(fLiteralSystemId);
        }
        str.append(':");
        if (fExpandedSystemId != null) {
            str.append(fExpandedSystemId);
        }
        str.append(':");
        if (fBaseSystemId != null) {
            str.append(fBaseSystemId);
        }
        str.append(':");
        str.append(fLineNumber);
        str.append(':");
        str.append(fColumnNumber);
        str.append(':");
        str.append(fCharacterOffset);
        str.append(':");
        String message = getMessage();
        if (message == null) {
            Exception exception = getException();
            if (exception != null) {
                message = exception.getMessage();
            }
        }
        if (message != null) {
            str.append(message);
        }
        return str.toString();