Package org.ocpsoft.rewrite.config
Class Conditions
java.lang.Object
org.ocpsoft.rewrite.config.Conditions
Utility for creating and wrapping
Condition instances.- Author:
- Lincoln Baxter, III
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConditionBuildercreate()Return a newDefaultConditionBuilderthat evaluates toTruewhen#evaluate(Rewrite, EvaluationContext)is invoked.static intgetNegationCount(EvaluationContext context) Returns the number of "Not"s that have been evaluated in the current evaluation process.static booleanisNegated(EvaluationContext context) Indicates whether the currentConditionis being negated.static ConditionBuilderWrap a givenConditionas a newDefaultConditionBuilderthat evaluates the the originalConditionwhen#evaluate(Rewrite, EvaluationContext)is invoked.
-
Field Details
-
NEGATION_COUNT_KEY
-
-
Constructor Details
-
Conditions
public Conditions()
-
-
Method Details
-
isNegated
Indicates whether the currentConditionis being negated. -
getNegationCount
Returns the number of "Not"s that have been evaluated in the current evaluation process. For example, when(Not.any(MyCondition)) would have a "NotCount" of "1" during the evaluation of "MyCondition". when(Not.any(Not.any(MyCondition))) would have a "NotCount" of "2" during the evaluation of "MyCondition". This is useful for conditions that may have side effects, as they will know whether or not their condition is being negated. -
create
Return a newDefaultConditionBuilderthat evaluates toTruewhen#evaluate(Rewrite, EvaluationContext)is invoked. -
wrap
Wrap a givenConditionas a newDefaultConditionBuilderthat evaluates the the originalConditionwhen#evaluate(Rewrite, EvaluationContext)is invoked.
-