Package httl.util

Examples of httl.util.Status


  public boolean visit(ForDirective node) throws IOException, ParseException {
    Object data = popExpressionResult(node.getOffset());
    boolean result = ClassUtils.isTrue(data);
    Context.getContext().put(ifVariable, result);
    Iterator<?> iterator = CollectionUtils.toIterator(data);
    Status status = new Status((Status) Context.getContext().get(forVariable[0]), data);
    for (String var : forVariable) {
      Context.getContext().put(var, status);
    }
    loop: while (iterator.hasNext()) {
      Object item = iterator.next();
      Context.getContext().put(node.getName(), item);
      for (Node child : node.getChildren()) {
        child.accept(this);
        if (ClassUtils.isTrue(Context.getContext().get(breakVariable))) {
          Context.getContext().remove(breakVariable);
          break loop;
        }
      }
      status.increment();
    }
    for (String var : forVariable) {
      Context.getContext().put(var, status.getParent());
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of httl.util.Status

Copyright © 2018 www.massapicom. 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.