1 23 package org.objectweb.medor.optim.jorm; 24 25 import org.objectweb.medor.lib.Log; 26 import org.objectweb.medor.optim.api.LeafRewriteRule; 27 import org.objectweb.medor.optim.api.LeafRewriter; 28 import org.objectweb.medor.optim.lib.BasicQueryRewriter; 29 30 import java.util.Collection ; 31 import java.util.Iterator ; 32 import java.util.Map ; 33 34 40 public class JormQueryRewriter extends BasicQueryRewriter { 41 42 54 public JormQueryRewriter(Map jormName2Mapper, Map jormName2Project, 55 Collection leafRewriters) { 56 super(); 57 log = Log.loggerFactory.getLogger( 58 Log.MEDOR_PREFIX + ".optim.rewriter.JormQueryRewriter"); 59 rules = getDefaultRules(); 60 61 JormAssignMapperRule am = new JormAssignMapperRule(); 62 am.setJormName2Mapper(jormName2Mapper, jormName2Project); 63 rules.add(0, am); 64 65 LeafRewriteRule lrr = new JormLeafRewriteRule(); 66 for (Iterator it = leafRewriters.iterator(); it.hasNext();) 67 lrr.addLeafRewriter((LeafRewriter) it.next()); 68 rules.add(1, lrr); 69 rules.add(2, new JormGoUpDecodeRule()); 70 } 71 72 80 public JormQueryRewriter(Collection leafRewriters) { 81 super(); 82 log = Log.loggerFactory.getLogger( 83 Log.MEDOR_PREFIX + ".optim.rewriter.JormQueryRewriter"); 84 rules = getDefaultRules(); 85 LeafRewriteRule lrr = new JormLeafRewriteRule(); 86 for (Iterator it = leafRewriters.iterator(); it.hasNext();) 87 lrr.addLeafRewriter((LeafRewriter) it.next()); 88 rules.add(0, lrr); 89 rules.add(1, new JormGoUpDecodeRule()); 90 } 91 } 92 | Popular Tags |