Package org.drools.core.rule.constraint
Class XpathConstraint
- java.lang.Object
-
- org.drools.core.rule.MutableTypeConstraint
-
- org.drools.core.rule.constraint.XpathConstraint
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,AlphaNodeFieldConstraint,BetaNodeFieldConstraint,Constraint,RuleComponent
public class XpathConstraint extends MutableTypeConstraint
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXpathConstraint.XpathChunkstatic classXpathConstraint.XpathDataProvider-
Nested classes/interfaces inherited from interface org.drools.core.spi.Constraint
Constraint.ConstraintType
-
-
Constructor Summary
Constructors Constructor Description XpathConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XpathConstraint.XpathChunkaddChunck(Class<?> clazz, String field, int index, boolean iterate, boolean lazy)XpathConstraintclone()Clones the constraintContextEntrycreateContextEntry()LinkedList<XpathConstraint.XpathChunk>getChunks()DeclarationgetDeclaration()InternalReadAccessorgetReadAccessor()Declaration[]getRequiredDeclarations()Returns all the declarations required by the given constraint implementation.Class<?>getResultClass()Constraint.ConstraintTypegetType()Returns the type of the constraint, either ALPHA, BETA or UNKNOWNDeclarationgetXpathStartDeclaration()booleanisAllowed(InternalFactHandle handle, InternalWorkingMemory workingMemory)booleanisAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)booleanisAllowedCachedRight(Tuple tuple, ContextEntry context)booleanisTemporal()Returns true in case this constraint is a temporal constraintvoidreadExternal(ObjectInput in)voidreplaceDeclaration(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.voidsetDeclaration(Declaration declaration)voidsetXpathStartDeclaration(Declaration xpathStartDeclaration)StringtoString()voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.drools.core.rule.MutableTypeConstraint
cloneIfInUse, setInUse, setType
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.spi.Constraint
addPackageNames, equals, getListenedPropertyMask, getPackageNames, mergeEvaluationContext, registerEvaluationContext
-
-
-
-
Method Detail
-
addChunck
public XpathConstraint.XpathChunk addChunck(Class<?> clazz, String field, int index, boolean iterate, boolean lazy)
-
getType
public Constraint.ConstraintType getType()
Description copied from interface:ConstraintReturns the type of the constraint, either ALPHA, BETA or UNKNOWN- Specified by:
getTypein interfaceConstraint- Overrides:
getTypein classMutableTypeConstraint- Returns:
-
getRequiredDeclarations
public Declaration[] getRequiredDeclarations()
Description copied from interface:ConstraintReturns all the declarations required by the given constraint implementation.- Returns:
-
replaceDeclaration
public void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
Description copied from interface:ConstraintWhen 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.
-
clone
public XpathConstraint clone()
Description copied from interface:ConstraintClones the constraint- Specified by:
clonein interfaceConstraint- Specified by:
clonein classMutableTypeConstraint- Returns:
-
isTemporal
public boolean isTemporal()
Description copied from interface:ConstraintReturns true in case this constraint is a temporal constraint- Returns:
-
isAllowedCachedLeft
public boolean isAllowedCachedLeft(ContextEntry context, InternalFactHandle handle)
-
isAllowedCachedRight
public boolean isAllowedCachedRight(Tuple tuple, ContextEntry context)
-
createContextEntry
public ContextEntry createContextEntry()
-
isAllowed
public boolean isAllowed(InternalFactHandle handle, InternalWorkingMemory workingMemory)
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classMutableTypeConstraint- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classMutableTypeConstraint- Throws:
IOException
-
getChunks
public LinkedList<XpathConstraint.XpathChunk> getChunks()
-
getResultClass
public Class<?> getResultClass()
-
getDeclaration
public Declaration getDeclaration()
-
setDeclaration
public void setDeclaration(Declaration declaration)
-
getReadAccessor
public InternalReadAccessor getReadAccessor()
-
getXpathStartDeclaration
public Declaration getXpathStartDeclaration()
-
setXpathStartDeclaration
public void setXpathStartDeclaration(Declaration xpathStartDeclaration)
-
-