當前位置: 首頁>>代碼示例>>Java>>正文


Java TransformerException.getException方法代碼示例

本文整理匯總了Java中javax.xml.transform.TransformerException.getException方法的典型用法代碼示例。如果您正苦於以下問題:Java TransformerException.getException方法的具體用法?Java TransformerException.getException怎麽用?Java TransformerException.getException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.xml.transform.TransformerException的用法示例。


在下文中一共展示了TransformerException.getException方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: error

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
/**
 * Receive notification of a recoverable error.
 * The transformer must continue to provide normal parsing events after
 * invoking this method. It should still be possible for the application
 * to process the document through to the end.
 *
 * @param e The warning information encapsulated in a transformer
 * exception.
 * @throws TransformerException if the application chooses to discontinue
 * the transformation (always does in our case).
 */
@Override
public void error(TransformerException e)
    throws TransformerException
{
    Throwable wrapped = e.getException();
    if (wrapped != null) {
        System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG,
                                        e.getMessageAndLocation(),
                                        wrapped.getMessage()));
    } else {
        System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG,
                                        e.getMessageAndLocation()));
    }
    throw e;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:27,代碼來源:TransformerFactoryImpl.java

示例2: fatalError

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
/**
 * Receive notification of a non-recoverable error.
 * The application must assume that the transformation cannot continue
 * after the Transformer has invoked this method, and should continue
 * (if at all) only to collect addition error messages. In fact,
 * Transformers are free to stop reporting events once this method has
 * been invoked.
 *
 * @param e warning information encapsulated in a transformer
 * exception.
 * @throws TransformerException if the application chooses to discontinue
 * the transformation (always does in our case).
 */
@Override
public void fatalError(TransformerException e)
    throws TransformerException
{
    Throwable wrapped = e.getException();
    if (wrapped != null) {
        System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
                                        e.getMessageAndLocation(),
                                        wrapped.getMessage()));
    } else {
        System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG,
                                        e.getMessageAndLocation()));
    }
    throw e;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:29,代碼來源:TransformerFactoryImpl.java

示例3: fatalError

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
/**
 * Receive notification of a non-recoverable error.
 * The application must assume that the transformation cannot continue
 * after the Transformer has invoked this method, and should continue
 * (if at all) only to collect addition error messages. In fact,
 * Transformers are free to stop reporting events once this method has
 * been invoked.
 *
 * @param e The warning information encapsulated in a transformer
 * exception.
 * @throws TransformerException if the application chooses to discontinue
 * the transformation (always does in our case).
 */
@Override
public void fatalError(TransformerException e)
    throws TransformerException
{
    Throwable wrapped = e.getException();
    if (wrapped != null) {
        System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG,
                                        e.getMessageAndLocation(),
                                        wrapped.getMessage()));
    } else {
        System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG,
                                        e.getMessageAndLocation()));
    }
    throw e;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:29,代碼來源:TransformerImpl.java

示例4: evaluate

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
public Object evaluate(String expression, InputSource source,
        QName returnType) throws XPathExpressionException {
    isSupported(returnType);

    try {
        Document document = getDocument(source);
        XObject resultObject = eval(expression, document);
        return getResultAsType(resultObject, returnType);
    } catch (TransformerException te) {
        Throwable nestedException = te.getException();
        if (nestedException instanceof javax.xml.xpath.XPathFunctionException) {
            throw (javax.xml.xpath.XPathFunctionException)nestedException;
        } else {
            throw new XPathExpressionException (te);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:18,代碼來源:XPathImpl.java

示例5: warning

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
/**
 * Receive notification of a warning.
 * Transformers can use this method to report conditions that are not
 * errors or fatal errors. The default behaviour is to take no action.
 * After invoking this method, the Transformer must continue with the
 * transformation. It should still be possible for the application to
 * process the document through to the end.
 *
 * @param e The warning information encapsulated in a transformer
 * exception.
 * @throws TransformerException if the application chooses to discontinue
 * the transformation (never does in our case).
 */
@Override
public void warning(TransformerException e)
    throws TransformerException
{
    Throwable wrapped = e.getException();
    if (wrapped != null) {
        System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG,
                                        e.getMessageAndLocation(),
                                        wrapped.getMessage()));
    } else {
        System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG,
                                        e.getMessageAndLocation()));
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:28,代碼來源:TransformerFactoryImpl.java

示例6: printStackTrace

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
/**
 * Print the the trace of methods from where the error
 * originated.  This will trace all nested exception
 * objects, as well as this object.
 * @param s The stream where the dump will be sent to.
 */
public void printStackTrace(java.io.PrintStream s)
{

  if (s == null)
    s = System.err;

  try
  {
    super.printStackTrace(s);
  }
  catch (Exception e){}

  Throwable exception = m_exception;

  for (int i = 0; (i < 10) && (null != exception); i++)
  {
    s.println("---------");
    exception.printStackTrace(s);

    if (exception instanceof TransformerException)
    {
      TransformerException se = (TransformerException) exception;
      Throwable prev = exception;

      exception = se.getException();

      if (prev == exception)
        break;
    }
    else
    {
      exception = null;
    }
  }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:42,代碼來源:XPathException.java

示例7: getMessage

import javax.xml.transform.TransformerException; //導入方法依賴的package包/類
/**
 * Find the most contained message.
 *
 * @return The error message of the originating exception.
 */
public String getMessage()
{

  String lastMessage = super.getMessage();
  Throwable exception = m_exception;

  while (null != exception)
  {
    String nextMessage = exception.getMessage();

    if (null != nextMessage)
      lastMessage = nextMessage;

    if (exception instanceof TransformerException)
    {
      TransformerException se = (TransformerException) exception;
      Throwable prev = exception;

      exception = se.getException();

      if (prev == exception)
        break;
    }
    else
    {
      exception = null;
    }
  }

  return (null != lastMessage) ? lastMessage : "";
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:37,代碼來源:XPathException.java


注:本文中的javax.xml.transform.TransformerException.getException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。