Class ReplaceProcessor
- java.lang.Object
-
- org.thymeleaf.processor.AbstractProcessor
-
- org.thymeleaf.processor.element.AbstractElementModelProcessor
-
- org.thymeleaf.processor.element.AbstractAttributeModelProcessor
-
- nz.net.ultraq.thymeleaf.layoutdialect.includes.ReplaceProcessor
-
- All Implemented Interfaces:
IElementModelProcessor
,IElementProcessor
,IProcessor
public class ReplaceProcessor extends AbstractAttributeModelProcessor
Similar to Thymeleaf'sth:replace
, but allows the passing of entire element fragments to the included template. Useful if you have some HTML that you want to reuse, but whose contents are too complex to determine or construct with context variables alone.- Author:
- zhanhb, Emanuel Rabina
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROCESSOR_NAME
static int
PROCESSOR_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description ReplaceProcessor(TemplateMode templateMode, String dialectPrefix)
Constructor, set this processor to work on the 'replace' attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doProcess(ITemplateContext context, IModel model, AttributeName attributeName, String attributeValue, IElementModelStructureHandler structureHandler)
Locates a page fragment and uses it to replace the current element.-
Methods inherited from class org.thymeleaf.processor.element.AbstractAttributeModelProcessor
doProcess
-
Methods inherited from class org.thymeleaf.processor.element.AbstractElementModelProcessor
getDialectPrefix, getMatchingAttributeName, getMatchingElementName, process
-
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
-
PROCESSOR_NAME
public static final String PROCESSOR_NAME
- See Also:
- Constant Field Values
-
PROCESSOR_PRECEDENCE
public static final int PROCESSOR_PRECEDENCE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReplaceProcessor
public ReplaceProcessor(TemplateMode templateMode, String dialectPrefix)
Constructor, set this processor to work on the 'replace' attribute.- Parameters:
templateMode
-dialectPrefix
-
-
-
Method Detail
-
doProcess
protected void doProcess(ITemplateContext context, IModel model, AttributeName attributeName, String attributeValue, IElementModelStructureHandler structureHandler)
Locates a page fragment and uses it to replace the current element.- Specified by:
doProcess
in classAbstractAttributeModelProcessor
- Parameters:
context
-model
-attributeName
-attributeValue
-structureHandler
-
-
-