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