public class StringPlaceholderEngine extends Engine<java.lang.String>
Constructor and Description |
---|
StringPlaceholderEngine() |
Modifier and Type | Method and Description |
---|---|
void |
render(java.lang.String file,
java.util.Map<java.lang.String,java.lang.Object> context,
org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<java.lang.String>> handler)
An interpreter for strings with named placeholders.
|
getContentType, getTemplateFromCache, isFresh, putTemplateToCache, read, removeFromCache, setVertx
public void render(java.lang.String file, java.util.Map<java.lang.String,java.lang.Object> context, org.vertx.java.core.Handler<org.vertx.java.core.AsyncResult<java.lang.String>> handler)
Map map = new HashMap();
map.put("myName", "world");
the call returns "hello world"
It replaces every occurrence of a named placeholder with its given value
in the map. If there is a named place holder which is not found in the
map then the string will retain that placeholder. Likewise, if there is
an entry in the map that does not have its respective placeholder, it is
ignored.