javax.xml.transform.TransformerException#getException ( )源码实例Demo

下面列出了javax.xml.transform.TransformerException#getException ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * 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;
}
 
源代码2 项目: JDKSourceCode1.8   文件: TransformerFactoryImpl.java
/**
 * 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;
}
 
源代码3 项目: TencentKona-8   文件: TransformerFactoryImpl.java
/**
 * 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;
}
 
源代码4 项目: JDKSourceCode1.8   文件: TransformerImpl.java
/**
 * 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;
}
 
源代码5 项目: openjdk-jdk8u-backup   文件: TransformerImpl.java
/**
 * 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;
}
 
源代码6 项目: openjdk-jdk8u-backup   文件: TransformerImpl.java
/**
 * 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;
}
 
源代码7 项目: hottub   文件: TransformerImpl.java
/**
 * 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;
}
 
源代码8 项目: openjdk-8-source   文件: TransformerImpl.java
/**
 * 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;
}
 
源代码9 项目: openjdk-jdk8u   文件: TransformerFactoryImpl.java
/**
 * 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;
}
 
源代码10 项目: openjdk-jdk9   文件: TransformerFactoryImpl.java
/**
 * 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()));
    }
}
 
源代码11 项目: hottub   文件: TransformerFactoryImpl.java
/**
 * 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()));
    }
}
 
源代码12 项目: openjdk-8-source   文件: XPathException.java
/**
 * 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;
    }
  }
}
 
源代码13 项目: openjdk-8-source   文件: XPathException.java
/**
 * 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 : "";
}
 
源代码14 项目: openjdk-8   文件: TransformerFactoryImpl.java
/**
 * 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()));
    }
}
 
源代码15 项目: jdk1.8-source-analysis   文件: XPathException.java
/**
 * 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;
    }
  }
}
 
源代码16 项目: hottub   文件: TransformerImpl.java
/**
 * 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()));
    }
}
 
源代码17 项目: JDKSourceCode1.8   文件: TransformerFactoryImpl.java
/**
 * 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()));
    }
}
 
源代码18 项目: TencentKona-8   文件: XPathException.java
/**
 * 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;
    }
  }
}
 
源代码19 项目: hottub   文件: XPathException.java
/**
 * 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 : "";
}
 
源代码20 项目: jdk8u60   文件: TransformerImpl.java
/**
 * 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()));
    }
}