Merge branch 'gh-4047'

This commit is contained in:
Andy Wilkinson 2015-10-02 09:13:28 +01:00
commit 0c2f281e89
1 changed files with 18 additions and 0 deletions

View File

@ -48,6 +48,10 @@ public class MustacheCompilerFactoryBean implements FactoryBean<Mustache.Compile
private Compiler compiler;
private String defaultValue;
private Boolean emptyStringIsFalse;
public void setDelims(String delims) {
this.delims = delims;
}
@ -68,6 +72,14 @@ public class MustacheCompilerFactoryBean implements FactoryBean<Mustache.Compile
this.collector = collector;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public void setEmptyStringIsFalse(Boolean emptyStringIsFalse) {
this.emptyStringIsFalse = emptyStringIsFalse;
}
@Override
public Mustache.Compiler getObject() throws Exception {
this.compiler = Mustache.compiler();
@ -86,6 +98,12 @@ public class MustacheCompilerFactoryBean implements FactoryBean<Mustache.Compile
if (this.collector != null) {
this.compiler = this.compiler.withCollector(this.collector);
}
if (this.defaultValue != null) {
this.compiler = this.compiler.defaultValue(this.defaultValue);
}
if (this.emptyStringIsFalse != null) {
this.compiler = this.compiler.emptyStringIsFalse(this.emptyStringIsFalse);
}
return this.compiler;
}