1 23 24 package org.objectweb.jorm.metainfo.lib; 25 26 import org.objectweb.jorm.metainfo.api.ClassMapping; 27 import org.objectweb.jorm.metainfo.api.GenClassMapping; 28 import org.objectweb.jorm.metainfo.api.Mapping; 29 import org.objectweb.jorm.metainfo.api.MetaObject; 30 31 import java.util.ArrayList ; 32 import java.util.Collection ; 33 import java.util.HashMap ; 34 import java.util.Map ; 35 36 39 public abstract class BasicMapping 40 extends BasicMetaObject 41 implements Mapping { 42 45 private String mapperName; 46 47 51 private ClassMapping classMapping; 52 53 67 private Map genClassMappings; 68 69 76 public BasicMapping(String mapperName, MetaObject parent) { 77 super(parent); 78 this.mapperName = mapperName; 79 classMapping = null; 80 genClassMappings = new HashMap (); 81 } 82 83 87 91 public String getMapperName() { 92 return mapperName; 93 } 94 95 99 public void setMapperName(String mapperName) { 100 this.mapperName = mapperName; 101 } 102 103 107 public ClassMapping getClassMapping() { 108 return classMapping; 109 } 110 111 115 public void setClassMapping(ClassMapping classMapping) { 116 this.classMapping = classMapping; 117 } 118 119 124 public GenClassMapping getGenClassMapping(String genClassId) { 125 return (GenClassMapping) genClassMappings.get(genClassId); 126 } 127 128 132 public Collection getGenClassMappings() { 133 return genClassMappings.values(); 134 } 135 136 141 public void addGenClassMapping(String genClassId, 142 GenClassMapping genClassMapping) { 143 genClassMappings.put(genClassId, genClassMapping); 144 } 145 146 protected Collection getChildren() { 147 ArrayList al = new ArrayList (); 148 al.add(classMapping); 149 al.addAll(genClassMappings.values()); 150 return al; 151 } 152 } 153 | Popular Tags |