1 23 24 package org.objectweb.jorm.metainfo.lib; 25 26 import org.objectweb.jorm.metainfo.api.MappingStructure; 27 import org.objectweb.jorm.metainfo.api.MetaObject; 28 import org.objectweb.jorm.metainfo.api.Mapping; 29 import org.objectweb.jorm.metainfo.api.ClassProject; 30 import org.objectweb.util.monolog.api.Logger; 31 import org.objectweb.util.monolog.api.LoggerFactory; 32 import org.objectweb.jorm.util.api.Loggable; 33 34 37 public class BasicMappingStructure 38 extends BasicMetaObject 39 implements MappingStructure { 40 41 44 protected MetaObject linkedMO; 45 46 50 public BasicMappingStructure(MetaObject parent, MetaObject linkedMO) { 51 super(parent); 52 this.linkedMO = linkedMO; 53 } 54 55 59 64 public MetaObject getLinkedMO() { 65 return linkedMO; 66 } 67 68 72 public void setLinkedMO(MetaObject linkedMO) { 73 this.linkedMO = linkedMO; 74 } 75 76 80 public String getMapperName() { 81 MetaObject mo = this; 82 while (!(mo instanceof Mapping)) { 83 mo = mo.getParent(); 84 } 85 return (mo != null 86 ? ((Mapping) mo).getMapperName() 87 : ""); 88 } 89 90 94 public String getProjectName() { 95 MetaObject mo = getParent(); 96 while (! (mo instanceof ClassProject)) { 97 mo = mo.getParent(); 98 } 99 return (mo != null 100 ? ((ClassProject) mo).getProjectName() 101 : ""); 102 } 103 } 104 | Popular Tags |