1 16 17 package org.apache.xerces.impl.dv.dtd; 18 19 import org.apache.xerces.impl.dv.DTDDVFactory; 20 import org.apache.xerces.impl.dv.DatatypeValidator; 21 import java.util.Hashtable ; 22 23 32 public class DTDDVFactoryImpl extends DTDDVFactory { 33 34 static Hashtable fBuiltInTypes = new Hashtable (); 35 static { 36 createBuiltInTypes(); 37 } 38 39 45 public DatatypeValidator getBuiltInDV(String name) { 46 return (DatatypeValidator)fBuiltInTypes.get(name); 47 } 48 49 54 public Hashtable getBuiltInTypes() { 55 return (Hashtable )fBuiltInTypes.clone(); 56 } 57 58 static void createBuiltInTypes() { 60 61 DatatypeValidator dvTemp; 62 63 fBuiltInTypes.put("string", new StringDatatypeValidator()); 64 fBuiltInTypes.put("ID", new IDDatatypeValidator()); 65 dvTemp = new IDREFDatatypeValidator(); 66 fBuiltInTypes.put("IDREF", dvTemp); 67 fBuiltInTypes.put("IDREFS", new ListDatatypeValidator(dvTemp)); 68 dvTemp = new ENTITYDatatypeValidator(); 69 fBuiltInTypes.put("ENTITY", new ENTITYDatatypeValidator()); 70 fBuiltInTypes.put("ENTITIES", new ListDatatypeValidator(dvTemp)); 71 fBuiltInTypes.put("NOTATION", new NOTATIONDatatypeValidator()); 72 dvTemp = new NMTOKENDatatypeValidator(); 73 fBuiltInTypes.put("NMTOKEN", dvTemp); 74 fBuiltInTypes.put("NMTOKENS", new ListDatatypeValidator(dvTemp)); 75 76 } 78 } 80 | Popular Tags |