FileDocCategorySizeDatePackage
RNGValidator.javaAPI DocGlassfish v2 API6554Fri May 04 22:24:38 BST 2007com.sun.enterprise.config.serverbeans.validation

RNGValidator

public class RNGValidator extends Object

Fields Summary
Constructors Summary
Methods Summary
private org.iso_relax.verifier.VerifiergetVerifier(org.xml.sax.InputSource schema, org.xml.sax.ErrorHandler eh)

        return getVerifier(schema, null, eh);
    
private org.iso_relax.verifier.VerifiergetVerifier(org.xml.sax.InputSource schema, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh)

            // As of the 20030108 release of jarv this method doesn't
            // work. The new release added a class loader and that
            // seems to screw things up.
//         final VerifierFactory f =
//         VerifierFactory.newInstance("http://relaxng.org/ns/structure/1.0");
        final VerifierFactory f = new com.sun.msv.verifier.jarv.TheFactoryImpl();
        final Verifier verifier = f.newVerifier(schema);
        verifier.setErrorHandler(eh);
        verifier.setEntityResolver(er);
        return verifier;
    
voidvalidate(org.xml.sax.InputSource schema, org.xml.sax.InputSource src, java.io.Writer w)

         validate(schema, src, new MyErrorHandler(w));
    
voidvalidate(org.xml.sax.InputSource schema, org.xml.sax.InputSource src, org.xml.sax.XMLReader rdr, java.io.Writer w)

         validate(schema, src, rdr,  new MyErrorHandler(w) );
    
voidvalidate(org.xml.sax.InputSource schema, org.xml.sax.InputSource src, org.xml.sax.ErrorHandler eh)

        getVerifier(schema, eh).verify(src);
    
voidvalidate(org.xml.sax.InputSource schema, org.xml.sax.InputSource src, org.xml.sax.XMLReader rdr, org.xml.sax.ErrorHandler errorHandler)
Validate the given source against the given schema, using the given reader to parser the source, handling errors using the given {@link ErrorHandler}

param
schema the RELAX NG schema to be used to validate the source document
param
src the source document to be validated
param
rdr the reader used to parse the source document
param
errorHandler used to handle errors during the parse and validation
throws
VerifierConfigurationException if the verifier cannot be configured
throws
SAXException if there's a fatal exception from the SAX layer
throws
IOException if the IO fails

        rdr.setContentHandler(getVerifier(schema, rdr.getEntityResolver(), errorHandler).getVerifierHandler());
        rdr.parse(src);