1 package org.objectweb.celtix.configuration.impl; 2 3 import java.util.Collection ; 4 import java.util.HashMap ; 5 import java.util.Map ; 6 7 public class TypeSchemaHelper { 8 9 private static Map <String , TypeSchema> map = new HashMap <String , TypeSchema>(); 10 11 private final boolean forceDefaults; 12 13 public TypeSchemaHelper(boolean fd) { 14 forceDefaults = fd; 15 } 16 17 public static void clearCache() { 18 map.clear(); 19 } 20 21 public TypeSchema get(String namespaceURI, String base, String location) { 22 TypeSchema ts = map.get(namespaceURI); 23 if (null == ts) { 24 ts = new TypeSchema(namespaceURI, base, location, forceDefaults); 25 map.put(namespaceURI, ts); 26 } 27 return ts; 28 } 29 30 public TypeSchema get(String namespaceURI) { 31 return map.get(namespaceURI); 32 } 33 34 public Collection <TypeSchema> getTypeSchemas() { 35 return map.values(); 36 } 37 38 public void put(String namespaceURI, TypeSchema ts) { 39 map.put(namespaceURI, ts); 40 } 41 } 42 | Popular Tags |