Package com.google.clearsilver.jsilver.values

Examples of com.google.clearsilver.jsilver.values.Value.asBoolean()


*/
public class NotFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value value = args[0];
    return literalConstant(!value.asBoolean(), value);
  }

}
View Full Code Here


public class AndFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value left = args[0];
    Value right = args[1];
    return literalConstant(left.asBoolean() && right.asBoolean(), left, right);
  }

}
View Full Code Here

   */
  @Override
  public void caseAIfCommand(AIfCommand node) {
    setLastPosition(node.getPosition());
    Value value = expressionEvaluator.evaluate(node.getExpression());
    if (value.asBoolean()) {
      node.getBlock().apply(this);
    } else {
      node.getOtherwise().apply(this);
    }
  }
View Full Code Here

   */
  @Override
  public void caseAAltCommand(AAltCommand node) {
    setLastPosition(node.getPosition());
    Value value = expressionEvaluator.evaluate(node.getExpression());
    if (value.asBoolean()) {
      writeVariable(value);
    } else {
      node.getCommand().apply(this);
    }
  }
View Full Code Here

public class OrFunction extends NonEscapingFunction {

  public Value execute(Value... args) {
    Value left = args[0];
    Value right = args[1];
    return literalConstant(left.asBoolean() || right.asBoolean(), left, right);
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.