Example usage for org.xml.sax SAXParseException getColumnNumber

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

Introduction

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

Prototype

public int getColumnNumber() 

Source Link

Document

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

Usage

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

public void error(SAXParseException ex) {
    log.error("[Error] " + ex.getMessage() + " line " + ex.getLineNumber() + " column " + ex.getColumnNumber());
    errors++;// ww w  .  j a v  a 2 s. c  o m
}

From source file:DOMCheck.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 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 va  2s . c  om
    oops("...continue");
}

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

public void warning(SAXParseException ex) {
    log.error(/*from  ww w .  j a  v a  2  s .  c o m*/
            "[Warning] " + ex.getMessage() + " line " + ex.getLineNumber() + " column " + ex.getColumnNumber());
    warnings++;
}

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());
    fatalErrors++;/*from  w w w. j a v a2s .  co  m*/
    throw ex;
}

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: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   ww  w.jav  a2  s  .co  m

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

/**
 * Validates the payload of the message//from   www.  j  a v a  2  s.  c o m
 * 
 * @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.itude.mobile.mobbl.core.model.parser.MBXmlDocumentParser.java

@Override
public void error(SAXParseException e) throws SAXException {

    String message = "Error parsing document " + _definition.getName() + " at line " + e.getLineNumber()
            + " column " + e.getColumnNumber() + ": " + e.getMessage();

    throw new MBParseErrorException(message);
}

From source file:com.adaptris.core.transform.XmlSchemaValidator.java

@Override
public void validate(AdaptrisMessage msg) throws CoreException {
    try (InputStream in = msg.getInputStream()) {
        Validator validator = this.obtainSchemaToUse(msg).newValidator();
        validator.setErrorHandler(new ErrorHandlerImp());
        validator.validate(new SAXSource(new InputSource(in)));
    } catch (SAXParseException e) {
        throw new ServiceException(String.format("Error validating message[%s] line [%s] column[%s]",
                e.getMessage(), e.getLineNumber(), e.getColumnNumber()), e);
    } catch (Exception e) {
        throw ExceptionHelper.wrapServiceException("Failed to validate message", e);
    }/*from  w w w .  ja  va  2 s  . c o m*/
}