All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.modules.xml.XmlPullParserException Maven / Gradle / Ivy

There is a newer version: 2.1.5.Final
Show newest version
/* -*-             c-basic-offset: 4; indent-tabs-mode: nil; -*-  //------100-columns-wide------>|*/
// for license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/)

package org.jboss.modules.xml;

/**
 * This exception is thrown to signal XML Pull Parser related faults.
 *
 * @author Aleksander Slominski
 */
public class XmlPullParserException extends Exception {
    private static final long serialVersionUID = - 8715154876633542268L;

    protected int row = -1;
    protected int column = -1;

    public XmlPullParserException(String s) {
        super(s);
    }

    public XmlPullParserException(String msg, XmlPullParser parser, Throwable chain) {
        super ((msg == null ? "" : msg+" ")
               + (parser == null ? "" : "(position:"+parser.getPositionDescription()+") ")
               + (chain == null ? "" : "caused by: "+chain), chain);

        if (parser != null) {
            this.row = parser.getLineNumber();
            this.column = parser.getColumnNumber();
        }
    }

    //    public void setDetail(Throwable cause) { this.detail = cause; }
    public int getLineNumber() {
        return row;
    }
    public int getColumnNumber() {
        return column;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy