org.thymeleaf.standard.processor.attr
Class StandardSwitchAttrProcessor
Object
org.thymeleaf.processor.AbstractProcessor
org.thymeleaf.processor.attr.AbstractAttrProcessor
org.thymeleaf.processor.attr.AbstractLocalVariableDefinitionAttrProcessor
org.thymeleaf.standard.processor.attr.AbstractStandardSwitchStructureAttrProcessor
org.thymeleaf.standard.processor.attr.StandardSwitchAttrProcessor
- All Implemented Interfaces:
- Comparable<IProcessor>, IProcessor
public final class StandardSwitchAttrProcessor
- extends AbstractStandardSwitchStructureAttrProcessor
Selects a child element for rendering if the child's th:case
expression is an exact match of this processor's expression, eg:
<div th:switch="${user.role}">
<p th:case="'admin'">User is an administrator</p>
<p th:case="#{roles.manager}">User is a manager</p>
</div>
Note that as soon as one th:case attribute is evaluated as true, every other
th:case attribute in the same switch context is evaluated as false.
The default option is specified as th:case="*"
- Since:
- 2.0.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
StandardSwitchAttrProcessor
public StandardSwitchAttrProcessor()
getPrecedence
public int getPrecedence()
- Specified by:
getPrecedence
in class AbstractProcessor
Copyright © 2013 The THYMELEAF team. All Rights Reserved.