FileDocCategorySizeDatePackage
XSGrammarPool.javaAPI DocApache Xerces 3.0.12321Fri Sep 14 20:33:56 BST 2007org.apache.xerces.impl.xs.util

XSGrammarPool

public class XSGrammarPool extends org.apache.xerces.util.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 446723 2006-09-15 20:37:45Z mrglavas $

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

return
an XSModel representing this schema grammar

        ArrayList list = new ArrayList();
        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.add(entry.grammar);
            }
        }

        int size = list.size();
        if (size == 0) {
            return null;
        }
        SchemaGrammar[] gs = (SchemaGrammar[])list.toArray(new SchemaGrammar[size]);
        return new XSModelImpl(gs);