All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thaiopensource.relaxng.jarv.VerifierImpl Maven / Gradle / Ivy

There is a newer version: 20151127.0.1
Show newest version
package com.thaiopensource.relaxng.jarv;

import com.thaiopensource.relaxng.pattern.Pattern;
import com.thaiopensource.relaxng.pattern.ValidatorPatternBuilder;
import com.thaiopensource.xml.sax.CountingErrorHandler;
import org.iso_relax.verifier.VerifierConfigurationException;
import org.iso_relax.verifier.VerifierHandler;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;

class VerifierImpl extends org.iso_relax.verifier.impl.VerifierImpl {
  private final VerifierHandlerImpl vhi;
  private boolean needReset = false;

  VerifierImpl(Pattern start, ValidatorPatternBuilder builder) throws VerifierConfigurationException {
    vhi = new VerifierHandlerImpl(start, builder,
                                  new CountingErrorHandler(errorHandler));
    reader.setDTDHandler(vhi);
  }

  public VerifierHandler getVerifierHandler() throws SAXException {
    if (needReset)
      vhi.reset();
    else
      needReset = true;
    return vhi;
  }

  public void setErrorHandler(ErrorHandler handler) {
    vhi.setErrorHandler(handler);
    super.setErrorHandler(handler);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy