org.thymeleaf.standard.processor.attr
Class StandardEachAttrProcessor
Object
org.thymeleaf.processor.AbstractProcessor
org.thymeleaf.processor.attr.AbstractAttrProcessor
org.thymeleaf.processor.attr.AbstractIterationAttrProcessor
org.thymeleaf.standard.processor.attr.AbstractStandardIterationAttrProcessor
org.thymeleaf.standard.processor.attr.StandardEachAttrProcessor
- All Implemented Interfaces:
- Comparable<IProcessor>, IProcessor
public final class StandardEachAttrProcessor
- extends AbstractStandardIterationAttrProcessor
Iterates through a collection of objects, repeating each of the child
elements for every object in that collection, eg:
<tr th:each="prod : ${prods}">
<td th:text="${prod.name}">Product name</td>
<td th:text="${prod.price}">Product price</td>
</tr>
That "prod : ${prods}" attribute value you see above means "for each element
in the result of evaluating ${prods}, repeat this fragment of template
setting that element into a variable called prod".
A collection can be any java.util.Iterable, a java.util.Map
(iteration variables will be a java.util.Map.Entry), or an array.
- Since:
- 1.0
- Author:
- Daniel Fernández
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ATTR_PRECEDENCE
public static final int ATTR_PRECEDENCE
- See Also:
- Constant Field Values
ATTR_NAME
public static final String ATTR_NAME
- See Also:
- Constant Field Values
StandardEachAttrProcessor
public StandardEachAttrProcessor()
getPrecedence
public int getPrecedence()
- Specified by:
getPrecedence
in class AbstractProcessor
Copyright © 2014 The THYMELEAF team. All Rights Reserved.