Class ConditionImpl

java.lang.Object
org.zkoss.zk.ui.util.ConditionImpl
All Implemented Interfaces:
Serializable

public class ConditionImpl extends Object implements Serializable
An utility to simplify the implementation of Condition. Note: it doesn't implement Condition.
Author:
tomyeh
See Also:
  • Constructor Details

  • Method Details

    • getInstance

      public static ConditionImpl getInstance(String ifc, String unless)
      Returns an instance of Condition, or null if both ifc and unless are empty. In other words, it is useful if you use null or empty to denote true.
    • setIf

      public void setIf(String cond)
      Sets the if condition.
      Parameters:
      cond - the condition. Note: If null (not specified), it is considered effective.
      See Also:
    • setUnless

      public void setUnless(String cond)
      Sets the unless condition.
      Parameters:
      cond - the condition. Note: If null (not specified), it is considered ineffective.
      See Also:
    • isEffective

      public boolean isEffective(Evaluator eval, Component comp)
      Used to evaluate whether it is effective.
      Parameters:
      eval - the evaluator to evaluate this condition
      comp - used as the self variable. Ignored if null.
      Since:
      3.0.0
    • isEffective

      public boolean isEffective(Evaluator eval, Page page)
      Used to evaluate whether it is effective.
      Parameters:
      eval - the evaluator to evaluate this condition
      page - used as the self variable. Ignored if null.
      Since:
      3.0.0
    • isIf

      public boolean isIf()
      Returns whether it's If condition.
      Since:
      10.0.0
    • getIf

      public ExValue getIf()
      Returns If expression.
      Since:
      10.0.0
    • getUnless

      public ExValue getUnless()
      Returns Unless expression.
      Since:
      10.0.0
    • isUnless

      public boolean isUnless()
      Returns whether it's Unless condition.
      Since:
      10.0.0