Added a caveat default values.

I want to ensure the reader notes the difference between variables and
sections.
This commit is contained in:
Michael Bayne
2014-12-20 11:10:10 -08:00
parent 8618f89f7e
commit 17fe45ee8d
+3 -3
View File
@@ -170,9 +170,9 @@ one.
Default Values Default Values
-------------- --------------
By default, an exception will be thrown any time a variable cannot be resolved, or resolves to By default, an exception will be thrown any time a variable cannot be resolved, or resolves to null
null. You can change this behavior in two ways. If you want to provide a value for use in all such (except for sections, see below). You can change this behavior in two ways. If you want to provide a
circumstances, use `defaultValue()`: value for use in all such circumstances, use `defaultValue()`:
String tmpl = "{{exists}} {{nullValued}} {{doesNotExist}}?"; String tmpl = "{{exists}} {{nullValued}} {{doesNotExist}}?";
Mustache.compiler().defaultValue("what").compile(tmpl).execute(new Object() { Mustache.compiler().defaultValue("what").compile(tmpl).execute(new Object() {