Package org.thymeleaf.spring5.processor
Class SpringErrorClassTagProcessor
- Object
-
- org.thymeleaf.processor.AbstractProcessor
-
- org.thymeleaf.processor.element.AbstractElementTagProcessor
-
- org.thymeleaf.processor.element.AbstractAttributeTagProcessor
-
- org.thymeleaf.spring5.processor.SpringErrorClassTagProcessor
-
- All Implemented Interfaces:
org.thymeleaf.engine.IAttributeDefinitionsAware
,org.thymeleaf.processor.element.IElementProcessor
,org.thymeleaf.processor.element.IElementTagProcessor
,org.thymeleaf.processor.IProcessor
public final class SpringErrorClassTagProcessor extends org.thymeleaf.processor.element.AbstractAttributeTagProcessor implements org.thymeleaf.engine.IAttributeDefinitionsAware
Adds the given class to the field on which this attribute is applied, if that field contains errors. It's similar to a combination ofth:classappend
with a${#fields.hasErrors()}
expression.- Since:
- 3.0.3
- Author:
- Daniel Fernández
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_NAME
static int
ATTR_PRECEDENCE
static String
TARGET_ATTR_NAME
-
Constructor Summary
Constructors Constructor Description SpringErrorClassTagProcessor(String dialectPrefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doProcess(org.thymeleaf.context.ITemplateContext context, org.thymeleaf.model.IProcessableElementTag tag, org.thymeleaf.engine.AttributeName attributeName, String attributeValue, org.thymeleaf.processor.element.IElementTagStructureHandler structureHandler)
void
setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions attributeDefinitions)
-
Methods inherited from class org.thymeleaf.processor.element.AbstractAttributeTagProcessor
doProcess
-
Methods inherited from class org.thymeleaf.processor.element.AbstractElementTagProcessor
getDialectPrefix, getMatchingAttributeName, getMatchingElementName, process
-
Methods inherited from class org.thymeleaf.processor.AbstractProcessor
getPrecedence, getTemplateMode
-
-
-
-
Field Detail
-
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
-
TARGET_ATTR_NAME
public static final String TARGET_ATTR_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SpringErrorClassTagProcessor
public SpringErrorClassTagProcessor(String dialectPrefix)
-
-
Method Detail
-
setAttributeDefinitions
public void setAttributeDefinitions(org.thymeleaf.engine.AttributeDefinitions attributeDefinitions)
- Specified by:
setAttributeDefinitions
in interfaceorg.thymeleaf.engine.IAttributeDefinitionsAware
-
doProcess
protected final void doProcess(org.thymeleaf.context.ITemplateContext context, org.thymeleaf.model.IProcessableElementTag tag, org.thymeleaf.engine.AttributeName attributeName, String attributeValue, org.thymeleaf.processor.element.IElementTagStructureHandler structureHandler)
- Specified by:
doProcess
in classorg.thymeleaf.processor.element.AbstractAttributeTagProcessor
-
-