|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.jknack.handlebars.helper.EachHelper
public class EachHelper
You can iterate over a list using the built-in each helper. Inside the
block, you can use this to reference the element being
iterated over.
| Field Summary | |
|---|---|
static Helper<Object> |
INSTANCE
A singleton instance of this helper. |
static String |
NAME
The helper's name. |
| Constructor Summary | |
|---|---|
EachHelper()
|
|
| Method Summary | |
|---|---|
CharSequence |
apply(Object context,
Options options)
Callback method for execute the given method. |
protected Object |
next(Context parent,
Iterator<Object> iterator,
int index)
Retrieve the next element available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Helper<Object> INSTANCE
public static final String NAME
| Constructor Detail |
|---|
public EachHelper()
| Method Detail |
|---|
public CharSequence apply(Object context,
Options options)
throws IOException
Helper
apply in interface Helper<Object>context - The context object (param=0).options - The options object.
IOException - If a template cannot be loaded.
protected Object next(Context parent,
Iterator<Object> iterator,
int index)
parent - The parent context.iterator - The element iterator.index - The nth position of this element. Zero base.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||