public class DeclarationsHandler extends NetworkHandlerAdaptor
CompiledNetwork.
Currently we only create member variables for the following types of nodes:
AlphaNodesLeftInputAdapterNodesBetaNodesMap for each set of hashed AlphaNodes. The keys are the hashed values, and the values are
the IDs of the alphas| Modifier and Type | Field and Description |
|---|---|
protected static String |
NEWLINE |
protected static String |
RANGE_INDEX_VARIABLE_NAME_PREFIX |
| Constructor and Description |
|---|
DeclarationsHandler(StringBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getAlphaNodeVariableName(org.drools.core.reteoo.AlphaNode alphaNode) |
protected String |
getContextVariableName(org.drools.core.reteoo.AlphaNode alphaNode) |
Collection<HashedAlphasDeclaration> |
getHashedAlphaDeclarations() |
protected int |
getMinIdFromRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex) |
Map<String,org.drools.core.util.index.AlphaRangeIndex> |
getRangeIndexDeclarationMap() |
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) |
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 |
startRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex)
Receive notification of alpha node range index
|
void |
startWindowNode(org.drools.core.reteoo.WindowNode windowNode) |
endBetaNode, endHashedAlphaNode, endHashedAlphaNodes, endNonHashedAlphaNode, endObjectTypeNode, endRangeIndex, endRangeIndexedAlphaNode, endWindowNode, endWindowNode, nullCaseAlphaNodeEnd, nullCaseAlphaNodeStart, replaceNameExpr, startObjectTypeNode, startRangeIndexedAlphaNodeprotected static final String NEWLINE
protected static final String RANGE_INDEX_VARIABLE_NAME_PREFIX
public DeclarationsHandler(StringBuilder builder)
public Collection<HashedAlphasDeclaration> getHashedAlphaDeclarations()
public 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 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 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)public void startHashedAlphaNode(org.drools.core.reteoo.AlphaNode hashedAlpha,
Object hashedValue)
startHashedAlphaNode in interface NetworkHandlerstartHashedAlphaNode in class NetworkHandlerAdaptorpublic void startRangeIndex(org.drools.core.util.index.AlphaRangeIndex alphaRangeIndex)
NetworkHandlerstartRangeIndex in interface NetworkHandlerstartRangeIndex in class NetworkHandlerAdaptorpublic Map<String,org.drools.core.util.index.AlphaRangeIndex> getRangeIndexDeclarationMap()
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.