Package io.quarkus.qute
Class Qute.Fmt
- java.lang.Object
-
- io.quarkus.qute.Qute.Fmt
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Qute.Fmtattribute(String key, Object value)Set the template instance attribute.Qute.Fmtcache()Use the template cache, i.e.Qute.FmtcontentType(String contentType)Set the template content type.Qute.Fmtdata(String key, Object data)Qute.FmtdataArray(Object... data)The data array is accessibe via thedatakey, e.g.Qute.FmtdataMap(Map<String,Object> data)TemplateInstanceinstance()Qute.FmtnoCache()Do not use the cache, i.e.Stringrender()StringtoString()Qute.Fmtvariant(Variant variant)Set the template variant.
-
-
-
Method Detail
-
cache
public Qute.Fmt cache()
Use the template cache, i.e. first attempt to find the parsed template in the cahce 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:
Qute.clearCache()
-
noCache
public Qute.Fmt noCache()
Do not use the cache, i.e. always parse the template.- Returns:
- self
-
contentType
public Qute.Fmt contentType(String contentType)
Set the template content type.- Returns:
- self
- See Also:
Variant
-
variant
public Qute.Fmt variant(Variant variant)
Set the template variant.- Returns:
- self
- See Also:
Variant
-
attribute
public Qute.Fmt attribute(String key, Object value)
Set the template instance attribute.- Returns:
- self
- See Also:
TemplateInstance.setAttribute(String, Object)
-
dataArray
public Qute.Fmt dataArray(Object... data)
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
-
render
public String render()
- Returns:
- the rendered template
-
instance
public TemplateInstance instance()
- Returns:
- a new template instance
-
-