Tabnine Logo
ForLoop$Loop
Code IndexAdd Tabnine to your IDE (free)

How to use
ForLoop$Loop
in
com.lyncode.jtwig.tree.content

Best Java code snippets using com.lyncode.jtwig.tree.content.ForLoop$Loop (Showing top 4 results out of 315)

origin: com.lyncode/jtwig-core-java6

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    Object resolved = expression.calculate(context);
    if (!(resolved instanceof Map))
      throw new RenderException("Expecting a map as parameter for the loop but "+expression+" was given");
    Map map = (Map) resolved;
    Loop loop = new Loop(map.size());
    context.set("loop", loop);
    int index = 0;
    for (Object key : map.keySet()) {
      loop.update(index++);
      context.set(variable.getIdentifier(), key);
      context.set(value.getIdentifier(), map.get(key));
      content.render(outputStream, context);
    }
    return true;
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    Object resolved = expression.calculate(context);
    if (!(resolved instanceof Map))
      throw new RenderException("Expecting a map as parameter for the loop but "+expression+" was given");
    Map map = (Map) resolved;
    Loop loop = new Loop(map.size());
    context.set("loop", loop);
    int index = 0;
    for (Object key : map.keySet()) {
      loop.update(index++);
      context.set(variable.getIdentifier(), key);
      context.set(value.getIdentifier(), map.get(key));
      content.render(outputStream, context);
    }
    return true;
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
origin: com.lyncode/jtwig-core-java6-legacy-jee

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    ObjectIterator iterator = new ObjectIterator(expression.calculate(context));
    Loop loop = new Loop(iterator.size());
    context.set("loop", loop);
    int index = 0;
    while (iterator.hasNext()) {
      loop.update(index++);
      Object object = iterator.next();
      context.set(variable.getIdentifier(), object);
      content.render(outputStream, context);
    }
    return true;
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
origin: com.lyncode/jtwig-core-java6

@Override
public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException {
  try {
    ObjectIterator iterator = new ObjectIterator(expression.calculate(context));
    Loop loop = new Loop(iterator.size());
    context.set("loop", loop);
    int index = 0;
    while (iterator.hasNext()) {
      loop.update(index++);
      Object object = iterator.next();
      context.set(variable.getIdentifier(), object);
      content.render(outputStream, context);
    }
    return true;
  } catch (CalculateException e) {
    throw new RenderException(e);
  }
}
com.lyncode.jtwig.tree.contentForLoop$Loop

Most used methods

  • <init>
  • update

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Table (org.hibernate.mapping)
    A relational table
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now