FileDocCategorySizeDatePackage
XSGrammarPool.javaAPI DocJava SE 6 API2234Tue Jun 10 00:22:48 BST 2008com.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.
xerces.internal
version
$Id: XSGrammarPool.java,v 1.2.6.1 2005/09/09 07:28:12 sunithareddy 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);