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.16.7-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.6-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.4-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.6-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.3-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.2-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.0-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.16.0.rc1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
Nokogiri_precompiled_aarch64_dedshit-1.14.5 ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.5-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.4-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.3-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.2-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.14.5-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.1-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.15.0-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.14.4-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.14.3-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
nokogiri-1.14.2-java ext/java/nokogiri/internals/NokogiriXsltErrorListener.java