1 57 58 package com.sun.org.apache.xerces.internal.impl.dtd; 59 60 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; 61 import java.util.Hashtable ; 62 63 76 public class DTDGrammarBucket { 77 78 80 84 85 protected Hashtable fGrammars; 86 87 protected DTDGrammar fActiveGrammar; 90 91 protected boolean fIsStandalone; 93 94 98 99 public DTDGrammarBucket() { 100 fGrammars = new Hashtable (); 101 } 103 107 113 public void putGrammar(DTDGrammar grammar) { 114 XMLDTDDescription desc = (XMLDTDDescription)grammar.getGrammarDescription(); 115 fGrammars.put(desc, grammar); 116 } 118 public DTDGrammar getGrammar(XMLGrammarDescription desc) { 120 return (DTDGrammar)(fGrammars.get((XMLDTDDescription)desc)); 121 } 123 public void clear() { 124 fGrammars.clear(); 125 fActiveGrammar = null; 126 fIsStandalone = false; 127 } 129 void setStandalone(boolean standalone) { 133 fIsStandalone = standalone; 134 } 135 136 boolean getStandalone() { 137 return fIsStandalone; 138 } 139 140 void setActiveGrammar (DTDGrammar grammar) { 142 fActiveGrammar = grammar; 143 } 144 DTDGrammar getActiveGrammar () { 145 return fActiveGrammar; 146 } 147 } | Popular Tags |