Package com.sun.msv.grammar

Examples of com.sun.msv.grammar.ExpressionPool


                                r.markSchemaAsDefined(r.currentSchema);
                            }
                        }
                    };
                }               
            }, new ExpressionPool());
        }
View Full Code Here


   
    private static Grammar deserialize( InputStream is ) {
        try {
            ObjectInputStream ois = new ObjectInputStream( is );
            final Expression exp = (Expression)ois.readObject();
            final ExpressionPool pool = (ExpressionPool)ois.readObject();
            ois.close();
       
            return new Grammar() {
                public Expression getTopLevel() { return exp; }
                public ExpressionPool getPool() { return pool; }
View Full Code Here

     * Computes the union of two grammars.
     */
    private Grammar union( Grammar g1, Grammar g2 ) {
        // either g1.getPool() or g2.getPool() is OK.
        // this is just a metter of performance problem.
        final ExpressionPool pool = g1.getPool();
        final Expression top = pool.createChoice(g1.getTopLevel(),g2.getTopLevel());
       
        return new Grammar() {
            public ExpressionPool getPool() {
                return pool;
            }
View Full Code Here

                return reader.getResult();
        }

        /** easy-to-use constructor. */
        public SRELAXNGReader( GrammarReaderController controller, SAXParserFactory parserFactory) {
                this( controller, parserFactory, new ExpressionPool() );
        }
View Full Code Here

     */
    public void setPool( ExpressionPool pool ) {
        this.pool = pool;
    }
    public ExpressionPool getPool() {
        if( pool==null)        return new ExpressionPool();
        else                return pool;
    }
View Full Code Here

        return reader.getResult();
    }

    /** easy-to-use constructor. */
    public RELAXNGCompReader( GrammarReaderController controller ) {
        this(controller,createParserFactory(),new ExpressionPool());
    }
View Full Code Here

    }
   
    public XMLSchemaReader(
        GrammarReaderController controller,
        SAXParserFactory parserFactory ) {
        this( controller, parserFactory, new ExpressionPool() );
    }
View Full Code Here

    /** easy-to-use constructor. */
    public RELAXNGReader(
        GrammarReaderController controller,
        SAXParserFactory parserFactory) {
        // TODO: add s4s
        this(controller,parserFactory,new StateFactory(),new ExpressionPool());
    }
View Full Code Here

   
    /** loads TREX pattern */
    public static TREXGrammar parse( String grammarURL,
        SAXParserFactory factory, GrammarReaderController controller )
    {
        TREXGrammarReader reader = new TREXGrammarReader(controller,factory,new ExpressionPool());
        reader.parse(grammarURL);
       
        return reader.getResult();
    }
View Full Code Here

   
    /** loads TREX pattern */
    public static TREXGrammar parse( InputSource grammar,
        SAXParserFactory factory, GrammarReaderController controller )
    {
        TREXGrammarReader reader = new TREXGrammarReader(controller,factory,new ExpressionPool());
        reader.parse(grammar);
       
        return reader.getResult();
    }
View Full Code Here

TOP

Related Classes of com.sun.msv.grammar.ExpressionPool

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.