public abstract class PropagatorCompilerHandler extends NetworkHandlerAdaptor
| Modifier and Type | Field and Description |
|---|---|
protected com.github.javaparser.ast.stmt.BlockStmt |
allStatements |
protected boolean |
alphaNetContainsHashedField
This states if there is at least 1 set of hashed alpha nodes in the network
|
protected Deque<com.github.javaparser.ast.Node> |
currentStatement |
protected List<com.github.javaparser.ast.body.MethodDeclaration> |
extractedMethods |
protected static String |
FACT_HANDLE_PARAM_NAME |
protected String |
factClassName |
protected static String |
LOCAL_FACT_VAR_NAME |
protected static String |
MODIFY_PREVIOUS_TUPLE_PARAM_NAME |
protected static String |
NEWLINE |
protected static String |
PROP_CONTEXT_PARAM_NAME |
protected static String |
RANGE_INDEX_VARIABLE_NAME_PREFIX |
protected static String |
WORKING_MEMORY_PARAM_NAME |
| Modifier | Constructor and Description |
|---|---|
protected |
PropagatorCompilerHandler(boolean alphaNetContainsHashedField,
String factClassName) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract com.github.javaparser.ast.NodeList<com.github.javaparser.ast.expr.Expression> |
arguments() |
protected boolean |
canInlineValue(Class<?> fieldType) |
String |
emitCode() |
void |
endHashedAlphaNode(org.drools.core.reteoo.AlphaNode hashedAlpha,
Object hashedValue) |
void |
endNonHashedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode)
Receive notification of the end of a non-hashed
org.kie.reteoo.AlphaNode. |
void |
endRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex) |
void |
endRangeIndexedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode) |
com.github.javaparser.ast.type.ClassOrInterfaceType |
factHandleType() |
protected String |
getAlphaNodeVariableName(org.drools.core.reteoo.AlphaNode alphaNode) |
protected String |
getContextVariableName(org.drools.core.reteoo.AlphaNode alphaNode) |
com.github.javaparser.ast.stmt.BlockStmt |
getCurrentBlockStatement() |
com.github.javaparser.ast.stmt.SwitchEntry |
getLastSwitchEntry() |
protected int |
getMinIdFromRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex) |
protected String |
getRangeIndexVariableName(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex,
int minId) |
protected String |
getVariableName() |
protected static String |
getVariableName(org.drools.core.reteoo.AlphaNode alphaNode) |
protected static String |
getVariableName(Class<?> clazz,
int nodeId)
Returns a variable name based on the simple name of the specified class appended with the specified
nodeId.
|
protected static String |
getVariableName(org.drools.core.reteoo.Sink sink) |
protected static Class<?> |
getVariableType(org.drools.core.reteoo.AlphaNode alphaNode) |
protected static Class<?> |
getVariableType(org.drools.core.reteoo.Sink sink) |
protected com.github.javaparser.ast.stmt.ExpressionStmt |
localVariable(com.github.javaparser.ast.type.Type type,
String variableName,
com.github.javaparser.ast.expr.MethodCallExpr source) |
protected com.github.javaparser.ast.stmt.ExpressionStmt |
localVariableWithCastInitializer(com.github.javaparser.ast.type.Type type,
String variableName,
com.github.javaparser.ast.expr.MethodCallExpr source) |
protected abstract com.github.javaparser.ast.NodeList<com.github.javaparser.ast.body.Parameter> |
methodParameters() |
com.github.javaparser.ast.type.ClassOrInterfaceType |
modifyPreviousTuplesType() |
protected abstract com.github.javaparser.ast.stmt.Statement |
propagateMethod(org.drools.core.reteoo.Sink sink) |
protected abstract String |
propagateMethodName() |
com.github.javaparser.ast.type.ClassOrInterfaceType |
propagationContextType() |
void |
startBetaNode(org.drools.core.reteoo.BetaNode betaNode) |
void |
startHashedAlphaNode(org.drools.core.reteoo.AlphaNode hashedAlpha,
Object hashedValue) |
void |
startHashedAlphaNodes(org.drools.core.rule.IndexableConstraint indexableConstraint)
Receive notification of the a group of hashed
org.kie.reteoo.AlphaNodes. |
void |
startLeftInputAdapterNode(org.drools.core.reteoo.LeftInputAdapterNode leftInputAdapterNode) |
void |
startNonHashedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode)
Receive notification of the a non-hashed
org.kie.reteoo.AlphaNode. |
void |
startObjectTypeNode(org.drools.core.reteoo.ObjectTypeNode objectTypeNode)
Receive notification of the beginning of an
org.kie.reteoo.ObjectTypeNode
The Network parser will invoke this method only once, before any other event callback. |
void |
startRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex)
Receive notification of alpha node range index
|
void |
startRangeIndexedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode) |
void |
startWindowNode(org.drools.core.reteoo.WindowNode windowNode) |
com.github.javaparser.ast.type.ClassOrInterfaceType |
workingMemoryType() |
endBetaNode, endHashedAlphaNodes, endObjectTypeNode, endWindowNode, endWindowNode, nullCaseAlphaNodeEnd, nullCaseAlphaNodeStart, replaceNameExprprotected final boolean alphaNetContainsHashedField
protected final String factClassName
protected static final String FACT_HANDLE_PARAM_NAME
protected static final String PROP_CONTEXT_PARAM_NAME
protected static final String WORKING_MEMORY_PARAM_NAME
protected static final String MODIFY_PREVIOUS_TUPLE_PARAM_NAME
protected static final String LOCAL_FACT_VAR_NAME
protected com.github.javaparser.ast.stmt.BlockStmt allStatements
protected Deque<com.github.javaparser.ast.Node> currentStatement
protected List<com.github.javaparser.ast.body.MethodDeclaration> extractedMethods
protected static final String NEWLINE
protected static final String RANGE_INDEX_VARIABLE_NAME_PREFIX
protected PropagatorCompilerHandler(boolean alphaNetContainsHashedField,
String factClassName)
protected abstract com.github.javaparser.ast.stmt.Statement propagateMethod(org.drools.core.reteoo.Sink sink)
protected abstract com.github.javaparser.ast.NodeList<com.github.javaparser.ast.body.Parameter> methodParameters()
protected abstract com.github.javaparser.ast.NodeList<com.github.javaparser.ast.expr.Expression> arguments()
public void startObjectTypeNode(org.drools.core.reteoo.ObjectTypeNode objectTypeNode)
NetworkHandlerorg.kie.reteoo.ObjectTypeNode
The Network parser will invoke this method only once, before any other event callback.
startObjectTypeNode in interface NetworkHandlerstartObjectTypeNode in class NetworkHandlerAdaptorobjectTypeNode - the object type node#endObjectTypeNode(org.kie.reteoo.ObjectTypeNode)public void startBetaNode(org.drools.core.reteoo.BetaNode betaNode)
startBetaNode in interface NetworkHandlerstartBetaNode in class NetworkHandlerAdaptorpublic void startWindowNode(org.drools.core.reteoo.WindowNode windowNode)
startWindowNode in interface NetworkHandlerstartWindowNode in class NetworkHandlerAdaptorpublic void startLeftInputAdapterNode(org.drools.core.reteoo.LeftInputAdapterNode leftInputAdapterNode)
startLeftInputAdapterNode in interface NetworkHandlerstartLeftInputAdapterNode in class NetworkHandlerAdaptorpublic void startNonHashedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode)
NetworkHandlerorg.kie.reteoo.AlphaNode.
The Parser will invoke this method at the beginning of every non-hashed Alpha in the Network; there will be a corresponding endNonHashedAlphaNode() event for every startNonHashedAlphaNode() event. All of the node's decendants will be reported, in order, before the corresponding endNonHashedAlphaNode() event.
startNonHashedAlphaNode in interface NetworkHandlerstartNonHashedAlphaNode in class NetworkHandlerAdaptoralphaNode - non-hashed AlphaNodeNetworkHandler.endNonHashedAlphaNode(org.drools.core.reteoo.AlphaNode)public void endNonHashedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode)
NetworkHandlerorg.kie.reteoo.AlphaNode.
The parser will invoke this method at the end of every alpha in the network; there will be a corresponding
#startNonHashedAlphaNode(org.kie.reteoo.AlphaNode) event for every endNonHashedAlphaNode event.
endNonHashedAlphaNode in interface NetworkHandlerendNonHashedAlphaNode in class NetworkHandlerAdaptoralphaNode - non-hashed AlphaNodepublic void startHashedAlphaNodes(org.drools.core.rule.IndexableConstraint indexableConstraint)
NetworkHandlerorg.kie.reteoo.AlphaNodes.
The Parser will invoke this method at the beginning of every groups of hashed Alphas in the Network;
there will be a corresponding NetworkHandler.endHashedAlphaNodes(org.drools.core.rule.IndexableConstraint) event for every startHashedAlphaNodes() event.
The actual alpha nodes will be reported via the NetworkHandler.startHashedAlphaNode(org.drools.core.reteoo.AlphaNode, java.lang.Object) method, along with all of the
node's decendants, in order, before the corresponding NetworkHandler.endHashedAlphaNode(org.drools.core.reteoo.AlphaNode, java.lang.Object)
event.
startHashedAlphaNodes in interface NetworkHandlerstartHashedAlphaNodes in class NetworkHandlerAdaptorindexableConstraint - field reader that is used to access the hashed attributeNetworkHandler.endHashedAlphaNodes(org.drools.core.rule.IndexableConstraint),
NetworkHandler.startHashedAlphaNode(org.drools.core.reteoo.AlphaNode, java.lang.Object)protected boolean canInlineValue(Class<?> fieldType)
public void startHashedAlphaNode(org.drools.core.reteoo.AlphaNode hashedAlpha,
Object hashedValue)
startHashedAlphaNode in interface NetworkHandlerstartHashedAlphaNode in class NetworkHandlerAdaptorpublic void endHashedAlphaNode(org.drools.core.reteoo.AlphaNode hashedAlpha,
Object hashedValue)
endHashedAlphaNode in interface NetworkHandlerendHashedAlphaNode in class NetworkHandlerAdaptorpublic void startRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex)
NetworkHandlerstartRangeIndex in interface NetworkHandlerstartRangeIndex in class NetworkHandlerAdaptorpublic void startRangeIndexedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode)
startRangeIndexedAlphaNode in interface NetworkHandlerstartRangeIndexedAlphaNode in class NetworkHandlerAdaptorpublic void endRangeIndexedAlphaNode(org.drools.core.reteoo.AlphaNode alphaNode)
endRangeIndexedAlphaNode in interface NetworkHandlerendRangeIndexedAlphaNode in class NetworkHandlerAdaptorpublic com.github.javaparser.ast.stmt.SwitchEntry getLastSwitchEntry()
public void endRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex)
endRangeIndex in interface NetworkHandlerendRangeIndex in class NetworkHandlerAdaptorpublic com.github.javaparser.ast.stmt.BlockStmt getCurrentBlockStatement()
protected abstract String propagateMethodName()
public String emitCode()
public com.github.javaparser.ast.type.ClassOrInterfaceType modifyPreviousTuplesType()
public com.github.javaparser.ast.type.ClassOrInterfaceType factHandleType()
public com.github.javaparser.ast.type.ClassOrInterfaceType propagationContextType()
public com.github.javaparser.ast.type.ClassOrInterfaceType workingMemoryType()
protected com.github.javaparser.ast.stmt.ExpressionStmt localVariableWithCastInitializer(com.github.javaparser.ast.type.Type type,
String variableName,
com.github.javaparser.ast.expr.MethodCallExpr source)
protected com.github.javaparser.ast.stmt.ExpressionStmt localVariable(com.github.javaparser.ast.type.Type type,
String variableName,
com.github.javaparser.ast.expr.MethodCallExpr source)
protected static Class<?> getVariableType(org.drools.core.reteoo.AlphaNode alphaNode)
protected static Class<?> getVariableType(org.drools.core.reteoo.Sink sink)
protected static String getVariableName(org.drools.core.reteoo.AlphaNode alphaNode)
protected String getContextVariableName(org.drools.core.reteoo.AlphaNode alphaNode)
protected static String getVariableName(org.drools.core.reteoo.Sink sink)
protected String getVariableName()
protected static String getVariableName(Class<?> clazz, int nodeId)
clazz - class whose simple name is lowercased and user as the prefix of the variable namenodeId - id of org.kie.common.NetworkNodeClass.getSimpleName()protected String getAlphaNodeVariableName(org.drools.core.reteoo.AlphaNode alphaNode)
protected String getRangeIndexVariableName(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex, int minId)
protected int getMinIdFromRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex)
Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.