Package com.floreysoft.jmte.token

Examples of com.floreysoft.jmte.token.IfToken.evaluate()


            // ${if item}
            IfToken token3 = new IfToken("item", false);
            context.push(token3);
            try {
              if ((Boolean) token3.evaluate(context)) {

                // ${item2.property1}
                buffer.append(new StringToken(Arrays
                    .asList(new String[] { "item2",
                        "property1" }),
View Full Code Here


    try {
      boolean localSkip;
      if (inheritedSkip) {
        localSkip = true;
      } else {
        localSkip = !(Boolean) ifToken.evaluate(context);
      }

      Token contentToken;
      while ((contentToken = tokenStream.currentToken()) != null
          && !(contentToken instanceof EndToken)
View Full Code Here

  public boolean variablesAvailable(Map<String, Object> model, String... vars) {
    final TemplateContext context = new TemplateContext(null, null, null, new ScopedMap(model), modelAdaptor, this,
        new SilentErrorHandler(), null);
    for (String var : vars) {
      final IfToken token = new IfToken(var, false);
      if (!(Boolean) token.evaluate(context)) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

    IfToken token1 = new IfToken(Arrays.asList(new String[] { "bean",
        "trueCond" }), "bean.trueCond", true);

    context.push(token1);
    try {
      if ((Boolean) token1.evaluate(context)) {
        buffer.append(new StringToken("address", "address", null, null,
            null, null, null).evaluate(context));
      } else {
        buffer.append("NIX");
      }
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.