XMLParseException.java 2.99 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.day.jcr.vault.util.xml.xerces.xni.parser;

import com.day.jcr.vault.util.xml.xerces.xni.XMLLocator;
import com.day.jcr.vault.util.xml.xerces.xni.XNIException;

public class XMLParseException
extends XNIException {
    protected String fPublicId;
    protected String fLiteralSystemId;
    protected String fExpandedSystemId;
    protected String fBaseSystemId;
    protected int fLineNumber = -1;
    protected int fColumnNumber = -1;

    public XMLParseException(XMLLocator locator, String message) {
        super(message);
        if (locator != null) {
            this.fPublicId = locator.getPublicId();
            this.fLiteralSystemId = locator.getLiteralSystemId();
            this.fExpandedSystemId = locator.getExpandedSystemId();
            this.fBaseSystemId = locator.getBaseSystemId();
            this.fLineNumber = locator.getLineNumber();
            this.fColumnNumber = locator.getColumnNumber();
        }
    }

    public XMLParseException(XMLLocator locator, String message, Exception exception) {
        super(message, exception);
        this.fPublicId = locator.getPublicId();
        this.fLiteralSystemId = locator.getLiteralSystemId();
        this.fExpandedSystemId = locator.getExpandedSystemId();
        this.fBaseSystemId = locator.getBaseSystemId();
        this.fLineNumber = locator.getLineNumber();
        this.fColumnNumber = locator.getColumnNumber();
    }

    public String getPublicId() {
        return this.fPublicId;
    }

    public String getExpandedSystemId() {
        return this.fExpandedSystemId;
    }

    public String getLiteralSystemId() {
        return this.fLiteralSystemId;
    }

    public String getBaseSystemId() {
        return this.fBaseSystemId;
    }

    public int getLineNumber() {
        return this.fLineNumber;
    }

    public int getColumnNumber() {
        return this.fColumnNumber;
    }

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