Sha256: 22490dc4acfada9449229953eca2326a7ed4325afc9ec5fbb644b0d6e2b2d3d7

Contents?: true

Size: 1.09 KB

Versions: 46

Compression:

Stored size: 1.09 KB

Contents

package nokogiri.internals;

import javax.xml.transform.ErrorListener;
import javax.xml.transform.TransformerException;

/**
 * Error Listener for XSLT transformer
 *
 * @author Yoko Harada <yokolet@gmail.com>
 */
public class NokogiriXsltErrorListener implements ErrorListener
{
  public enum ErrorType {
    SUCCESS,
    WARNING,
    ERROR,
    FATAL
  }

  private ErrorType type = ErrorType.SUCCESS;
  private String errorMessage = null;
  private Exception exception = null;

  public void
  warning(TransformerException ex)
  {
    type = ErrorType.WARNING;
    setError(ex);
  }

  public void
  error(TransformerException ex)
  {
    type = ErrorType.ERROR;
    setError(ex);
  }

  public void
  fatalError(TransformerException ex)
  {
    type = ErrorType.FATAL;
    setError(ex);
  }

  private void
  setError(TransformerException ex)
  {
    errorMessage = ex.getMessage();
    exception = ex;
  }

  public String
  getErrorMessage()
  {
    return errorMessage;
  }

  public ErrorType
  getErrorType()
  {
    return type;
  }

  public Exception
  getException()
  {
    return exception;
  }

}

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
nokogiri-1.14.1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.14.0-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.14.0.rc1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.10-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.9-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.8-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.7-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.6-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.5-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.4-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.3-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.2-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.13.0-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.12.5-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.12.4-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.12.3-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.12.2-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.12.1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.12.0-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java