Package org.drools.core.rule
Class ReturnValueRestriction
- java.lang.Object
-
- org.drools.core.rule.ReturnValueRestriction
-
- All Implemented Interfaces:
Externalizable
,Serializable
,Cloneable
,Acceptor
,AcceptsReadAccessor
,Restriction
,Wireable
public class ReturnValueRestriction extends Object implements Restriction, AcceptsReadAccessor, Wireable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReturnValueRestriction.ReturnValueContextEntry
-
Nested classes/interfaces inherited from interface org.drools.core.spi.Wireable
Wireable.Immutable
-
-
Constructor Summary
Constructors Constructor Description ReturnValueRestriction()
ReturnValueRestriction(InternalReadAccessor fieldExtractor, Declaration[] previousDeclarations, Declaration[] localDeclarations, String[] requiredGlobals, Evaluator evaluator)
ReturnValueRestriction(InternalReadAccessor fieldExtractor, ReturnValueExpression returnValueExpression, Declaration[] previousDeclarations, Declaration[] localDeclarations, String[] requiredGlobals, Evaluator evaluator)
-
Method Summary
-
-
-
Constructor Detail
-
ReturnValueRestriction
public ReturnValueRestriction()
-
ReturnValueRestriction
public ReturnValueRestriction(InternalReadAccessor fieldExtractor, Declaration[] previousDeclarations, Declaration[] localDeclarations, String[] requiredGlobals, Evaluator evaluator)
-
ReturnValueRestriction
public ReturnValueRestriction(InternalReadAccessor fieldExtractor, ReturnValueExpression returnValueExpression, Declaration[] previousDeclarations, Declaration[] localDeclarations, String[] requiredGlobals, Evaluator evaluator)
-
-
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
-
setReadAccessor
public void setReadAccessor(InternalReadAccessor readAccessor)
- Specified by:
setReadAccessor
in interfaceAcceptsReadAccessor
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
- Specified by:
getRequiredDeclarations
in interfaceRestriction
-
getPreviousDeclarations
public Declaration[] getPreviousDeclarations()
-
getLocalDeclarations
public Declaration[] getLocalDeclarations()
-
getRequiredGlobals
public String[] getRequiredGlobals()
-
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
Description copied from interface:Restriction
A restriction may be required to replace an old declaration object by a new updated one- Specified by:
replaceDeclaration
in interfaceRestriction
-
setReturnValueExpression
public void setReturnValueExpression(ReturnValueExpression expression)
-
getExpression
public ReturnValueExpression getExpression()
-
getEvaluator
public Evaluator getEvaluator()
- Specified by:
getEvaluator
in interfaceRestriction
-
isTemporal
public boolean isTemporal()
Description copied from interface:Restriction
Returns true if this is a temporal restriction- Specified by:
isTemporal
in interfaceRestriction
- Returns:
-
isAllowed
public boolean isAllowed(InternalReadAccessor readAccessor, InternalFactHandle handle, Tuple tuple, WorkingMemory workingMemory, ContextEntry context)
-
isAllowed
public boolean isAllowed(InternalReadAccessor extractor, InternalFactHandle handle, InternalWorkingMemory workingMemory, ContextEntry context)
- Specified by:
isAllowed
in interfaceRestriction
-
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
- Specified by:
isAllowedCachedLeft
in interfaceRestriction
-
isAllowedCachedRight
public boolean isAllowedCachedRight(Tuple tuple, ContextEntry context)
- Specified by:
isAllowedCachedRight
in interfaceRestriction
-
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntry
in interfaceRestriction
-
clone
public ReturnValueRestriction clone()
- Specified by:
clone
in interfaceRestriction
- Overrides:
clone
in classObject
-
-