FileDocCategorySizeDatePackage
XMLParseException.javaAPI DocJava SE 5 API6954Fri Aug 26 14:55:58 BST 2005com.sun.org.apache.xerces.internal.xni.parser

XMLParseException

public class XMLParseException extends 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,v 1.4 2002/01/29 01:15:19 lehors Exp $

Fields Summary
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.
Constructors Summary
public XMLParseException(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();
        }
    
public XMLParseException(XMLLocator locator, String message, Exception exception)
Constructs a parse exception.

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

        return fBaseSystemId;
    
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 (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(':");
        String message = getMessage();
        if (message == null) {
            Exception exception = getException();
            if (exception != null) {
                message = exception.getMessage();
            }
        }
        if (message != null) {
            str.append(message);
        }
        return str.toString();