Example usage for org.xml.sax SAXParseException getLineNumber

List of usage examples for org.xml.sax SAXParseException getLineNumber

Introduction

In this page you can find the example usage for org.xml.sax SAXParseException getLineNumber.

Prototype

public int getLineNumber() 

Source Link

Document

The line number of the end of the text where the exception occurred.

Usage

From source file:javasnack.snacks.xml.sax2.DebugPrinter.java

void saxerr(String level, SAXParseException e) {
    oops("%s : SAXParserException(line:%d, column:%d, publicId:%s, systemId:%s)", level, e.getLineNumber(),
            e.getColumnNumber(), e.getPublicId(), e.getSystemId());
    oops(e.toString());/*  w  w  w  . j  a  v a2s. c o  m*/
    oops("...continue");
}

From source file:com.ebay.jetstream.event.processor.esper.raw.EsperTestConfigurationValidator.java

public void warning(SAXParseException ex) {
    log.error(//  w w  w.j a  va 2  s  .com
            "[Warning] " + ex.getMessage() + " line " + ex.getLineNumber() + " column " + ex.getColumnNumber());
    warnings++;
}

From source file:Main.java

private void printInfo(SAXParseException e) {
    System.out.println("   Public ID: " + e.getPublicId());
    System.out.println("   System ID: " + e.getSystemId());
    System.out.println("   Line number: " + e.getLineNumber());
    System.out.println("   Column number: " + e.getColumnNumber());
    System.out.println("   Message: " + e.getMessage());
}

From source file:com.ebay.jetstream.event.processor.esper.raw.EsperTestConfigurationValidator.java

public void fatalError(SAXParseException ex) throws SAXException {
    log.error("[Fatal Error] " + ex.getMessage() + " line " + ex.getLineNumber() + " column "
            + ex.getColumnNumber());/*from w  ww . java 2  s .  c  o  m*/
    fatalErrors++;
    throw ex;
}

From source file:gov.nih.nci.cabig.caaers.esb.client.ESBMessageConsumerImpl.java

public void error(SAXParseException exception) throws SAXException {
    // Bring things to a crashing halt
    log.warn("**Parsing Error**" + "  Line:    " + exception.getLineNumber() + "" + "  URI:     "
            + exception.getSystemId() + "" + "  Message: " + exception.getMessage());
    throw new SAXException("Error encountered");
}

From source file:gov.nih.nci.cabig.caaers.esb.client.ESBMessageConsumerImpl.java

public void warning(SAXParseException exception) throws SAXException {
    // Bring things to a crashing halt
    log.warn("**Parsing Warning**" + "  Line:    " + exception.getLineNumber() + "" + "  URI:     "
            + exception.getSystemId() + "" + "  Message: " + exception.getMessage());
    throw new SAXException("Warning encountered");
}

From source file:DOMCopy.java

private void show(String type, SAXParseException e) {
        System.out.println(type + ": " + e.getMessage());
        System.out.println("Line " + e.getLineNumber() + " Column " + e.getColumnNumber());
        System.out.println("System ID: " + e.getSystemId());
    }//from   w w w  .  j  a  v  a  2s.com

From source file:gov.nih.nci.cabig.caaers.esb.client.ESBMessageConsumerImpl.java

public void fatalError(SAXParseException exception) throws SAXException {
    // Bring things to a crashing halt
    log.warn("**Parsing Fatal Error**" + "  Line:    " + exception.getLineNumber() + "" + "  URI:     "
            + exception.getSystemId() + "" + "  Message: " + exception.getMessage());
    throw new SAXException("Fatal Error encountered");
}

From source file:com.consol.citrus.samples.bookstore.validation.XmlSchemaValidatingChannelInterceptor.java

/**
 * Validates the payload of the message// www  .  java2  s . c  om
 * 
 * @param message
 * @param channel
 */
public void validateSchema(Message<?> message, MessageChannel channel) {
    try {
        SAXParseException[] exceptions = xmlValidator.validate(converter.convertToSource(message.getPayload()));
        if (exceptions.length > 0) {
            StringBuilder msg = new StringBuilder("Invalid XML message on channel ");
            if (channel != null) {
                msg.append(channel.toString());
            } else {
                msg.append("<unknown>");
            }
            msg.append(":\n");
            for (SAXParseException e : exceptions) {
                msg.append("\t").append(e.getMessage());
                msg.append(" (line=").append(e.getLineNumber());
                msg.append(", col=").append(e.getColumnNumber()).append(")\n");
            }
            log.warn("XSD schema validation failed: ", msg.toString());
            throw new XmlSchemaValidationException(message, exceptions[0]);
        }
    } catch (IOException ioE) {
        throw new MessagingException("Exception applying schema validation", ioE);
    }
}

From source file:com.connexta.arbitro.ctx.InputParser.java

/**
 * Standard handler routine for the XML parsing.
 * //from   www  .  ja v a2s.c om
 * @param exception information on what caused the problem
 */
public void warning(SAXParseException exception) throws SAXException {
    if (logger.isWarnEnabled())
        logger.warn("Warning on line " + exception.getLineNumber() + ": " + exception.getMessage());
}