本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}