org.drools.core.reteoo.compiled
Class DeclarationsHandler
java.lang.Object
org.drools.core.reteoo.compiled.NetworkHandlerAdaptor
org.drools.core.reteoo.compiled.DeclarationsHandler
- All Implemented Interfaces:
- NetworkHandler
public class DeclarationsHandler
- extends NetworkHandlerAdaptor
This handler is used to create the member declarations section of a generated subclass of a CompiledNetwork.
Currently we only create member variables for the following types of nodes:
Non-hashed AlphaNodes
LeftInputAdapterNodes
BetaNodes
A Map for each set of hashed AlphaNodes. The keys are the hashed values, and the values are
the IDs of the alphas
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NEWLINE
protected static final String NEWLINE
- See Also:
- Constant Field Values
DeclarationsHandler
public DeclarationsHandler(StringBuilder builder)
getHashedAlphaDeclarations
public Collection<HashedAlphasDeclaration> getHashedAlphaDeclarations()
startNonHashedAlphaNode
public void startNonHashedAlphaNode(AlphaNode alphaNode)
- Description copied from interface:
NetworkHandler
- Receive notification of the a non-hashed
org.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.
- Specified by:
startNonHashedAlphaNode in interface NetworkHandler- Overrides:
startNonHashedAlphaNode in class NetworkHandlerAdaptor
- Parameters:
alphaNode - non-hashed AlphaNode- See Also:
NetworkHandler.endNonHashedAlphaNode(org.drools.core.reteoo.AlphaNode)
startBetaNode
public void startBetaNode(BetaNode betaNode)
- Specified by:
startBetaNode in interface NetworkHandler- Overrides:
startBetaNode in class NetworkHandlerAdaptor
startLeftInputAdapterNode
public void startLeftInputAdapterNode(LeftInputAdapterNode leftInputAdapterNode)
- Specified by:
startLeftInputAdapterNode in interface NetworkHandler- Overrides:
startLeftInputAdapterNode in class NetworkHandlerAdaptor
startHashedAlphaNodes
public void startHashedAlphaNodes(ClassFieldReader hashedFieldReader)
- Description copied from interface:
NetworkHandler
- Receive notification of the a group of hashed
org.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.base.ClassFieldReader) 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.
- Specified by:
startHashedAlphaNodes in interface NetworkHandler- Overrides:
startHashedAlphaNodes in class NetworkHandlerAdaptor
- Parameters:
hashedFieldReader - field reader that is used to access the hashed attribute- See Also:
NetworkHandler.endHashedAlphaNodes(org.drools.core.base.ClassFieldReader),
NetworkHandler.startHashedAlphaNode(org.drools.core.reteoo.AlphaNode, java.lang.Object)
startHashedAlphaNode
public void startHashedAlphaNode(AlphaNode hashedAlpha,
Object hashedValue)
- Specified by:
startHashedAlphaNode in interface NetworkHandler- Overrides:
startHashedAlphaNode in class NetworkHandlerAdaptor
getVariableType
protected Class<?> getVariableType(AlphaNode alphaNode)
getVariableType
protected Class<?> getVariableType(Sink sink)
getVariableName
protected String getVariableName(AlphaNode alphaNode)
getContextVariableName
protected String getContextVariableName(AlphaNode alphaNode)
getVariableName
protected String getVariableName(Sink sink)
getVariableName
protected String getVariableName(ClassFieldReader fieldReader)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.