org.objectweb.medor.optim.jorm
Class JormLeafRewriteRule
java.lang.Object
org.objectweb.medor.optim.lib.BasicRule
org.objectweb.medor.optim.jorm.JormLeafRewriteRule
- All Implemented Interfaces:
- LeafRewriteRule, RewriteRule
- public class JormLeafRewriteRule
- extends BasicRule
- implements LeafRewriteRule
This class represents the rule to transform QueryLeaves
into the corresponding QueryLeaf on the data store (for example into an
RdbQueryLeaf).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JormLeafRewriteRule
public JormLeafRewriteRule()
JormLeafRewriteRule
public JormLeafRewriteRule(LeafRewriter lr)
addLeafRewriter
public void addLeafRewriter(LeafRewriter lr)
- Specified by:
addLeafRewriter
in interface LeafRewriteRule
removeLeafRewriter
public void removeLeafRewriter(LeafRewriter lr)
- Specified by:
removeLeafRewriter
in interface LeafRewriteRule
getLeafRewriters
public java.util.Collection getLeafRewriters()
- Specified by:
getLeafRewriters
in interface LeafRewriteRule
getLeafRewriter
public LeafRewriter getLeafRewriter(QueryLeaf ql)
- Specified by:
getLeafRewriter
in interface LeafRewriteRule
setLoggerFactory
public void setLoggerFactory(LoggerFactory loggerFactory)
getLoggerFactory
public LoggerFactory getLoggerFactory()
setLogger
public void setLogger(Logger logger)
getLogger
public Logger getLogger()
rewrite
public QueryTree rewrite(QueryTree qt,
QueryNode _parent)
throws MedorException
- Description copied from interface:
RewriteRule
- This method applies a single rule.
It is typically called by the
QueryRewriter for applying the entire rewriting process.
- Specified by:
rewrite
in interface RewriteRule
- Parameters:
qt
- the QueryTree to be rewritten_parent
- the parent QueryNode for which modification of propagated
field, if they are replaced in the qt, should be done.
- Returns:
- the rewritten QueryTree
- Throws:
MedorException
getLeafUsers
protected java.util.Map getLeafUsers(QueryTree qt)
throws MedorException
- Throws:
MedorException
getLeafUsers
protected void getLeafUsers(QueryTree qt,
java.util.Map m,
java.util.ArrayList al)
throws MedorException
- It fetches the QueryTree nodes which are 'parents' of QueryLeaf nodes.
- Parameters:
qt
- is the queryTree to analyze.m
- is the current result of the recusrive evaluation.
key = a queryTree
Value = the users of the querytree key :
ArrayList( FieldOperand | PropagatedField | NestedField )al
- is the list of the visited queryTree. (It does not contain the
'qt' parameter)
- Throws:
MedorException