本文整理匯總了Java中org.xml.sax.SAXParseException.getException方法的典型用法代碼示例。如果您正苦於以下問題:Java SAXParseException.getException方法的具體用法?Java SAXParseException.getException怎麽用?Java SAXParseException.getException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.xml.sax.SAXParseException
的用法示例。
在下文中一共展示了SAXParseException.getException方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: propagateEvent
import org.xml.sax.SAXParseException; //導入方法依賴的package包/類
private void propagateEvent( int severity, SAXParseException saxException )
throws SAXException {
ValidationEventImpl ve =
new ValidationEventImpl( severity, saxException.getMessage(), getLocation() );
Exception e = saxException.getException();
if( e != null ) {
ve.setLinkedException( e );
} else {
ve.setLinkedException( saxException );
}
// call the client's event handler. If it returns false, then bail-out
// and terminate the unmarshal operation.
boolean result = handleEvent( ve );
if( ! result ) {
// bail-out of the parse with a SAX exception, but convert it into
// an UnmarshalException back in in the AbstractUnmarshaller
throw saxException;
}
}
示例2: strException
import org.xml.sax.SAXParseException; //導入方法依賴的package包/類
protected static String strException(Exception ex) {
StringBuffer sb = new StringBuffer();
while (ex != null) {
if (ex instanceof SAXParseException) {
SAXParseException e = (SAXParseException) ex;
sb.append("" + e.getSystemId() + "(" + e.getLineNumber() + "," + e.getColumnNumber() + "): " + e.getMessage());
ex = e.getException();
} else {
sb.append(ex);
ex = null;
}
}
return sb.toString();
}