Java Code Examples for org.xml.sax.SAXParseException#getException()

The following examples show how to use org.xml.sax.SAXParseException#getException() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Coordinator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 2
Source File: Coordinator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 3
Source File: Coordinator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 4
Source File: Coordinator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 5
Source File: Coordinator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 6
Source File: Coordinator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 7
Source File: Coordinator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 8
Source File: Coordinator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void propagateEvent( int severity, SAXParseException saxException )
    throws SAXException {

    ValidationEventImpl ve =
        new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );

    Exception e = saxException.getException();
    if( e != null ) {
        ve.setLinkedException( e );
    } else {
        ve.setLinkedException( saxException );
    }

    // call the client's event handler.  If it returns false, then bail-out
    // and terminate the unmarshal operation.
    boolean result = handleEvent( ve );
    if( ! result ) {
        // bail-out of the parse with a SAX exception, but convert it into
        // an UnmarshalException back in in the AbstractUnmarshaller
        throw saxException;
    }
}
 
Example 9
Source File: Bug6989956Test.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected static String strException(Exception ex) {
    StringBuffer sb = new StringBuffer();

    while (ex != null) {
        if (ex instanceof SAXParseException) {
            SAXParseException e = (SAXParseException) ex;
            sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage());
            ex = e.getException();
        } else {
            sb.append(ex);
            ex = null;
        }
    }
    return sb.toString();
}
 
Example 10
Source File: Bug6963468Test.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected static String strException(Exception ex) {
    StringBuffer sb = new StringBuffer();

    while (ex != null) {
        if (ex instanceof SAXParseException) {
            SAXParseException e = (SAXParseException) ex;
            sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage());
            ex = e.getException();
        } else {
            sb.append(ex);
            ex = null;
        }
    }
    return sb.toString();
}
 
Example 11
Source File: AmfxMessageDeserializer.java    From flex-blazeds with Apache License 2.0 5 votes vote down vote up
/**
 * Process FatalError of a SAXParseException.
 *
 * @param exception SAXParseException
 * @throws SAXException rethrow the SAXException
 */
public void fatalError(SAXParseException exception) throws SAXException
{
    if ((exception.getException() != null) && (exception.getException() instanceof MessageException))
        throw (MessageException)exception.getException();
    throw new MessageException(exception.getMessage());
}
 
Example 12
Source File: ValidationErrorHandler.java    From importer-exporter with Apache License 2.0 5 votes vote down vote up
private void write(SAXParseException e, String prefix, LogLevel level) throws SAXException {
    if (!isAborted) {
        log.log(level, prefix + " at " + '[' + e.getLineNumber() + ',' + e.getColumnNumber() + "]: " + e.getMessage());
        validationErrors++;
        if (!isReportAllErrors) {
            isAborted = true;
            throw new SAXException(e.getException());
        }
    }
}