001    package com.thaiopensource.datatype.xsd;
002    
003    import org.relaxng.datatype.DatatypeLibrary;
004    import org.relaxng.datatype.DatatypeLibraryFactory;
005    import com.thaiopensource.xml.util.WellKnownNamespaces;
006    
007    public class DatatypeLibraryFactoryImpl implements DatatypeLibraryFactory {
008    
009      private DatatypeLibrary datatypeLibrary = null;
010    
011      public DatatypeLibrary createDatatypeLibrary(String uri) {
012        if (!WellKnownNamespaces.XML_SCHEMA_DATATYPES.equals(uri))
013          return null;
014        synchronized (this) {
015          if (datatypeLibrary == null)
016            datatypeLibrary = new DatatypeLibraryImpl();
017          return datatypeLibrary;
018        }
019      }
020    }