Examples of ExpressionPool


Examples of com.sun.msv.grammar.ExpressionPool

    }

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

Examples of com.sun.msv.grammar.ExpressionPool

* @author <a href="mailto:kohsuke.kawaguchi@eng.sun.com">Kohsuke KAWAGUCHI</a>
*/
public class XMLSchemaGrammar implements Grammar {

    public XMLSchemaGrammar() {
        this( new ExpressionPool() );
    }
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

    /**
     * Creates the expression that corresponds to
     * the current attribute wildcard specification.
     */
    public Expression createExpression( XMLSchemaGrammar grammar ) {
        final ExpressionPool pool = grammar.pool;
       
        switch(processMode) {
        case SKIP:
            return pool.createZeroOrMore(pool.createAttribute(name));
           
        case STRICT:
        case LAX:
           
            Expression exp = Expression.epsilon;
            LaxDefaultNameClass laxNc = new LaxDefaultNameClass(name);
           
            Iterator itr = grammar.iterateSchemas();
            while( itr.hasNext() ) {
                XMLSchemaSchema schema = (XMLSchemaSchema)itr.next();
                // nc is built by using NamespaceNameClass.
                // "strict" allows global element declarations of
                // specified namespaces.
                if(name.accepts( schema.targetNamespace, NameClass.LOCALNAME_WILDCARD )) {
                   
                    // gather global attributes.
                    ReferenceExp[] atts = schema.attributeDecls.getAll();
                    for( int i=0; i<atts.length; i++ ) {
                        exp = pool.createSequence( pool.createOptional(atts[i]), exp );
                        laxNc.addName( schema.targetNamespace, atts[i].name );
                    }
                }
            }
               
            if( processMode==STRICT )
                // if processContents="strict", then that's it.
                return exp;
               
            // if "lax", we have to add an expression to
            // match other attributes.
            return pool.createSequence(
                pool.createZeroOrMore(pool.createAttribute(laxNc)), exp );
       
        default:
            throw new Error("undefined process mode:"+processMode);
        }
    }
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

    }
   
    public static TREXGrammar parse( InputSource source,
        GrammarReaderController controller ) {
       
        return parse( source, controller, new ExpressionPool() );
    }
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

    if( random==null )      random = new Random();
    if( cutBackDepth==0 )    cutBackDepth=5;
    if( width==null )      width = new Rand.UniformRand( random, 3 );
    if( nameGenerator==null nameGenerator = new NameGenerator(random);
    if( dtGenerator==null )    dtGenerator = new DataTypeGeneratorImpl();
    if( pool==null )      pool = new ExpressionPool();
  }
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

            try {
          if(dtdAsSchema) {
            grammar = DTDReader.parse(
              is,
              new DebugController(warning,quiet),
              new ExpressionPool());
          } else {
            grammar = GrammarLoader.loadSchema(
              is,
              new DebugController(warning,quiet),
              factory);
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

* @author <a href="mailto:kohsuke.kawaguchi@eng.sun.com">Kohsuke KAWAGUCHI</a>
*/
public class RELAXCoreFactoryImpl extends FactoryImpl
{
    protected Grammar parse( InputSource is, GrammarReaderController controller ) {
        return RELAXCoreReader.parse(is,factory,controller,new ExpressionPool());
    }
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

        this.pool = pool;
        this.parentGrammar = parentGrammar;
    }
   
    public TREXGrammar( ExpressionPool pool )    { this(pool,null); }
    public TREXGrammar() { this(new ExpressionPool(),null); }
View Full Code Here

Examples of com.sun.msv.grammar.ExpressionPool

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

Examples of com.sun.msv.grammar.ExpressionPool

            SAXParserFactory spf = SAXParserFactory.newInstance();
            spf.setNamespaceAware(true);
            GrammarReader reader = new SchmitRELAXNGReader(
                new DebugController(false),
                spf,
                new ExpressionPool() );
           
            reader.parse(href);
            Grammar grammar = reader.getResultAsGrammar();
           
    //        // remember this association
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.