Java 8 TransformerException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 TransformerException class.

This code example shows how to use the following methods:getMessageAndLocation
   public void warning(TransformerException te) {
      LOG.warn(te.getMessageAndLocation());
   } 
 
   public void error(TransformerException te) {
      throw EXCEPTION_LOG.newException(STOCK_ERROR_MSG + te.getMessageAndLocation(), te, RuntimeException.class);
   } 
 
   public void fatalError(TransformerException te) {
      throw EXCEPTION_LOG.newException(STOCK_ERROR_MSG + te.getMessageAndLocation(), te, RuntimeException.class);
   } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getCause, getLocationAsString
						templates.put(key, t);
					} 
				} catch (IOException e1) {
					throw NSForwardException._runtimeExceptionForThrowable(e1);
				} catch (TransformerConfigurationException tce) {
					log.error("could not create template " + tce.getLocationAsString(), tce);
					log.error("  cause", tce.getCause());
					if (tce.getCause() != null && tce.getCause() instanceof org.xml.sax.SAXParseException) {
						org.xml.sax.SAXParseException e = (org.xml.sax.SAXParseException) tce.getCause();
						log.error("SAXParseException: line " + e.getLineNumber() + ", column " + e.getColumnNumber());
					} 
					log.error("this is the incorrect xsl:>>>" + s + "<<<");
					return null; 
				} 
			} 
 
			try { 
				return t.newTransformer();
			} catch (TransformerConfigurationException tce) {
				log.error("could not create template " + tce.getLocationAsString(), tce);
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessageAndLocation
        LOG.warn(e.getMessageAndLocation());
    } 
 
    @Override 
    public void error(TransformerException e) throws TransformerException {
        LOG.error(e.getMessageAndLocation(), e);
    } 
 
    @Override 
    public void fatalError(TransformerException e) throws TransformerException {
        LOG.error(e.getMessageAndLocation(), e);
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage, getLocator
 
    public void error(TransformerException exception)
    throws TransformerException {
        final String message = getMessage(exception);
        if (this.logger != null) {
            this.logger.error(message, exception);
        } else { 
            System.out.println("ERROR: " + message);
        } 
        warnings.append("Error: ");
        warnings.append(message);
        warnings.append("\n");
    } 
 
    public void fatalError(TransformerException exception)
    throws TransformerException {
        final String message = getMessage(exception);
        if (this.logger != null) {
            this.logger.error(message, exception);
        } else { 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
	    Writer writer = new OutputStreamWriter(out, "UTF-8");
	    Result streamResult = new StreamResult(writer);
	    try { 
	    	transformer.transform(htmlSource, streamResult);
	    } catch (TransformerException e) {
	    	log.error(e.getMessage(), e);
	    	throw new IOException(e);
	    } 
	    result = out.toByteArray();
	    return result;
		} catch (Exception e) {
			throw new IOException(e);
		} 
	} 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
  { 
 
    String formattedMsg = XSLMessages.createWarning(msg, args);
    ErrorListener errHandler = xctxt.getErrorListener();
 
    errHandler.warning(new TransformerException(formattedMsg,
                                             (SAXSourceLocator)xctxt.getSAXLocator()));
  } 
 
  /** 
   * Overide the superclass method to allow one or two arguments.  
   * 
   * 
   * @param argNum Number of arguments passed in 
   * 
   * @throws WrongNumberArgsException 
   */ 
  public void checkNumberArgs(int argNum) throws WrongNumberArgsException
  { 
    if ((argNum > 3) || (argNum < 2))
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
            transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
 
            //need to nest outputStreamWriter to get around JDK 5 bug.  See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6296446 
            transformer.transform(new DOMSource(doc), new StreamResult(new OutputStreamWriter(outputStream, "utf-8")));
        } catch (TransformerException e) {
            throw new IOException(e.getMessage());
        } 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessageAndLocation
 
  // ErrorListener 
 
  @Override 
  public void warning(TransformerException e) {
    log.warn(e.getMessageAndLocation());
  } 
 
  @Override 
  public void error(TransformerException e) throws TransformerException {
    throw e;
  } 
 
  @Override 
  public void fatalError(TransformerException e) throws TransformerException {
    throw e;
  } 
 
  // XMLReporter 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessageAndLocation
   public void warning(TransformerException te) {
      LOG.warn(te.getMessageAndLocation());
   } 
 
   public void error(TransformerException te) {
      throw EXCEPTION_LOG.newException(STOCK_ERROR_MSG + te.getMessageAndLocation(), te, RuntimeException.class);
   } 
 
   public void fatalError(TransformerException te) {
      throw EXCEPTION_LOG.newException(STOCK_ERROR_MSG + te.getMessageAndLocation(), te, RuntimeException.class);
   } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessage
 
    private static final Logger LOG = LoggerFactory.getLogger(XmlErrorListener.class); 
     
    @Override 
    public void warning(TransformerException e) throws TransformerException {
        LOG.warn(e.getMessage(), e);
    } 
     
    @Override 
    public void error(TransformerException e) throws TransformerException {
        LOG.error(e.getMessage(), e);
    } 
 
    @Override 
    public void fatalError(TransformerException e) throws TransformerException {
        LOG.error(e.getMessage(), e);
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Java 8 TransformerException Questions & Answers:

See Code Examples for Java 8 TransformerException Methods: