org.drools.core.rule.constraint
Class MvelConstraint
java.lang.Object
org.drools.core.rule.MutableTypeConstraint
org.drools.core.rule.constraint.MvelConstraint
- All Implemented Interfaces:
- Externalizable, Serializable, Cloneable, IndexableConstraint, Acceptor, AcceptsReadAccessor, AlphaNodeFieldConstraint, BetaNodeFieldConstraint, Constraint, RuleComponent
public class MvelConstraint
- extends MutableTypeConstraint
- implements IndexableConstraint, AcceptsReadAccessor
- See Also:
- Serialized Form
|
Constructor Summary |
MvelConstraint()
|
MvelConstraint(String packageName,
String expression,
Declaration[] declarations,
MVELCompilationUnit compilationUnit,
boolean isDynamic)
|
MvelConstraint(String packageName,
String expression,
Declaration[] declarations,
MVELCompilationUnit compilationUnit,
IndexUtil.ConstraintType constraintType,
Declaration indexingDeclaration,
InternalReadAccessor extractor,
boolean isUnification)
|
MvelConstraint(String packageName,
String expression,
MVELCompilationUnit compilationUnit,
IndexUtil.ConstraintType constraintType,
FieldValue fieldValue,
InternalReadAccessor extractor)
|
|
Method Summary |
MvelConstraint |
clone()
Clones the constraint |
MvelConstraint |
cloneIfInUse()
Clone this constraints only if it is already used by a different node, otherwise returns this |
ContextEntry |
createContextEntry()
|
protected void |
createMvelConditionEvaluator(InternalWorkingMemory workingMemory)
|
boolean |
equals(Object object)
|
protected boolean |
evaluate(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
LeftTuple leftTuple)
|
protected boolean |
forceJitEvaluator(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
LeftTuple leftTuple)
|
protected String |
getAccessedClass()
|
IndexUtil.ConstraintType |
getConstraintType()
|
String |
getExpression()
|
FieldValue |
getField()
|
InternalReadAccessor |
getFieldExtractor()
|
AbstractHashTable.FieldIndex |
getFieldIndex()
|
Declaration |
getIndexingDeclaration()
|
long |
getListenedPropertyMask(List<String> settableProperties)
|
protected MVELDialectRuntimeData |
getMVELDialectRuntimeData(InternalWorkingMemory workingMemory)
|
String |
getPackageName()
|
protected org.mvel2.ParserConfiguration |
getParserConfiguration(InternalWorkingMemory workingMemory)
|
Declaration[] |
getRequiredDeclarations()
Returns all the declarations required by the given
constraint implementation. |
int |
hashCode()
|
boolean |
isAllowed(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
ContextEntry context)
|
boolean |
isAllowedCachedLeft(ContextEntry context,
InternalFactHandle handle)
|
boolean |
isAllowedCachedRight(LeftTuple tuple,
ContextEntry context)
|
boolean |
isDynamic()
|
boolean |
isIndexable(short nodeType)
|
boolean |
isTemporal()
Returns true in case this constraint is a temporal constraint |
boolean |
isUnification()
|
protected void |
jitEvaluator(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
LeftTuple leftTuple)
|
void |
readExternal(ObjectInput in)
|
void |
replaceDeclaration(Declaration oldDecl,
Declaration newDecl)
When a rule contains multiple logical branches, i.e., makes
use of 'OR' CE, it is required to clone patterns and declarations
for each logical branch. |
void |
setReadAccessor(InternalReadAccessor readAccessor)
|
String |
toString()
|
void |
unsetUnification()
|
void |
writeExternal(ObjectOutput out)
|
TEST_JITTING
protected static final boolean TEST_JITTING
- See Also:
- Constant Field Values
JIT_THRESOLD
protected static final int JIT_THRESOLD
- See Also:
- Constant Field Values
invocationCounter
protected final transient AtomicInteger invocationCounter
jitted
protected transient boolean jitted
expression
protected String expression
isDynamic
protected boolean isDynamic
compilationUnit
protected MVELCompilationUnit compilationUnit
conditionEvaluator
protected transient volatile ConditionEvaluator conditionEvaluator
INDEX_EVALUATOR
public static final IndexEvaluator INDEX_EVALUATOR
MvelConstraint
public MvelConstraint()
MvelConstraint
public MvelConstraint(String packageName,
String expression,
MVELCompilationUnit compilationUnit,
IndexUtil.ConstraintType constraintType,
FieldValue fieldValue,
InternalReadAccessor extractor)
MvelConstraint
public MvelConstraint(String packageName,
String expression,
Declaration[] declarations,
MVELCompilationUnit compilationUnit,
boolean isDynamic)
MvelConstraint
public MvelConstraint(String packageName,
String expression,
Declaration[] declarations,
MVELCompilationUnit compilationUnit,
IndexUtil.ConstraintType constraintType,
Declaration indexingDeclaration,
InternalReadAccessor extractor,
boolean isUnification)
getAccessedClass
protected String getAccessedClass()
setReadAccessor
public void setReadAccessor(InternalReadAccessor readAccessor)
- Specified by:
setReadAccessor in interface AcceptsReadAccessor
getPackageName
public String getPackageName()
getExpression
public String getExpression()
isDynamic
public boolean isDynamic()
isUnification
public boolean isUnification()
- Specified by:
isUnification in interface IndexableConstraint
unsetUnification
public void unsetUnification()
isIndexable
public boolean isIndexable(short nodeType)
- Specified by:
isIndexable in interface IndexableConstraint
getConstraintType
public IndexUtil.ConstraintType getConstraintType()
- Specified by:
getConstraintType in interface IndexableConstraint
getField
public FieldValue getField()
- Specified by:
getField in interface IndexableConstraint
isAllowed
public boolean isAllowed(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
ContextEntry context)
- Specified by:
isAllowed in interface AlphaNodeFieldConstraint
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context,
InternalFactHandle handle)
- Specified by:
isAllowedCachedLeft in interface BetaNodeFieldConstraint
isAllowedCachedRight
public boolean isAllowedCachedRight(LeftTuple tuple,
ContextEntry context)
- Specified by:
isAllowedCachedRight in interface BetaNodeFieldConstraint
evaluate
protected boolean evaluate(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
LeftTuple leftTuple)
createMvelConditionEvaluator
protected void createMvelConditionEvaluator(InternalWorkingMemory workingMemory)
forceJitEvaluator
protected boolean forceJitEvaluator(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
LeftTuple leftTuple)
jitEvaluator
protected void jitEvaluator(InternalFactHandle handle,
InternalWorkingMemory workingMemory,
LeftTuple leftTuple)
createContextEntry
public ContextEntry createContextEntry()
- Specified by:
createContextEntry in interface AlphaNodeFieldConstraint- Specified by:
createContextEntry in interface BetaNodeFieldConstraint
getFieldIndex
public AbstractHashTable.FieldIndex getFieldIndex()
- Specified by:
getFieldIndex in interface IndexableConstraint
getFieldExtractor
public InternalReadAccessor getFieldExtractor()
- Specified by:
getFieldExtractor in interface IndexableConstraint
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
- Description copied from interface:
Constraint
- Returns all the declarations required by the given
constraint implementation.
- Specified by:
getRequiredDeclarations in interface Constraint
- Returns:
getIndexingDeclaration
public Declaration getIndexingDeclaration()
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl,
Declaration newDecl)
- Description copied from interface:
Constraint
- When a rule contains multiple logical branches, i.e., makes
use of 'OR' CE, it is required to clone patterns and declarations
for each logical branch. Since this is done at ReteOO build
type, when constraints were already created, eventually
some constraints need to update their references to the
declarations.
- Specified by:
replaceDeclaration in interface Constraint
getListenedPropertyMask
public long getListenedPropertyMask(List<String> settableProperties)
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal in interface Externalizable- Overrides:
writeExternal in class MutableTypeConstraint
- Throws:
IOException
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal in interface Externalizable- Overrides:
readExternal in class MutableTypeConstraint
- Throws:
IOException
ClassNotFoundException
isTemporal
public boolean isTemporal()
- Description copied from interface:
Constraint
- Returns true in case this constraint is a temporal constraint
- Specified by:
isTemporal in interface Constraint
- Returns:
cloneIfInUse
public MvelConstraint cloneIfInUse()
- Description copied from interface:
AlphaNodeFieldConstraint
- Clone this constraints only if it is already used by a different node, otherwise returns this
- Specified by:
cloneIfInUse in interface AlphaNodeFieldConstraint- Specified by:
cloneIfInUse in interface BetaNodeFieldConstraint- Overrides:
cloneIfInUse in class MutableTypeConstraint
clone
public MvelConstraint clone()
- Description copied from interface:
Constraint
- Clones the constraint
- Specified by:
clone in interface Constraint- Specified by:
clone in class MutableTypeConstraint
- Returns:
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object object)
- Overrides:
equals in class Object
toString
public String toString()
- Overrides:
toString in class Object
getParserConfiguration
protected org.mvel2.ParserConfiguration getParserConfiguration(InternalWorkingMemory workingMemory)
getMVELDialectRuntimeData
protected MVELDialectRuntimeData getMVELDialectRuntimeData(InternalWorkingMemory workingMemory)
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.