Package io.quarkus.qute
Class ForwardingTemplateInstance
java.lang.Object
io.quarkus.qute.ForwardingTemplateInstance
- All Implemented Interfaces:
TemplateInstance
- Direct Known Subclasses:
ResultsCollectingTemplateInstance
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkus.qute.TemplateInstance
TemplateInstance.Initializer -
Field Summary
Fields inherited from interface io.quarkus.qute.TemplateInstance
LOCALE, SELECTED_VARIANT, TIMEOUT, VARIANTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTriggers rendering.io.smallrye.mutiny.Multi<String>Create a newMultithat can be used to consume chunks of the rendered template.io.smallrye.mutiny.Uni<String>Create a newUnithat can be used to consume the rendered template.Set the the root data object.Put the data in a map.protected abstract TemplateInstancedelegate()getAttribute(String key) getFragment(String id) longonRendered(Runnable action) Register an action that is performed after the rendering is finished.render()Triggers rendering.Triggers rendering.setAttribute(String key, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.qute.TemplateInstance
computedData, setLocale, setLocale, setVariant
-
Constructor Details
-
ForwardingTemplateInstance
public ForwardingTemplateInstance()
-
-
Method Details
-
delegate
-
data
Description copied from interface:TemplateInstanceSet the the root data object. Invocation of this method removes any data set previously byTemplateInstance.data(String, Object)andTemplateInstance.computedData(String, Function).- Specified by:
datain interfaceTemplateInstance- Returns:
-
data
Description copied from interface:TemplateInstancePut the data in a map. The map will be used as the root context object during rendering. Remove the root data object previously set byTemplateInstance.data(Object).- Specified by:
datain interfaceTemplateInstance- Returns:
- self
-
setAttribute
- Specified by:
setAttributein interfaceTemplateInstance- Returns:
- self
-
getAttribute
- Specified by:
getAttributein interfaceTemplateInstance- Returns:
- the attribute or null
-
render
Description copied from interface:TemplateInstanceTriggers rendering. Note that this method blocks the current thread!- Specified by:
renderin interfaceTemplateInstance- Returns:
- the rendered template as string
-
renderAsync
Description copied from interface:TemplateInstanceTriggers rendering.- Specified by:
renderAsyncin interfaceTemplateInstance- Returns:
- a completion stage that is completed once the rendering finished
-
createMulti
Description copied from interface:TemplateInstanceCreate a newMultithat can be used to consume chunks of the rendered template. In particular, each item represents a part of the rendered template.This operation does not trigger rendering. Instead, each subscription triggers a new rendering of the template.
- Specified by:
createMultiin interfaceTemplateInstance- Returns:
- a new Multi
- See Also:
-
Multi.subscribe()
-
createUni
Description copied from interface:TemplateInstanceCreate a newUnithat can be used to consume the rendered template.This operation does not trigger rendering. Instead, each subscription triggers a new rendering of the template.
- Specified by:
createUniin interfaceTemplateInstance- Returns:
- a new Uni
- See Also:
-
Uni.subscribe()
-
consume
Description copied from interface:TemplateInstanceTriggers rendering.- Specified by:
consumein interfaceTemplateInstance- Parameters:
consumer- To consume chunks of the rendered template- Returns:
- a completion stage that is completed once the rendering finished
-
getTimeout
public long getTimeout()- Specified by:
getTimeoutin interfaceTemplateInstance- Returns:
- the timeout
- See Also:
-
getTemplate
- Specified by:
getTemplatein interfaceTemplateInstance- Returns:
- the original template
-
getFragment
- Specified by:
getFragmentin interfaceTemplateInstance- Returns:
- the fragment or
null - See Also:
-
onRendered
Description copied from interface:TemplateInstanceRegister an action that is performed after the rendering is finished.- Specified by:
onRenderedin interfaceTemplateInstance- Returns:
- self
-