Package jodd.util

Examples of jodd.util.LoopIterator


    JspFragment body = getJspBody();
    if (body == null) {
      return;
    }

    LoopIterator loopIterator = new LoopIterator(start, end, step, modulus);
    if (status != null) {
      getJspContext().setAttribute(status, loopIterator);
    }
    while (loopIterator.next()) {
      TagUtil.invokeBody(body);
    }
    if (status != null) {
      getJspContext().removeAttribute(status);
    }
View Full Code Here


    assertEquals(6, jspFragment.count);

    jspFragment.count = 0;
    jspFragment.invokeCallback = new MockJspFragment.InvokeCallback() {
      public void onInvoke(int count) {
        LoopIterator s = (LoopIterator) jspContext.getAttribute("s");
        assertNotNull(s);

        assertEquals(count, s.getCount());
        assertEquals(count - 1, s.getValue());
        assertEquals(count - 1, s.getIndex());
        assertEquals(count % s.getModulusValue(), s.getModulus());
      }
    };
    loopTag.setStatus("s");
    loopTag.doTag();
    assertNull(jspContext.getAttribute("s"));    // attribute was cleared
View Full Code Here

TOP

Related Classes of jodd.util.LoopIterator

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.