FileDocCategorySizeDatePackage
DTDGrammarBucket.javaAPI DocJava SE 5 API5465Fri Aug 26 14:55:46 BST 2005com.sun.org.apache.xerces.internal.impl.dtd

DTDGrammarBucket

public class DTDGrammarBucket extends Object
This very simple class is the skeleton of what the DTDValidator could use to store various grammars that it gets from the GrammarPool. As in the case of XSGrammarBucket, one thinks of this object as being closely associated with its validator; when fully mature, this class will be filled from the GrammarPool when the DTDValidator is invoked on a document, and, if a new DTD grammar is parsed, the new set will be offered back to the GrammarPool for possible inclusion.
author
Neil Graham, IBM
version
$Id: DTDGrammarBucket.java,v 1.5 2002/06/13 23:04:14 neilg Exp $

Fields Summary
protected Hashtable
fGrammars
Grammars associated with element root name.
protected DTDGrammar
fActiveGrammar
protected boolean
fIsStandalone
Constructors Summary
public DTDGrammarBucket()
Default constructor.

        fGrammars = new Hashtable();
    
Methods Summary
public voidclear()

        fGrammars.clear();
        fActiveGrammar = null;
        fIsStandalone = false;
    
com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammargetActiveGrammar()

        return fActiveGrammar;
    
public com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammargetGrammar(com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription desc)

        return (DTDGrammar)(fGrammars.get((XMLDTDDescription)desc));
    
booleangetStandalone()

        return fIsStandalone;
    
public voidputGrammar(com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar grammar)
Puts the specified grammar into the grammar pool and associate it to a root element name (this being internal, the lack of generality is irrelevant).

param
grammar The grammar.

        XMLDTDDescription desc = (XMLDTDDescription)grammar.getGrammarDescription();
        fGrammars.put(desc, grammar);
    
voidsetActiveGrammar(com.sun.org.apache.xerces.internal.impl.dtd.DTDGrammar grammar)

        fActiveGrammar = grammar;
    
voidsetStandalone(boolean standalone)

        fIsStandalone = standalone;