示例#1
0
  protected final boolean isZero(final JakExpression expr) {
    if (expr.hasConstantValue(this.context)) {
      Object object = expr.constantValue(this.context);

      if (object instanceof Boolean) {
        Boolean booleanValue = (Boolean) object;
        return booleanValue.equals(Boolean.FALSE);
      } else if (object instanceof Number) {
        Number numberValue = (Number) object;
        return (numberValue.intValue() == 0);
      } else {
        return false;
      }
    }
    return false;
  }
示例#2
0
 protected final boolean isNull(final JakExpression expr) {
   return expr.hasConstantValue(this.context) && (expr.constantValue(this.context) == null);
 }