Package com.sun.msv.verifier

Examples of com.sun.msv.verifier.Verifier


                    Log.error("WARNING: " + message);
                }
            }, saxFactory);
       
            ValidatorErrorHandler validatorErrorHandler = new ValidatorErrorHandler();
            Verifier verifier = new Verifier(docDeclaration, validatorErrorHandler);

            SAXWriter writer = new SAXWriter((ContentHandler) verifier);
            writer.setErrorHandler(validatorErrorHandler);

            writer.write(doc);
            if (verifier.isValid()) {
                return true;
            } else {
                Log.error(doc.getName() + " is invalid.");
                return false;
            }
View Full Code Here


                            SAXUnmarshallerHandler _core,
                            Locator locator ) {
       
        // create a VerifierFilter and configure it
        // so that error messages will be sent to the core,
        Verifier v = new Verifier(
            new REDocumentDeclaration(grammar),
            new ErrorHandlerAdaptor(_core,locator) );
        v.setPanicMode( true );

        return new ValidatingUnmarshaller(
            new VerifierFilter( v ), _core );
    }
View Full Code Here

                    Log.error("WARNING: " + message);
                }
            }, saxFactory);
       
            ValidatorErrorHandler validatorErrorHandler = new ValidatorErrorHandler();
            Verifier verifier = new Verifier(docDeclaration, validatorErrorHandler);

            SAXWriter writer = new SAXWriter((ContentHandler) verifier);
            writer.setErrorHandler(validatorErrorHandler);

            writer.write(doc);
            if (verifier.isValid()) {
                return true;
            } else {
                Log.error(doc.getName() + " is invalid.");
                return false;
            }
View Full Code Here

                            SAXUnmarshallerHandler _core,
                            Locator locator ) {
       
        // create a VerifierFilter and configure it
        // so that error messages will be sent to the core,
        Verifier v = new Verifier(
            new REDocumentDeclaration(grammar),
            new ErrorHandlerAdaptor(_core,locator) );
        v.setPanicMode( true );

        return new ValidatingUnmarshaller(
            new VerifierFilter( v ), _core );
    }
View Full Code Here

                            SAXUnmarshallerHandler _core,
                            Locator locator ) {
       
        // create a VerifierFilter and configure it
        // so that error messages will be sent to the core,
        Verifier v = new Verifier(
            new REDocumentDeclaration(grammar),
            new ErrorHandlerToEventHandler(_core,locator) );
        v.setPanicMode( true );

        return new ValidatingUnmarshaller(
            new VerifierFilter( v ), _core );
    }
View Full Code Here

                this.core = new VerifierFilter(core);
                this.core.setContentHandler(new SchematronVerifier());
        }
        public RelmesVerifier( DocumentDeclaration docDecl, ErrorHandler handler )
                                throws ParserConfigurationException {
                this(new Verifier(docDecl,handler));
        }
View Full Code Here

                    System.out.println( name + " completed" );
                    return;
                }
               
                XMLReader r = factory.newSAXParser().getXMLReader();
                Verifier v = new Verifier(
                    new REDocumentDeclaration(grammar),
//                    new REDocumentDeclaration(grammar.getTopLevel(),localPool),
                    new ErrorHandlerImpl() );
                r.setContentHandler(v);
                try
                {
                    r.parse(fileName);
                    if(!v.isValid()) throw new Error();
                    System.out.print('.');
                }
                catch( ValidityViolation vv )
                {
                    System.out.println( name + ':' + fileName + " invalid  " + vv.getMessage() );
View Full Code Here

     *
     * <p>
     * override this method to use a different verifier implementation.
     */
    protected IVerifier getVerifier( Grammar grammar ) {
        return new Verifier( new REDocumentDeclaration(grammar),
            new ReportErrorHandler() );
    }
View Full Code Here

       
        SimpleVerifier( DocumentDeclaration docDecl ) { this.docDecl = docDecl; }

        public boolean verify( XMLReader p, InputSource instance, boolean panicMode ) throws Exception {
            ReportErrorHandler reh = new ReportErrorHandler();
            Verifier v = new Verifier( docDecl, reh );
            v.setPanicMode(panicMode);
       
            p.setDTDHandler(v);
            p.setContentHandler(v);
            p.setErrorHandler(reh);
       
            p.parse( instance );
            return v.isValid();
        }
View Full Code Here

       
        XMLSchemaVerifier( XMLSchemaGrammar grammar ) { this.grammar = grammar; }

        public boolean verify( XMLReader p, InputSource instance, boolean panicMode ) throws Exception {
            ReportErrorHandler reh = new ReportErrorHandler();
            Verifier v = new IDConstraintChecker( grammar, reh );
            v.setPanicMode(panicMode);
       
            p.setDTDHandler(v);
            p.setContentHandler(v);
            p.setErrorHandler(reh);
       
            p.parse( instance );
            return v.isValid();
        }
View Full Code Here

TOP

Related Classes of com.sun.msv.verifier.Verifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.