1 16 17 package org.apache.xerces.impl.dv.dtd; 18 19 import java.util.Enumeration ; 20 import java.util.Hashtable ; 21 22 import org.apache.xerces.impl.dv.DatatypeValidator; 23 24 33 public class XML11DTDDVFactoryImpl extends DTDDVFactoryImpl { 34 35 static Hashtable fXML11BuiltInTypes = new Hashtable (); 36 37 45 public DatatypeValidator getBuiltInDV(String name) { 46 if(fXML11BuiltInTypes.get(name) != null) { 47 return (DatatypeValidator)fXML11BuiltInTypes.get(name); 48 } 49 return (DatatypeValidator)fBuiltInTypes.get(name); 50 } 51 52 58 public Hashtable getBuiltInTypes() { 59 Hashtable toReturn = (Hashtable )fBuiltInTypes.clone(); 60 Enumeration xml11Keys = fXML11BuiltInTypes.keys(); 61 while (xml11Keys.hasMoreElements()) { 62 Object key = xml11Keys.nextElement(); 63 toReturn.put(key, fXML11BuiltInTypes.get(key)); 64 } 65 return toReturn; 66 } 67 68 static { 69 fXML11BuiltInTypes.put("XML11ID", new XML11IDDatatypeValidator()); 70 DatatypeValidator dvTemp = new XML11IDREFDatatypeValidator(); 71 fXML11BuiltInTypes.put("XML11IDREF", dvTemp); 72 fXML11BuiltInTypes.put("XML11IDREFS", new ListDatatypeValidator(dvTemp)); 73 dvTemp = new XML11NMTOKENDatatypeValidator(); 74 fXML11BuiltInTypes.put("XML11NMTOKEN", dvTemp); 75 fXML11BuiltInTypes.put("XML11NMTOKENS", new ListDatatypeValidator(dvTemp)); 76 } 78 79 } 81 | Popular Tags |