Package org.thymeleaf.processor.element
Class AbstractElementModelProcessor
- java.lang.Object
-
- org.thymeleaf.processor.AbstractProcessor
-
- org.thymeleaf.processor.element.AbstractElementModelProcessor
-
- All Implemented Interfaces:
IElementModelProcessor,IElementProcessor,IProcessor
- Direct Known Subclasses:
AbstractAttributeModelProcessor
public abstract class AbstractElementModelProcessor extends AbstractProcessor implements IElementModelProcessor
Basic abstract implementation of
IElementModelProcessorfor processors that match element events by their element name (i.e. without looking at any attributes).- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdialectPrefixprivate MatchingAttributeNamematchingAttributeNameprivate MatchingElementNamematchingElementName
-
Constructor Summary
Constructors Constructor Description AbstractElementModelProcessor(TemplateMode templateMode, java.lang.String dialectPrefix, java.lang.String elementName, boolean prefixElementName, java.lang.String attributeName, boolean prefixAttributeName, int precedence)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoProcess(ITemplateContext context, IModel model, IElementModelStructureHandler structureHandler)protected java.lang.StringgetDialectPrefix()MatchingAttributeNamegetMatchingAttributeName()Returns the attribute name that would make this processor match (if any).MatchingElementNamegetMatchingElementName()Returns the element name that would make this processor match (if any).voidprocess(ITemplateContext context, IModel model, IElementModelStructureHandler structureHandler)Execute the processor.-
Methods inherited from class org.thymeleaf.processor.AbstractProcessor
getPrecedence, getTemplateMode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.thymeleaf.processor.IProcessor
getPrecedence, getTemplateMode
-
-
-
-
Field Detail
-
dialectPrefix
private final java.lang.String dialectPrefix
-
matchingElementName
private final MatchingElementName matchingElementName
-
matchingAttributeName
private final MatchingAttributeName matchingAttributeName
-
-
Constructor Detail
-
AbstractElementModelProcessor
public AbstractElementModelProcessor(TemplateMode templateMode, java.lang.String dialectPrefix, java.lang.String elementName, boolean prefixElementName, java.lang.String attributeName, boolean prefixAttributeName, int precedence)
-
-
Method Detail
-
getDialectPrefix
protected final java.lang.String getDialectPrefix()
-
getMatchingElementName
public final MatchingElementName getMatchingElementName()
Description copied from interface:IElementProcessorReturns the element name that would make this processor match (if any).
- Specified by:
getMatchingElementNamein interfaceIElementProcessor- Returns:
- the element name.
-
getMatchingAttributeName
public final MatchingAttributeName getMatchingAttributeName()
Description copied from interface:IElementProcessorReturns the attribute name that would make this processor match (if any).
- Specified by:
getMatchingAttributeNamein interfaceIElementProcessor- Returns:
- the attribute name.
-
process
public final void process(ITemplateContext context, IModel model, IElementModelStructureHandler structureHandler)
Description copied from interface:IElementModelProcessorExecute the processor.
The
IModelobject represents the section of template (a fragment) on which the processor is executing, and can be directly modified. Instructions to be given to the template engine such as local variable creation, inlining etc. should be done via theIElementModelStructureHandlerhandler.- Specified by:
processin interfaceIElementModelProcessor- Parameters:
context- the execution context.model- the model this processor is executing on.structureHandler- the handler that will centralise modifications and commands to the engine.
-
doProcess
protected abstract void doProcess(ITemplateContext context, IModel model, IElementModelStructureHandler structureHandler)
-
-