Package com.sun.msv.verifier

Examples of com.sun.msv.verifier.Verifier


       
        if(!validate)    break;
       
        // check the validity of generated document.
        DOM2toSAX2 d2s = new DOM2toSAX2();
        Verifier v = new Verifier(
          new REDocumentDeclaration(grammar),
          debug?
            (ErrorHandler)new ErrorHandlerImpl():
            (ErrorHandler)new IgnoreErrorHandler() );
        d2s.setContentHandler(v);
        d2s.traverse(dom);
       
        if( createError && !v.isValid() )  break;
        if( !createError && v.isValid() )  break;
       
        // do it again
        if( retry++ == 100 ) {
          out.println("unable to generate a proper instance.");
          return -1;
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 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 ErrorHandlerAdaptor(_core,locator) );
        v.setPanicMode( true );

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

    /**
     * Creates a new instance of Verifier that will be used to validate
     * a document.
     */
    protected IVerifier getVerifier( Grammar grammar ) {
        return new Verifier( new REDocumentDeclaration(grammar),
            new WordlessErrorReporter() );
    }
View Full Code Here

    this.schChecker = new SchematronVerifier();
    this.core.setContentHandler(schChecker);
  }
  public RelmesVerifier( DocumentDeclaration docDecl, ErrorHandler handler )
        throws ParserConfigurationException {
    this(new Verifier(docDecl,handler));
  }
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

       
        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.