public class IndentedLambda extends Object implements com.samskivert.mustache.Mustache.Lambda
Generator authors may add helpers for explicitly adding prefixed spaces which fragments won't be aware of.
Register:
additionalProperties.put("indent4", new IndentedLambda(4));
additionalProperties.put("indent8", new IndentedLambda(8));
Use:
{{#indent4}}{{>template}}{{/indent4}}
{{#indent8}}{{>other_template}}{{/indent8}}
| 构造器和说明 |
|---|
IndentedLambda()
Constructs a new instance of
IndentedLambda, with an indent count of 4 spaces |
IndentedLambda(int prefixSpaceCount,
String indentionCharacter)
Constructs a new instance of
IndentedLambda, with customized indent count and intention character |
IndentedLambda(int prefixSpaceCount,
String indentionCharacter,
String prefix)
Constructs a new instance of
IndentedLambda, with customized indent count and intention character |
public IndentedLambda()
IndentedLambda, with an indent count of 4 spacespublic IndentedLambda(int prefixSpaceCount,
String indentionCharacter)
IndentedLambda, with customized indent count and intention characterprefixSpaceCount - The number of indented characters to apply as a prefix to a fragment.indentionCharacter - String representation of the character used in the indent (e.g. " ", "\t", ".").public IndentedLambda(int prefixSpaceCount,
String indentionCharacter,
String prefix)
IndentedLambda, with customized indent count and intention characterprefixSpaceCount - The number of indented characters to apply as a prefix to a fragment.indentionCharacter - String representation of the character used in the indent (e.g. " ", "\t", ".").prefix - An optional prefix to prepend before the line (useful for multi-line comments).public void execute(com.samskivert.mustache.Template.Fragment fragment,
Writer writer)
throws IOException
execute 在接口中 com.samskivert.mustache.Mustache.LambdaIOExceptionCopyright © 2019. All rights reserved.