|
5 | 5 | import org.thymeleaf.dialect.IProcessorDialect;
|
6 | 6 | import org.thymeleaf.engine.AttributeName;
|
7 | 7 | import org.thymeleaf.model.IModel;
|
| 8 | +import org.thymeleaf.model.IProcessableElementTag; |
8 | 9 | import org.thymeleaf.processor.IProcessor;
|
9 | 10 | import org.thymeleaf.processor.element.AbstractAttributeModelProcessor;
|
| 11 | +import org.thymeleaf.processor.element.AbstractAttributeTagProcessor; |
10 | 12 | import org.thymeleaf.processor.element.IElementModelStructureHandler;
|
| 13 | +import org.thymeleaf.processor.element.IElementTagStructureHandler; |
| 14 | +import org.thymeleaf.standard.StandardDialect; |
11 | 15 | import org.thymeleaf.templatemode.TemplateMode;
|
12 | 16 |
|
13 | 17 | import java.util.Collections;
|
|
21 | 25 | public class CmsDialect extends AbstractProcessorDialect {
|
22 | 26 |
|
23 | 27 | public CmsDialect() {
|
24 |
| - super("CMS", "cms", 1); |
| 28 | + super("CMS", "cms", StandardDialect.PROCESSOR_PRECEDENCE); |
25 | 29 | }
|
26 | 30 |
|
27 | 31 | public Set<IProcessor> getProcessors(String dialectPrefix) {
|
28 |
| - IProcessor processor = new AbstractAttributeModelProcessor(TemplateMode.HTML, dialectPrefix, null, false, "fragment", false, 1, true) { |
29 |
| - @Override |
30 |
| - protected void doProcess(ITemplateContext context, IModel model, AttributeName attributeName, String attributeValue, IElementModelStructureHandler structureHandler) { |
| 32 | + IProcessor processor = new AbstractAttributeTagProcessor(TemplateMode.HTML, dialectPrefix, null, false, "fragment", true, StandardDialect.PROCESSOR_PRECEDENCE, true) { |
31 | 33 |
|
| 34 | + protected void doProcess(ITemplateContext iTemplateContext, IProcessableElementTag iProcessableElementTag, AttributeName attributeName, String attributeValue, IElementTagStructureHandler iElementTagStructureHandler) { |
| 35 | + iElementTagStructureHandler.setBody("content <strong>from</strong> CMS", false); |
32 | 36 | }
|
33 | 37 | };
|
34 | 38 | return Collections.singleton(processor);
|
|
0 commit comments