Class Qute.Fmt

java.lang.Object
io.quarkus.qute.Qute.Fmt
Enclosing class:
Qute

public static final class Qute.Fmt extends Object
This construct is not thread-safe.
  • Method Details

    • cache

      public Qute.Fmt 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

      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

      public Qute.Fmt variant(Variant variant)
      Set the template variant.
      Returns:
      self
      See Also:
    • attribute

      public Qute.Fmt attribute(String key, Object value)
      Set the template instance attribute.
      Returns:
      self
      See Also:
    • dataArray

      public Qute.Fmt dataArray(Object... data)
      The data array is accessibe via the data key, 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]} where n is the index of the placeholder. The first placeholder is replace with {data[0]}, the second with {data[1]}, and so on. For example, "Hello {}!" becomes Hello {data[0]}!.

      Parameters:
      data -
      Returns:
      self
    • dataMap

      public Qute.Fmt dataMap(Map<String,Object> data)
    • data

      public Qute.Fmt data(String key, Object data)
    • render

      public String render()
      Returns:
      the rendered template
    • instance

      public TemplateInstance instance()
      Returns:
      a new template instance
    • toString

      public String toString()
      Overrides:
      toString in class Object