当前位置: 首页>>代码示例>>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;未经允许,请勿转载。