1 23 24 package org.objectweb.jorm.mi2xml.lib; 25 26 import org.objectweb.jorm.util.api.Loggable; 27 import org.objectweb.jorm.mi2xml.api.MappingDomtreeBuilder; 28 import org.objectweb.jorm.metainfo.api.Class; 29 import org.objectweb.jorm.metainfo.api.ClassMapping; 30 import org.objectweb.jorm.metainfo.api.GenClassMapping; 31 import org.objectweb.jorm.api.PException; 32 import org.objectweb.util.monolog.api.Logger; 33 import org.objectweb.util.monolog.api.LoggerFactory; 34 import org.w3c.dom.Element ; 35 import org.w3c.dom.Document ; 36 37 import java.util.Map ; 38 import java.util.Hashtable ; 39 40 43 public abstract class BasicMappingDomtreeBuilder implements MappingDomtreeBuilder, Loggable { 44 45 48 protected Class currentClass; 49 50 53 protected Map metaobject2idvalue = new Hashtable (); 54 55 58 protected Logger logger; 59 60 63 protected LoggerFactory loggerFactory; 64 65 69 74 public void setCurrentClass(Class currentClass) { 75 this.currentClass = currentClass; 76 } 77 78 83 public void setmetaobject2idvalue(Map metaobject2idvalue) { 84 this.metaobject2idvalue = metaobject2idvalue; 85 } 86 87 93 public abstract void processClassMapping(Document document, Element mappingElement, 94 ClassMapping classMapping) throws PException; 95 96 102 public abstract void processGenClassMapping(Document document, Element mappingElement, 103 GenClassMapping genClassMapping) throws PException; 104 105 109 114 public void setLogger(Logger logger) { 115 this.logger = logger; 116 } 117 118 123 public void setLoggerFactory(LoggerFactory loggerfactory) { 124 this.loggerFactory = loggerfactory; 125 if (logger == null && loggerFactory != null) { 126 logger = loggerFactory.getLogger("org.objectweb.jorm.mi2xml.rdb"); 127 } 128 } 129 130 public Logger getLogger() { 131 return logger; 132 } 133 134 public LoggerFactory getLoggerFactory() { 135 return loggerFactory; 136 } 137 } 138 | Popular Tags |