Class EscaperExtension
java.lang.Object
io.pebbletemplates.pebble.extension.AbstractExtension
io.pebbletemplates.pebble.extension.escaper.EscaperExtension
- All Implemented Interfaces:
Extension
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EscapeFilter
private final EscaperNodeVisitorFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEscapingStrategy
(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.void
setAutoEscaping
(boolean auto) void
setDefaultStrategy
(String strategy) Sets the default escaping strategy.Methods inherited from class io.pebbletemplates.pebble.extension.AbstractExtension
getAttributeResolver, getBinaryOperators, getFunctions, getGlobalVariables, getTests, getUnaryOperators
-
Field Details
-
filter
-
visitorFactory
-
-
Constructor Details
-
EscaperExtension
public EscaperExtension()
-
-
Method Details
-
getFilters
Description copied from interface:Extension
Use this method to provide custom filters.- Specified by:
getFilters
in interfaceExtension
- Overrides:
getFilters
in classAbstractExtension
- Returns:
- A list of filters. It is okay to return null.
-
getTokenParsers
Description copied from interface:Extension
Use 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:
getTokenParsers
in interfaceExtension
- Overrides:
getTokenParsers
in classAbstractExtension
- Returns:
- A list of TokenParsers. It is okay to return null.
-
getNodeVisitors
Description copied from interface:Extension
Node visitors will travel the AST tree during the compilation phase.- Specified by:
getNodeVisitors
in interfaceExtension
- Overrides:
getNodeVisitors
in 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
-