1 16 17 package org.apache.xerces.impl.dtd; 18 19 import org.apache.xerces.xni.grammars.XMLGrammarDescription; 20 import java.util.Hashtable ; 21 22 37 public class DTDGrammarBucket { 38 39 41 45 46 protected Hashtable fGrammars; 47 48 protected DTDGrammar fActiveGrammar; 51 52 protected boolean fIsStandalone; 54 55 59 60 public DTDGrammarBucket() { 61 fGrammars = new Hashtable (); 62 } 64 68 74 public void putGrammar(DTDGrammar grammar) { 75 XMLDTDDescription desc = (XMLDTDDescription)grammar.getGrammarDescription(); 76 fGrammars.put(desc, grammar); 77 } 79 public DTDGrammar getGrammar(XMLGrammarDescription desc) { 81 return (DTDGrammar)(fGrammars.get((XMLDTDDescription)desc)); 82 } 84 public void clear() { 85 fGrammars.clear(); 86 fActiveGrammar = null; 87 fIsStandalone = false; 88 } 90 void setStandalone(boolean standalone) { 94 fIsStandalone = standalone; 95 } 96 97 boolean getStandalone() { 98 return fIsStandalone; 99 } 100 101 void setActiveGrammar (DTDGrammar grammar) { 103 fActiveGrammar = grammar; 104 } 105 DTDGrammar getActiveGrammar () { 106 return fActiveGrammar; 107 } 108 } | Popular Tags |