Package org.drools.drl.ast.descr
Class EvaluatorBasedRestrictionDescr
- java.lang.Object
-
- org.drools.drl.ast.descr.BaseDescr
-
- org.drools.drl.ast.descr.RestrictionDescr
-
- org.drools.drl.ast.descr.EvaluatorBasedRestrictionDescr
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,Namespaceable
- Direct Known Subclasses:
LiteralRestrictionDescr,QualifiedIdentifierRestrictionDescr,ReturnValueRestrictionDescr,VariableRestrictionDescr
public class EvaluatorBasedRestrictionDescr extends RestrictionDescr
This is a super class for all restrictions that are based on evaluators.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EvaluatorBasedRestrictionDescr()Creates a new EvaluatorBasedRestrictionEvaluatorBasedRestrictionDescr(java.lang.String evaluator, boolean isNegated, java.lang.String parameterText)Creates a new EvaluatorBasedRestrictionEvaluatorBasedRestrictionDescr(java.lang.String evaluator, boolean isNegated, java.util.List<java.lang.String> parameters)Creates a new EvaluatorBasedRestriction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEvaluator()Returns the evaluator ID for this restrictionjava.util.List<java.lang.String>getParameters()java.lang.StringgetParameterText()In case there is any parameter text, this method returns it.booleanisNegated()Returns true if this evaluator is boolean negated.voidsetEvaluator(java.lang.String evaluator)Sets the evaluator ID for this restrictionvoidsetNegated(boolean negated)Sets if this evaluator is negated.voidsetParameters(java.util.List<java.lang.String> parameters)java.lang.StringtoString()-
Methods inherited from class org.drools.drl.ast.descr.BaseDescr
accept, copyLocation, getColumn, getEndCharacter, getEndColumn, getEndLine, getLine, getNamespace, getResource, getStartCharacter, getText, negate, positionAsString, readExternal, replaceVariable, setEndCharacter, setEndLocation, setLocation, setNamespace, setResource, setStartCharacter, setText, writeExternal
-
-
-
-
Constructor Detail
-
EvaluatorBasedRestrictionDescr
public EvaluatorBasedRestrictionDescr()
Creates a new EvaluatorBasedRestriction
-
EvaluatorBasedRestrictionDescr
public EvaluatorBasedRestrictionDescr(java.lang.String evaluator, boolean isNegated, java.lang.String parameterText)Creates a new EvaluatorBasedRestriction- Parameters:
evaluator- the evaluator ID to be used in this restrictionisNegated- true if the evaluator is boolean negatedparameterText- the parameter text, in case there is any. null otherwise.
-
EvaluatorBasedRestrictionDescr
public EvaluatorBasedRestrictionDescr(java.lang.String evaluator, boolean isNegated, java.util.List<java.lang.String> parameters)Creates a new EvaluatorBasedRestriction- Parameters:
evaluator- the evaluator ID to be used in this restrictionisNegated- true if the evaluator is boolean negatedparameters- the list of parameters texts, in case there is any. null otherwise.
-
-
Method Detail
-
getEvaluator
public java.lang.String getEvaluator()
Returns the evaluator ID for this restriction- Returns:
-
isNegated
public boolean isNegated()
Returns true if this evaluator is boolean negated. Example: "contains" is boolean negated if you want to check the elements that are not contained ("not contains")
-
getParameterText
public java.lang.String getParameterText()
In case there is any parameter text, this method returns it. Returns null otherwise. A parameter text is evaluator parameters like "after[1,10]". In the previous example, the parameter text will be "1,10".- Returns:
- the parameterText
-
getParameters
public java.util.List<java.lang.String> getParameters()
-
setParameters
public void setParameters(java.util.List<java.lang.String> parameters)
-
setEvaluator
public void setEvaluator(java.lang.String evaluator)
Sets the evaluator ID for this restriction
-
setNegated
public void setNegated(boolean negated)
Sets if this evaluator is negated. Example: "contains" is boolean negated if you want to check the elements that are not contained ("not contains")- Parameters:
negated- the negated
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-