当前位置: 首页>>代码示例>>Java>>正文


Java DOMErrorHandler.handleError方法代码示例

本文整理汇总了Java中org.w3c.dom.DOMErrorHandler.handleError方法的典型用法代码示例。如果您正苦于以下问题:Java DOMErrorHandler.handleError方法的具体用法?Java DOMErrorHandler.handleError怎么用?Java DOMErrorHandler.handleError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.w3c.dom.DOMErrorHandler的用法示例。


在下文中一共展示了DOMErrorHandler.handleError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reportDOMError

import org.w3c.dom.DOMErrorHandler; //导入方法依赖的package包/类
/**
 * Reports a DOM error to the user handler.
 *
 * If the error is fatal, the processing will be always aborted.
 */
public static final void reportDOMError(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator,
                    String message, short severity, String type ) {
    if( errorHandler!=null ) {
        error.reset();
        error.fMessage = message;
        error.fSeverity = severity;
        error.fLocator = locator;
        error.fType = type;
        error.fRelatedData = locator.fRelatedNode;

        if(!errorHandler.handleError(error))
            throw abort;
    }
    if( severity==DOMError.SEVERITY_FATAL_ERROR )
        throw abort;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:DOMNormalizer.java

示例2: reportDOMError

import org.w3c.dom.DOMErrorHandler; //导入方法依赖的package包/类
/**
 * Reports a DOM error to the user handler.
 *
 * If the error is fatal, the processing will be always aborted.
 */
public static final void reportDOMError(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator,
                    String message, short severity, String type ) {
    if( errorHandler!=null ) {
        error.reset();
        error.fMessage = message;
        error.fSeverity = severity;
        error.fLocator = locator;
        error.fType = type;
        error.fRelatedData = locator.fRelatedNode;

        if(!errorHandler.handleError(error))
            throw new AbortException();
    }
    if( severity==DOMError.SEVERITY_FATAL_ERROR )
        throw new AbortException();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:DOMNormalizer.java

示例3: reportDOMError

import org.w3c.dom.DOMErrorHandler; //导入方法依赖的package包/类
/**
 * Reports a DOM error to the user handler.
 * 
 * If the error is fatal, the processing will be always aborted.
 */
public static final void reportDOMError(DOMErrorHandler errorHandler, DOMErrorImpl error, DOMLocatorImpl locator, 
                    String message, short severity, String type ) {
    if( errorHandler!=null ) {
        error.reset();
        error.fMessage = message;
        error.fSeverity = severity;
        error.fLocator = locator;
        error.fType = type;
        error.fRelatedData = locator.fRelatedNode;

        if(!errorHandler.handleError(error))
            throw abort;
    }
    if( severity==DOMError.SEVERITY_FATAL_ERROR )
        throw abort;
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:22,代码来源:DOMNormalizer.java

示例4: splitCdata

import org.w3c.dom.DOMErrorHandler; //导入方法依赖的package包/类
/**
 * Splits the given CDATA node if required.
 */
protected boolean splitCdata(Element e,
                             Node n,
                             DOMErrorHandler errorHandler) {
    String s2 = n.getNodeValue();
    int index = s2.indexOf(XMLConstants.XML_CDATA_END);
    if (index != -1) {
        String before = s2.substring(0, index + 2);
        String after = s2.substring(index + 2);
        n.setNodeValue(before);
        Node next = n.getNextSibling();
        if (next == null) {
            e.appendChild(createCDATASection(after));
        } else {
            e.insertBefore(createCDATASection(after),
                           next);
        }
        if (errorHandler != null) {
            if (!errorHandler.handleError(createDOMError(
                DOMConstants.DOM_CDATA_SECTIONS_SPLITTED_ERROR,
                DOMError.SEVERITY_WARNING,
                "cdata.section.split",
                new Object[] {},
                n,
                null))) {
                return false;
            }
        }
    }
    return true;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:34,代码来源:AbstractDocument.java


注:本文中的org.w3c.dom.DOMErrorHandler.handleError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。