本文整理汇总了Java中org.apache.xerces.xni.XNIException.getException方法的典型用法代码示例。如果您正苦于以下问题:Java XNIException.getException方法的具体用法?Java XNIException.getException怎么用?Java XNIException.getException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.xerces.xni.XNIException
的用法示例。
在下文中一共展示了XNIException.getException方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toSAXException
import org.apache.xerces.xni.XNIException; //导入方法依赖的package包/类
static SAXException toSAXException(XNIException e) {
if (e instanceof XMLParseException) {
XMLParseException pe = (XMLParseException)e;
return new SAXParseException(pe.getMessage(),
pe.getPublicId(),
pe.getExpandedSystemId(),
pe.getLineNumber(),
pe.getColumnNumber(),
pe.getException());
}
Exception nested = e.getException();
if (nested == null)
return new SAXException(e.getMessage());
if (nested instanceof SAXException)
return (SAXException)nested;
if (nested instanceof RuntimeException)
throw (RuntimeException)nested;
return new SAXException(nested);
}
示例2: toSAXException
import org.apache.xerces.xni.XNIException; //导入方法依赖的package包/类
/**
* Reconstructs {@link SAXException} from XNIException.
*/
public static SAXException toSAXException(XNIException e) {
if(e instanceof XMLParseException)
return toSAXParseException((XMLParseException)e);
if( e.getException() instanceof SAXException )
return (SAXException)e.getException();
return new SAXException(e.getMessage(),e.getException());
}
示例3: toSAXException
import org.apache.xerces.xni.XNIException; //导入方法依赖的package包/类
/**
* Converts the {@link XNIException} received from a downstream
* component to a {@link SAXException}.
*/
private SAXException toSAXException( XNIException xe ) {
Exception e = xe.getException();
if( e==null ) e = xe;
if( e instanceof SAXException ) return (SAXException)e;
return new SAXException(e);
}
示例4: convertToSAXException
import org.apache.xerces.xni.XNIException; //导入方法依赖的package包/类
static void convertToSAXException(XNIException e) throws SAXException {
Exception ex = e.getException();
if (ex == null) {
throw new SAXException(e.getMessage());
}
if (ex instanceof SAXException) {
throw (SAXException) ex;
}
throw new SAXException(ex);
}
示例5: parseASInputSource
import org.apache.xerces.xni.XNIException; //导入方法依赖的package包/类
/**
* Parse a Abstract Schema from a location identified by an
* <code>LSInput</code>.
*
* @param is The <code>LSInput</code> from which the source
* Abstract Schema is to be read.
* @return The newly created <code>ASModel</code>.
* @exception DOMASException
* Exceptions raised by <code>parseASURI()</code> originate with the
* installed ErrorHandler, and thus depend on the implementation of
* the <code>DOMErrorHandler</code> interfaces. The default error
* handlers will raise a <code>DOMASException</code> if any form of
* Abstract Schema inconsistencies or warning occurs during the parse,
* but application defined errorHandlers are not required to do so.
* <br> WRONG_MIME_TYPE_ERR: Raised when <code>mimeTypeCheck</code> is
* true and the inputsource has an incorrect MIME Type. See attribute
* <code>mimeTypeCheck</code>.
* @exception DOMSystemException
* Exceptions raised by <code>parseURI()</code> originate with the
* installed ErrorHandler, and thus depend on the implementation of
* the <code>DOMErrorHandler</code> interfaces. The default error
* handlers will raise a DOMSystemException if any form I/O or other
* system error occurs during the parse, but application defined error
* handlers are not required to do so.
*/
public ASModel parseASInputSource(LSInput is)
throws DOMASException, Exception {
// need to wrap the LSInput with an XMLInputSource
XMLInputSource xis = this.dom2xmlInputSource(is);
try {
return parseASInputSource(xis);
}
catch (XNIException e) {
Exception ex = e.getException();
throw ex;
}
}