Class EscapeChar
- java.lang.Object
-
- org.openapitools.codegen.templating.mustache.EscapeChar
-
- All Implemented Interfaces:
com.samskivert.mustache.Mustache.Lambda
public class EscapeChar extends Object implements com.samskivert.mustache.Mustache.Lambda
Escapes the desired character if not escaped already, e.g.$ => \$
.Register:
additionalProperties.put("escapeDollar", new EscapeChar("(?<!\\\\)\\$", "\\\\\\$"));
Use:
{{#lambda.escapeDollar}}{{name}}{{/lambda.escapeDollar}}
-
-
Constructor Summary
Constructors Constructor Description EscapeChar(String matchPattern, String replacement)
Constructs a new instance ofEscapeChar
, with the desired character to escape
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(com.samskivert.mustache.Template.Fragment fragment, Writer writer)
-
-
-
Constructor Detail
-
EscapeChar
public EscapeChar(String matchPattern, String replacement)
Constructs a new instance ofEscapeChar
, with the desired character to escape- Parameters:
matchPattern
- the character to escapereplacement
- the escaped character
-
-
Method Detail
-
execute
public void execute(com.samskivert.mustache.Template.Fragment fragment, Writer writer) throws IOException
- Specified by:
execute
in interfacecom.samskivert.mustache.Mustache.Lambda
- Throws:
IOException
-
-