Class EscaperExtension
java.lang.Object
io.pebbletemplates.pebble.extension.AbstractExtension
io.pebbletemplates.pebble.extension.escaper.EscaperExtension
- All Implemented Interfaces:
Extension
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEscapingStrategy(String name, EscapingStrategy strategy) Adds a custom escaping strategy to the filter.Use this method to provide custom filters.Node visitors will travel the AST tree during the compilation phase.Use this method to provide custom tags.voidsetAutoEscaping(boolean auto) voidsetDefaultStrategy(String strategy) Sets the default escaping strategy.Methods inherited from class io.pebbletemplates.pebble.extension.AbstractExtension
getAttributeResolver, getBinaryOperators, getFunctions, getGlobalVariables, getTests, getUnaryOperators
-
Constructor Details
-
EscaperExtension
public EscaperExtension()
-
-
Method Details
-
getFilters
Description copied from interface:ExtensionUse this method to provide custom filters.- Specified by:
getFiltersin interfaceExtension- Overrides:
getFiltersin classAbstractExtension- Returns:
- A list of filters. It is okay to return null.
-
getTokenParsers
Description copied from interface:ExtensionUse this method to provide custom tags. A TokenParser is used to parse a stream of tokens into Nodes which are then responsible for compiling themselves into Java.- Specified by:
getTokenParsersin interfaceExtension- Overrides:
getTokenParsersin classAbstractExtension- Returns:
- A list of TokenParsers. It is okay to return null.
-
getNodeVisitors
Description copied from interface:ExtensionNode visitors will travel the AST tree during the compilation phase.- Specified by:
getNodeVisitorsin interfaceExtension- Overrides:
getNodeVisitorsin classAbstractExtension- Returns:
- a list of node visitors
-
setDefaultStrategy
Sets the default escaping strategy.- Parameters:
strategy- Escaping strategy
-
setAutoEscaping
public void setAutoEscaping(boolean auto) -
addEscapingStrategy
Adds a custom escaping strategy to the filter.- Parameters:
name- Name of the escaping strategystrategy- The implementation of the escaping strategy
-