public final class StandardStyleappendAttrProcessor extends AbstractStandardSingleAttributeModifierAttrProcessor
<div style="margin: 0;" th:styleappend="${myObject.type == 'special'} ? 'color: green;' : 'color: black;'" />
Depending on the result of the expression, the style attribute will become either "margin: 0; color: green;" or "margin: 0; color: black;".
AbstractAttributeModifierAttrProcessor.ModificationType
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_NAME |
static int |
ATTR_PRECEDENCE |
static String |
TARGET_ATTR_NAME |
Constructor and Description |
---|
StandardStyleappendAttrProcessor() |
Modifier and Type | Method and Description |
---|---|
protected AbstractAttributeModifierAttrProcessor.ModificationType |
getModificationType(Arguments arguments,
Element element,
String attributeName,
String newAttributeName) |
int |
getPrecedence() |
protected String |
getTargetAttributeName(Arguments arguments,
Element element,
String attributeName) |
protected boolean |
removeAttributeIfEmpty(Arguments arguments,
Element element,
String attributeName,
String newAttributeName) |
getTargetAttributeValue, recomputeProcessorsAfterExecution
getModifiedAttributeValues
doAdditionalProcess, processAttribute, shouldRemoveAttribute
doProcess, getMatcher
compareTo, getMessage, getMessageForProcessor, getMessageForTemplate, process
public static final int ATTR_PRECEDENCE
public static final String ATTR_NAME
public static final String TARGET_ATTR_NAME
public int getPrecedence()
getPrecedence
in class AbstractProcessor
protected String getTargetAttributeName(Arguments arguments, Element element, String attributeName)
getTargetAttributeName
in class AbstractSingleAttributeModifierAttrProcessor
protected AbstractAttributeModifierAttrProcessor.ModificationType getModificationType(Arguments arguments, Element element, String attributeName, String newAttributeName)
getModificationType
in class AbstractAttributeModifierAttrProcessor
protected boolean removeAttributeIfEmpty(Arguments arguments, Element element, String attributeName, String newAttributeName)
removeAttributeIfEmpty
in class AbstractAttributeModifierAttrProcessor
Copyright © 2016 The THYMELEAF team. All rights reserved.