Package io.quarkus.qute
Class Qute.Fmt
java.lang.Object
io.quarkus.qute.Qute.Fmt
- Enclosing class:
- Qute
This construct is not thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionSet the template instance attribute.cache()Use the template cache, i.e.contentType(String contentType) Set the template content type.The data array is accessibe via thedatakey, e.g.instance()noCache()Do not use the cache, i.e.render()toString()Set the template variant.
-
Method Details
-
cache
Use the template cache, i.e. first attempt to find the parsed template in the cache and if not found then parse the template and store the instance in the cache.Note that caching greatly improves the performance of formatting, albeit increases the memory usage.
- Returns:
- self
- See Also:
-
noCache
Do not use the cache, i.e. always parse the template.- Returns:
- self
-
contentType
Set the template content type.- Returns:
- self
- See Also:
-
variant
Set the template variant.- Returns:
- self
- See Also:
-
attribute
Set the template instance attribute.- Returns:
- self
- See Also:
-
dataArray
The data array is accessibe via thedatakey, e.g. {data[0]} is resolved to the first argument.An empty expression
{}is a placeholder that is replaced with an index-based array accessor{data[n]}wherenis the index of the placeholder. The first placeholder is replace with{data[0]}, the second with{data[1]}, and so on. For example,"Hello {}!"becomesHello {data[0]}!.- Parameters:
data-- Returns:
- self
-
dataMap
-
data
-
render
- Returns:
- the rendered template
-
instance
- Returns:
- a new template instance
-
toString
-