@Override
public void doTag() throws JspException {
if (items == null) {
return;
}
JspFragment body = getJspBody();
if (body == null) {
return;
}
PageContext pageContext = (PageContext) getJspContext();
if (status != null) {
iteratorStatus = new IteratorStatus(this.modulus);
TagUtil.setScopeAttribute(status, iteratorStatus, scope, pageContext);
}
if (items instanceof Collection) {
iterateCollection((Collection) items, from, count, pageContext);
} else if (items.getClass().isArray()) {
iterateArray((Object[]) items, from, count, pageContext);
} else if (items instanceof String) {
iterateArray(Converter.get().toStringArray(items), from, count, pageContext);
} else {
throw new JspException("Provided items are not iterable");
}
if (status != null) {
TagUtil.removeScopeAttribute(status, scope, pageContext);
}
TagUtil.removeScopeAttribute(var, scope, pageContext);
}