Sha256: cbe6a67fe926f7a930ce6a67e302e347946e8b097084045ab434dabf2763fcde

Contents?: true

Size: 1.37 KB

Versions: 11

Compression:

Stored size: 1.37 KB

Contents

package nokogiri.internals;

import org.apache.xerces.xni.parser.XMLParseException;
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(boolean noerror, boolean nowarning)
  {
    super(noerror, nowarning);
  }

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

  public void
  error(SAXParseException spex) throws SAXException
  {
    if (!noerror) { throw spex; }
    else { errors.add(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 { errors.add(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; }
    if (!usesNekoHtml(domain)) { errors.add(e); }
  }
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nokogiri-1.12.4-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.12.3-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.12.2-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.12.1-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.12.0-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.12.0.rc1-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.11.7-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.11.6-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.11.5-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.11.4-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
nokogiri-1.11.3-java ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java