StreamScanner.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:woodstox 作者:
/**
 *<p>
 * Note: this is the base implementation used for implementing
 * <code>ValidationContext</code>
 */
@Override
public void reportValidationProblem(XMLValidationProblem prob)
    throws XMLStreamException
{
    // !!! TBI: Fail-fast vs. deferred modes?
    /* For now let's implement basic functionality: warnings get
     * reported via XMLReporter, errors and fatal errors result in
     * immediate exceptions.
     */
    /* 27-May-2008, TSa: [WSTX-153] Above is incorrect: as per Stax
     *   javadocs for XMLReporter, both warnings and non-fatal errors
     *   (which includes all validation errors) should be reported via
     *   XMLReporter interface, and only fatals should cause an
     *   immediate stream exception (by-passing reporter)
     */
    if (prob.getSeverity() > XMLValidationProblem.SEVERITY_ERROR) {
        throw WstxValidationException.create(prob);
    }
    XMLReporter rep = mConfig.getXMLReporter();
    if (rep != null) {
        _reportProblem(rep, prob);
    } else {
        /* If no reporter, regular non-fatal errors are to be reported
         * as exceptions as well, for backwards compatibility
         */
        if (prob.getSeverity() >= XMLValidationProblem.SEVERITY_ERROR) {
            throw WstxValidationException.create(prob);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号