1 57 58 package com.sun.org.apache.xerces.internal.impl.dv.dtd; 59 60 import java.util.Enumeration ; 61 import java.util.Hashtable ; 62 63 import com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator; 64 65 72 public class XML11DTDDVFactoryImpl extends DTDDVFactoryImpl { 73 74 static Hashtable fXML11BuiltInTypes = new Hashtable (); 75 76 84 public DatatypeValidator getBuiltInDV(String name) { 85 if(fXML11BuiltInTypes.get(name) != null) { 86 return (DatatypeValidator)fXML11BuiltInTypes.get(name); 87 } 88 return (DatatypeValidator)fBuiltInTypes.get(name); 89 } 90 91 97 public Hashtable getBuiltInTypes() { 98 Hashtable toReturn = (Hashtable )fBuiltInTypes.clone(); 99 Enumeration xml11Keys = fXML11BuiltInTypes.keys(); 100 while (xml11Keys.hasMoreElements()) { 101 Object key = xml11Keys.nextElement(); 102 toReturn.put(key, fXML11BuiltInTypes.get(key)); 103 } 104 return toReturn; 105 } 106 107 static { 108 fXML11BuiltInTypes.put("XML11ID", new XML11IDDatatypeValidator()); 109 DatatypeValidator dvTemp = new XML11IDREFDatatypeValidator(); 110 fXML11BuiltInTypes.put("XML11IDREF", dvTemp); 111 fXML11BuiltInTypes.put("XML11IDREFS", new ListDatatypeValidator(dvTemp)); 112 dvTemp = new XML11NMTOKENDatatypeValidator(); 113 fXML11BuiltInTypes.put("XML11NMTOKEN", dvTemp); 114 fXML11BuiltInTypes.put("XML11NMTOKENS", new ListDatatypeValidator(dvTemp)); 115 } 117 118 } 120 | Popular Tags |