Sha256: cfe2f663b5d67f47a4165c27eda52c4c7fef5dc6dd5dec51245ddf41874b57fc

Contents?: true

Size: 1.39 KB

Versions: 34

Compression:

Stored size: 1.39 KB

Contents

package nokogiri.internals;

import org.apache.xerces.xni.parser.XMLParseException;
import org.jruby.Ruby;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

/**
 * Strict error handler. Even though strict is specified, Nokogiri allows to go further
 * when NOERROR or/both NOWARNING is/are true.
 *
 * @author sergio
 * @author Yoko Harada <yokolet@gmail.com>
 */
public class NokogiriStrictErrorHandler extends NokogiriErrorHandler
{
  public
  NokogiriStrictErrorHandler(Ruby runtime, boolean noerror, boolean nowarning)
  {
    super(runtime, noerror, nowarning);
  }

  public void
  warning(SAXParseException spex) throws SAXException
  {
    if (!nowarning) { throw spex; }
    else { addError(spex); }
  }

  public void
  error(SAXParseException spex) throws SAXException
  {
    if (!noerror) { throw spex; }
    else { addError(spex); }
  }

  public void
  fatalError(SAXParseException spex) throws SAXException
  {
    throw spex;
  }

  public void
  error(String domain, String key, XMLParseException e) throws XMLParseException
  {
    if (!noerror) { throw e; }
    else { addError(e); }
  }

  public void
  fatalError(String domain, String key, XMLParseException e) throws XMLParseException
  {
    throw e;
  }

  public void
  warning(String domain, String key, XMLParseException e) throws XMLParseException
  {
    if (!nowarning) { throw e; }
    else { addError(e); }
  }
}

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
nokogiri-1.14.1-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.14.0-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.14.0.rc1-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.10-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.9-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.8-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.7-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.6-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.5-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.4-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.3-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.2-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.1-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.13.0-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java