public class MvelConstraint extends MutableTypeConstraint implements IndexableConstraint, AcceptsReadAccessor
Modifier and Type | Class and Description |
---|---|
static class |
MvelConstraint.EvaluationContext |
static class |
MvelConstraint.MvelContextEntry |
static class |
MvelConstraint.PlainIndexEvaluator |
static class |
MvelConstraint.UnificationContextEntry |
Constraint.ConstraintType
Modifier and Type | Field and Description |
---|---|
protected MVELCompilationUnit |
compilationUnit |
protected ConditionEvaluator |
conditionEvaluator |
protected String |
expression |
static IndexEvaluator |
INDEX_EVALUATOR |
protected AtomicInteger |
invocationCounter |
protected boolean |
isDynamic |
protected static int |
JIT_THRESOLD |
protected boolean |
jitted |
protected static boolean |
TEST_JITTING |
Constructor and Description |
---|
MvelConstraint() |
MvelConstraint(Collection<String> packageNames,
String expression,
Declaration[] declarations,
MVELCompilationUnit compilationUnit,
IndexUtil.ConstraintType constraintType,
Declaration indexingDeclaration,
InternalReadAccessor extractor,
boolean isUnification) |
MvelConstraint(String packageName,
String expression,
Declaration[] declarations,
MVELCompilationUnit compilationUnit,
boolean isDynamic) |
MvelConstraint(String packageName,
String expression,
MVELCompilationUnit compilationUnit,
IndexUtil.ConstraintType constraintType,
FieldValue fieldValue,
InternalReadAccessor extractor) |
getType, setInUse, setType
finalize, getClass, notify, notifyAll, wait, wait, wait
getType
protected static final boolean TEST_JITTING
protected static final int JIT_THRESOLD
protected final transient AtomicInteger invocationCounter
protected transient boolean jitted
protected String expression
protected boolean isDynamic
protected MVELCompilationUnit compilationUnit
protected transient volatile ConditionEvaluator conditionEvaluator
public static final IndexEvaluator INDEX_EVALUATOR
public MvelConstraint()
public MvelConstraint(String packageName, String expression, MVELCompilationUnit compilationUnit, IndexUtil.ConstraintType constraintType, FieldValue fieldValue, InternalReadAccessor extractor)
public MvelConstraint(String packageName, String expression, Declaration[] declarations, MVELCompilationUnit compilationUnit, boolean isDynamic)
public MvelConstraint(Collection<String> packageNames, String expression, Declaration[] declarations, MVELCompilationUnit compilationUnit, IndexUtil.ConstraintType constraintType, Declaration indexingDeclaration, InternalReadAccessor extractor, boolean isUnification)
protected String getAccessedClass()
public void setReadAccessor(InternalReadAccessor readAccessor)
setReadAccessor
in interface AcceptsReadAccessor
public Collection<String> getPackageNames()
public void addPackageNames(Collection<String> otherPkgs)
public String getExpression()
public boolean isDynamic()
public boolean isUnification()
isUnification
in interface IndexableConstraint
public void unsetUnification()
public boolean isIndexable(short nodeType)
isIndexable
in interface IndexableConstraint
public IndexUtil.ConstraintType getConstraintType()
getConstraintType
in interface IndexableConstraint
public FieldValue getField()
getField
in interface IndexableConstraint
public boolean isAllowed(InternalFactHandle handle, InternalWorkingMemory workingMemory, ContextEntry context)
isAllowed
in interface AlphaNodeFieldConstraint
public boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
isAllowedCachedLeft
in interface BetaNodeFieldConstraint
public boolean isAllowedCachedRight(LeftTuple tuple, ContextEntry context)
isAllowedCachedRight
in interface BetaNodeFieldConstraint
protected boolean evaluate(InternalFactHandle handle, InternalWorkingMemory workingMemory, LeftTuple leftTuple)
protected void createMvelConditionEvaluator(InternalWorkingMemory workingMemory)
protected boolean forceJitEvaluator(InternalFactHandle handle, InternalWorkingMemory workingMemory, LeftTuple leftTuple)
protected void jitEvaluator(InternalFactHandle handle, InternalWorkingMemory workingMemory, LeftTuple leftTuple)
public ContextEntry createContextEntry()
createContextEntry
in interface AlphaNodeFieldConstraint
createContextEntry
in interface BetaNodeFieldConstraint
public AbstractHashTable.FieldIndex getFieldIndex()
getFieldIndex
in interface IndexableConstraint
public InternalReadAccessor getFieldExtractor()
getFieldExtractor
in interface IndexableConstraint
public Declaration[] getRequiredDeclarations()
Constraint
getRequiredDeclarations
in interface Constraint
public Declaration getIndexingDeclaration()
public void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
Constraint
replaceDeclaration
in interface Constraint
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class MutableTypeConstraint
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class MutableTypeConstraint
IOException
ClassNotFoundException
public boolean isTemporal()
Constraint
isTemporal
in interface Constraint
public MvelConstraint cloneIfInUse()
AlphaNodeFieldConstraint
cloneIfInUse
in interface AlphaNodeFieldConstraint
cloneIfInUse
in interface BetaNodeFieldConstraint
cloneIfInUse
in class MutableTypeConstraint
public MvelConstraint clone()
Constraint
clone
in interface Constraint
clone
in class MutableTypeConstraint
protected org.mvel2.ParserConfiguration getParserConfiguration(InternalWorkingMemory workingMemory)
protected MVELDialectRuntimeData getMVELDialectRuntimeData(InternalWorkingMemory workingMemory)
public void registerEvaluationContext(BuildContext buildContext)
Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.