本文整理匯總了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();
}
}