Class TitlePatternProcessor
- java.lang.Object
-
- org.thymeleaf.processor.AbstractProcessor
-
- org.thymeleaf.processor.element.AbstractElementTagProcessor
-
- org.thymeleaf.processor.element.AbstractAttributeTagProcessor
-
- nz.net.ultraq.thymeleaf.layoutdialect.decorators.TitlePatternProcessor
-
- All Implemented Interfaces:
IElementProcessor
,IElementTagProcessor
,IProcessor
public class TitlePatternProcessor extends AbstractAttributeTagProcessor
Allows for greater control of the resulting<title>
element by specifying a pattern with some special tokens. This can be used to extend the layout's title with the content's one, instead of simply overriding it.- Author:
- zhanhb, Emanuel Rabina
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_TITLE_KEY
static String
LAYOUT_TITLE_KEY
static String
PROCESSOR_NAME
static int
PROCESSOR_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description TitlePatternProcessor(TemplateMode templateMode, String dialectPrefix)
Constructor, sets this processor to work on the 'title-pattern' attribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName, String attributeValue, IElementTagStructureHandler structureHandler)
Process thelayout:title-pattern
directive, replaces the title text with the titles from the content and layout pages.-
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
-
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
-
CONTENT_TITLE_KEY
public static final String CONTENT_TITLE_KEY
- See Also:
- Constant Field Values
-
LAYOUT_TITLE_KEY
public static final String LAYOUT_TITLE_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TitlePatternProcessor
public TitlePatternProcessor(TemplateMode templateMode, String dialectPrefix)
Constructor, sets this processor to work on the 'title-pattern' attribute.- Parameters:
templateMode
-dialectPrefix
-
-
-
Method Detail
-
doProcess
protected void doProcess(ITemplateContext context, IProcessableElementTag tag, AttributeName attributeName, String attributeValue, IElementTagStructureHandler structureHandler)
Process thelayout:title-pattern
directive, replaces the title text with the titles from the content and layout pages.- Specified by:
doProcess
in classAbstractAttributeTagProcessor
- Parameters:
context
-tag
-attributeName
-attributeValue
-structureHandler
-
-
-