1 25 26 package org.objectweb.easybeans.xmlconfig.mapping; 27 28 import java.util.HashMap ; 29 import java.util.Map ; 30 31 36 public class XMLMapping { 37 38 41 private Map <String , ClassMapping> classMappings = null; 42 43 46 public XMLMapping() { 47 this.classMappings = new HashMap <String , ClassMapping>(); 48 } 49 50 54 public void addClassMapping(final ClassMapping classMapping) { 55 classMappings.put(classMapping.getName(), classMapping); 56 String alias = classMapping.getAlias(); 57 if (alias != null) { 58 classMappings.put(alias, classMapping); 59 } 60 } 61 62 67 public ClassMapping getClassMapping(final String className) { 68 return classMappings.get(className); 69 } 70 71 75 @Override 76 public String toString() { 77 StringBuilder sb = new StringBuilder (); 78 sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1)); 80 sb.append("[classMappings="); 81 sb.append(classMappings); 82 sb.append("]"); 83 84 return sb.toString(); 85 } 86 } 87 | Popular Tags |