/*
* Note: we don't check for type mismatches here; we assume
* the expression evaluator will return the expected type
* (by virtue of knowledge we give it about what that type is).
* A ClassCastException here is truly unexpected, so we let it
* propagate up.
*/
if (begin_ != null) {
Object r = ExpressionEvaluatorManager.evaluate(
"begin", begin_, Integer.class, this, pageContext);
if (r == null)
throw new NullAttributeException("forEach", "begin");
begin = ((Integer) r).intValue();
validateBegin();
}
if (end_ != null) {
Object r = ExpressionEvaluatorManager.evaluate(
"end", end_, Integer.class, this, pageContext);
if (r == null)
throw new NullAttributeException("forEach", "end");
end = ((Integer) r).intValue();
validateEnd();
}
if (step_ != null) {
Object r = ExpressionEvaluatorManager.evaluate(
"step", step_, Integer.class, this, pageContext);
if (r == null)
throw new NullAttributeException("forEach", "step");
step = ((Integer) r).intValue();
validateStep();
}
if (items_ != null) {
rawItems = ExpressionEvaluatorManager.evaluate(
"items", items_, Object.class, this, pageContext);
// use an empty list to indicate "no iteration", if relevant
if (rawItems == null)
rawItems = new ArrayList();
}