1 18 package org.objectweb.speedo.generation.mivisitor; 19 20 import org.objectweb.speedo.api.SpeedoException; 21 import org.objectweb.speedo.api.SpeedoProperties; 22 import org.objectweb.speedo.generation.enhancer.MetaDataAnalyzer; 23 import org.objectweb.speedo.generation.lib.AbstractGeneratorComponent; 24 25 32 public class MetaInfoVisitors extends AbstractGeneratorComponent { 33 34 public final static String LOGGER_NAME 35 = SpeedoProperties.LOGGER_NAME + ".generation.compiler"; 36 private AbstractMetaInfoVisitor[] modifiers; 37 38 public boolean init() throws SpeedoException { 39 if (scp.getXmldescriptor().isEmpty()) { 40 return false; 41 } 42 logger = scp.loggerFactory.getLogger(LOGGER_NAME); 43 modifiers = new AbstractMetaInfoVisitor[] { 44 new MetaInfoVisitorImpl(), 45 new TupleExtensionCopier(), 46 new KeyFieldChecker(), 47 new ReverseFieldAdder(), 48 new InheritanceVisitor(), 49 new MetaDataAnalyzer(), 50 new PrimaryKeyFieldAdder(), 51 new JavaLangShorcutVisitor(), 52 new VersionFieldAdder(), 53 new DataStoreIdAdder(), 54 new FieldConverterVisitor(), 55 new ExtensionVerifier() 56 }; 57 for(int i=1; i<modifiers.length; i++) { 58 modifiers[i-1].setSpeedoCompilerParameter(scp); 59 modifiers[i-1].init(); 60 modifiers[i-1].setNext(modifiers[i]); 61 } 62 return true; 63 } 64 65 public void process() throws SpeedoException { 66 modifiers[0].visitCompilerParameter(scp); 67 } 68 } 69 | Popular Tags |