1 7 package org.jboss.webservice.deployment; 8 9 11 import org.jboss.logging.Logger; 12 13 import javax.xml.namespace.QName ; 14 import java.util.HashMap ; 15 16 46 public class MetaDataRegistry 47 { 48 private final Logger log = Logger.getLogger(MetaDataRegistry.class); 50 51 private HashMap typeMappingMetaData = new HashMap (); 52 53 public void registerTypeMappingMetaData(TypeMappingDescription typeMapping) 54 { 55 QName qname = typeMapping.getTypeQName(); 56 BeanXMLMetaData metaData = typeMapping.getMetaData(); 57 if (metaData == null) 58 throw new IllegalArgumentException ("Cannot register null meta data"); 59 60 if (isTypeMappingMetaDataRegisterd(qname) == false || typeMapping.isUserDefined()) 61 { 62 log.debug("Register type mapping meta data for: " + qname); 63 typeMappingMetaData.put(qname, metaData); 64 } 65 else 66 { 67 log.debug("Ignore register type mapping meta data for: " + qname); 68 } 69 } 70 71 public BeanXMLMetaData getTypeMappingMetaData(QName typeName) 72 { 73 return (BeanXMLMetaData)typeMappingMetaData.get(typeName); 74 } 75 76 public boolean isTypeMappingMetaDataRegisterd(QName typeName) 77 { 78 return typeMappingMetaData.get(typeName) != null; 79 } 80 81 public void unregisterTypeMappingMetaData(QName typeName) 82 { 83 typeMappingMetaData.remove(typeName); 84 } 85 } 86 | Popular Tags |