FileDocCategorySizeDatePackage
XSGrammarPool.javaAPI DocJava SE 5 API4264Fri Aug 26 14:55:52 BST 2005com.sun.org.apache.xerces.internal.impl.xs.util

XSGrammarPool

public class XSGrammarPool extends XMLGrammarPoolImpl
Add a method that return an XSModel that represents components in the schema grammars in this pool implementation.*
version
$Id: XSGrammarPool.java,v 1.2 2003/11/11 20:15:00 sandygao Exp $

Fields Summary
Constructors Summary
Methods Summary
public com.sun.org.apache.xerces.internal.xs.XSModeltoXSModel()
Return an XSModel that represents components in the schema grammars in this pool implementation.

return
an XSModel representing this schema grammar

        java.util.Vector list = new java.util.Vector();
        for (int i = 0; i < fGrammars.length; i++) {
            for (Entry entry = fGrammars[i] ; entry != null ; entry = entry.next) {
                if (entry.desc.getGrammarType().equals(XMLGrammarDescription.XML_SCHEMA))
                    list.addElement(entry.grammar);
            }
        }

        int size = list.size();
        if (size == 0)
            return null;
        SchemaGrammar[] gs = new SchemaGrammar[size];
        for (int i = 0; i < size; i++)
            gs[i] = (SchemaGrammar)list.elementAt(i);
        return new XSModelImpl(gs);