Package org.drools.core.rule
Class EvalCondition
- java.lang.Object
-
- org.drools.core.rule.ConditionalElement
-
- org.drools.core.rule.EvalCondition
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,RuleConditionElement
,RuleComponent
,Wireable
public class EvalCondition extends ConditionalElement implements Externalizable, Wireable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.drools.core.spi.Wireable
Wireable.Immutable
-
-
Field Summary
Fields Modifier and Type Field Description protected EvalExpression
expression
protected Declaration[]
requiredDeclarations
-
Constructor Summary
Constructors Constructor Description EvalCondition()
EvalCondition(Declaration[] requiredDeclarations)
EvalCondition(EvalExpression eval, Declaration[] requiredDeclarations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EvalCondition
clone()
Returns a clone from itselfObject
createContext()
boolean
equals(Object object)
List<EvalCondition>
getCloned()
EvalExpression
getEvalExpression()
Map<String,Declaration>
getInnerDeclarations()
Returns a Map of declarations that are visible inside this conditional elementList<? extends RuleConditionElement>
getNestedElements()
Returs a list of RuleConditionElement's that are nested inside the current elementMap<String,Declaration>
getOuterDeclarations()
Returns a Map of declarations that are visible outside this conditional element.Declaration[]
getRequiredDeclarations()
int
hashCode()
boolean
isAllowed(Tuple tuple, WorkingMemory workingMemory, Object context)
boolean
isPatternScopeDelimiter()
Returns true in case this RuleConditionElement delimits a pattern visibility scope.void
readExternal(ObjectInput in)
void
replaceDeclaration(Declaration declaration, Declaration resolved)
Declaration
resolveDeclaration(String identifier)
Resolves the given identifier in the current scope and returns the Declaration object for the declaration.void
setCloned(List<EvalCondition> cloned)
void
setEvalExpression(EvalExpression expression)
void
setOuterDeclarations(Map<String,Declaration> outerDeclarations)
String
toString()
void
wire(Object object)
void
writeExternal(ObjectOutput out)
-
-
-
Field Detail
-
expression
protected EvalExpression expression
-
requiredDeclarations
protected Declaration[] requiredDeclarations
-
-
Constructor Detail
-
EvalCondition
public EvalCondition()
-
EvalCondition
public EvalCondition(Declaration[] requiredDeclarations)
-
EvalCondition
public EvalCondition(EvalExpression eval, Declaration[] requiredDeclarations)
-
-
Method Detail
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
getEvalExpression
public EvalExpression getEvalExpression()
-
setEvalExpression
public void setEvalExpression(EvalExpression expression)
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
-
createContext
public Object createContext()
-
isAllowed
public boolean isAllowed(Tuple tuple, WorkingMemory workingMemory, Object context)
-
clone
public EvalCondition clone()
Description copied from interface:RuleConditionElement
Returns a clone from itself- Specified by:
clone
in interfaceRuleConditionElement
- Specified by:
clone
in classConditionalElement
- Returns:
-
getInnerDeclarations
public Map<String,Declaration> getInnerDeclarations()
Description copied from interface:RuleConditionElement
Returns a Map of declarations that are visible inside this conditional element- Specified by:
getInnerDeclarations
in interfaceRuleConditionElement
- Returns:
-
getOuterDeclarations
public Map<String,Declaration> getOuterDeclarations()
Description copied from interface:RuleConditionElement
Returns a Map of declarations that are visible outside this conditional element.- Specified by:
getOuterDeclarations
in interfaceRuleConditionElement
- Returns:
-
setOuterDeclarations
public void setOuterDeclarations(Map<String,Declaration> outerDeclarations)
-
getNestedElements
public List<? extends RuleConditionElement> getNestedElements()
Description copied from interface:RuleConditionElement
Returs a list of RuleConditionElement's that are nested inside the current element- Specified by:
getNestedElements
in interfaceRuleConditionElement
- Returns:
-
isPatternScopeDelimiter
public boolean isPatternScopeDelimiter()
Description copied from interface:RuleConditionElement
Returns true in case this RuleConditionElement delimits a pattern visibility scope. For instance, AND CE is not a scope delimiter, while NOT CE is a scope delimiter- Specified by:
isPatternScopeDelimiter
in interfaceRuleConditionElement
- Returns:
-
resolveDeclaration
public Declaration resolveDeclaration(String identifier)
Description copied from interface:RuleConditionElement
Resolves the given identifier in the current scope and returns the Declaration object for the declaration. Returns null if identifier can not be resolved.- Specified by:
resolveDeclaration
in interfaceRuleConditionElement
- Returns:
-
replaceDeclaration
public void replaceDeclaration(Declaration declaration, Declaration resolved)
-
getCloned
public List<EvalCondition> getCloned()
-
setCloned
public void setCloned(List<EvalCondition> cloned)
-
-