本文整理汇总了Java中org.xml.sax.SAXException.getLocalizedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java SAXException.getLocalizedMessage方法的具体用法?Java SAXException.getLocalizedMessage怎么用?Java SAXException.getLocalizedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.xml.sax.SAXException
的用法示例。
在下文中一共展示了SAXException.getLocalizedMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.xml.sax.SAXException; //导入方法依赖的package包/类
/** Read content from <code>r</code> and delegate to {@link #readElement}
* passing parsed content as a root element of DOM document
* @param r stream containing stored object
* @return the read setting object
* @exception IOException if the object cannot be read
* @exception ClassNotFoundException if the object class cannot be resolved
* @since 1.1
*/
public final Object read(java.io.Reader r) throws java.io.IOException, ClassNotFoundException {
Document doc = null;
try {
InputSource is = new InputSource(r);
doc = XMLUtil.parse(is, false, false, null, org.openide.xml.EntityCatalog.getDefault());
setDocumentContext(doc, findContext(r));
return readElement(doc.getDocumentElement());
} catch (SAXException ex) {
IOException ioe = new IOException(ex.getLocalizedMessage());
ioe.initCause(ex);
throw ioe;
} finally {
if (doc != null) {
clearCashesForDocument(doc);
}
}
}
示例2: getText
import org.xml.sax.SAXException; //导入方法依赖的package包/类
private String getText(SAXException e) {
if (e instanceof SAXParseException) {
return ((SAXParseException) e).getLineNumber() + ": "
+ e.getLocalizedMessage();
} else {
return e.getMessage();
}
}