/* second objectNode is the variable to iterate */
Object iterableValue = node.jjtGetChild(1).jjtAccept(this, data);
// make sure there is a value to iterate on and a statement to execute
if (iterableValue != null && node.jjtGetNumChildren() >= 3) {
/* third objectNode is the statement to execute */
JexlNode statement = node.jjtGetChild(2);
// get an iterator for the collection/array etc via the
// introspector.
Iterator<?> itemsIterator = getUberspect().getIterator(iterableValue, node);
if (itemsIterator != null) {
while (itemsIterator.hasNext()) {
// set loopVariable to value of iterator
Object value = itemsIterator.next();
context.set(loopVariable.image, value);
// execute statement
result = statement.jjtAccept(this, data);
}
}
}
return result;
}