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

com.github.davidmoten.aws.lw.client.xml.XmlParseException Maven / Gradle / Ivy

Go to download

Lightweight client for all AWS services (but still with useful builders and XML parser)

The newest version!
/* 
 * The NanoXML 2 Lite licence blurb is included here. The classes have been 
 * completely butchered but the core xml parsing routines are thanks to 
 * the NanoXML authors.
 *  
 **/

/* XMLParseException.java
 *
 * $Revision: 1.4 $
 * $Date: 2002/03/24 10:27:59 $
 * $Name: RELEASE_2_2_1 $
 *
 * This file is part of NanoXML 2 Lite.
 * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
 *
 * This software is provided 'as-is', without any express or implied warranty.
 * In no event will the authors be held liable for any damages arising from the
 * use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 *  1. The origin of this software must not be misrepresented; you must not
 *     claim that you wrote the original software. If you use this software in
 *     a product, an acknowledgment in the product documentation would be
 *     appreciated but is not required.
 *
 *  2. Altered source versions must be plainly marked as such, and must not be
 *     misrepresented as being the original software.
 *
 *  3. This notice may not be removed or altered from any source distribution.
 *****************************************************************************/


package com.github.davidmoten.aws.lw.client.xml;

/**
 * An XMLParseException is thrown when an error occures while parsing an XML
 * string.
 * 

* $Revision: 1.4 $
* $Date: 2002/03/24 10:27:59 $

* * @see com.github.davidmoten.aws.lw.client.xml.XmlElement * * @author Marc De Scheemaecker * @version $Name: RELEASE_2_2_1 $, $Revision: 1.4 $ */ public class XmlParseException extends RuntimeException { /** * */ private static final long serialVersionUID = 2719032602966457493L; /** * Indicates that no line number has been associated with this exception. */ public static final int NO_LINE = -1; /** * The line number in the source code where the error occurred, or * NO_LINE if the line number is unknown. * *

Invariants:
*
  • lineNumber > 0 || lineNumber == NO_LINE *
*/ private int lineNumber; /** * Creates an exception. * * @param name The name of the element where the error is located. * @param lineNumber The number of the line in the input. * @param message A message describing what went wrong. * *
Preconditions:
*
  • message != null *
  • lineNumber > 0 *
* *
Postconditions:
*
  • getLineNumber() => lineNr *
*/ public XmlParseException(String name, int lineNumber, String message) { super("Problem parsing " + ((name == null) ? "the XML definition" : ("a " + name + " element")) + " at line " + lineNumber + ": " + message); this.lineNumber = lineNumber; } /** * Where the error occurred, or NO_LINE if the line number is * unknown. * */ public int lineNumber() { return this.lineNumber; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy