- All Superinterfaces:
ErrorInitializer
Represents a central point for template management.
It has a dedicated configuration and is able to cache the template definitions.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddTraceListener(TraceListener listener) Registers a newTraceListenerto receive trace events.static EngineBuilderbuilder()voidRemoves all templates from the cache.getTemplate(String id) Obtain a template for the given identifier.longThe global rendering timeout in milliseconds.Returns theTraceManagerresponsible for managing trace listeners and firing trace events during template rendering.booleanNote that template locators are not used in this method.Locates the template with the given id.mapResult(Object result, Expression expression) Maps the given result to a string value.Initializes a newEngineBuilderinstance from this engine.default TemplateParse the template contents.default TemplateParse the template contents with the specified variant.Parse the template contents with the specified variant and id.putTemplate(String id, Template template) A valid identifier is a sequence of non-whitespace characters.booleanvoidremoveTemplates(Predicate<String> test) Removes the templates for which the mapping id matches the given predicate.default voidremoveTraceListener(TraceListener listener) Unregisters a previously registeredTraceListener.booleanMethods inherited from interface io.quarkus.qute.ErrorInitializer
error
-
Method Details
-
builder
- Returns:
- a new builder instance
-
parse
Parse the template contents.Note that this method always returns a new
Templateinstance.- Parameters:
content-- Returns:
- the template
-
parse
Parse the template contents with the specified variant.Note that this method always returns a new
Templateinstance.- Parameters:
content-variant-- Returns:
- the template
-
parse
Parse the template contents with the specified variant and id.Note that this method always returns a new
Templateinstance.- Parameters:
content-variant-id-- Returns:
- the template
-
getResultMappers
List<ResultMapper> getResultMappers()- Returns:
- an immutable list of result mappers
-
mapResult
Maps the given result to a string value. If no result mappers are available theObject.toString()value is used.- Parameters:
result- Must not be nullexpression- Must not be null- Returns:
- the string value
- See Also:
-
putTemplate
A valid identifier is a sequence of non-whitespace characters.- Parameters:
id-template-- Returns:
- the previous value or null
-
getTemplate
Obtain a template for the given identifier. A template may be registered usingputTemplate(String, Template)or loaded by a template locator.- Parameters:
id-- Returns:
- the template or null
- See Also:
-
isTemplateLoaded
Note that template locators are not used in this method.- Parameters:
id-- Returns:
trueif a template with the given identifier is loaded,falseotherwise
-
clearTemplates
void clearTemplates()Removes all templates from the cache. -
removeTemplates
Removes the templates for which the mapping id matches the given predicate.- Parameters:
test-
-
getSectionHelperFactory
- Parameters:
name-- Returns:
- the section helper factory for the giben name
-
getSectionHelperFactories
Map<String,SectionHelperFactory<?>> getSectionHelperFactories()- Returns:
- an immutable map of section helper factories
-
getValueResolvers
List<ValueResolver> getValueResolvers()- Returns:
- an immutable list of value resolvers
-
getNamespaceResolvers
List<NamespaceResolver> getNamespaceResolvers()- Returns:
- an immutable list of namespace resolvers
-
getEvaluator
Evaluator getEvaluator()- Returns:
- the evaluator used to evaluate expressions
-
getTemplateInstanceInitializers
List<TemplateInstance.Initializer> getTemplateInstanceInitializers()- Returns:
- an immutable list of template instance initializers
-
getTimeout
long getTimeout()The global rendering timeout in milliseconds. It is used if notimeoutinstance attribute is set.- Returns:
- the global rendering timeout
- See Also:
-
useAsyncTimeout
boolean useAsyncTimeout()- Returns:
trueif the timeout should also used for asynchronous rendering methods
-
locate
Locates the template with the given id.All locators registered via
EngineBuilder.addLocator(TemplateLocator)are used.- Parameters:
id-- Returns:
- the template location for the given id, or an empty
Optionalif no template was found - See Also:
-
removeStandaloneLines
boolean removeStandaloneLines()- Returns:
trueif the parser should remove standalone lines from the output,falseotherwise
-
getTraceManager
TraceManager getTraceManager()Returns theTraceManagerresponsible for managing trace listeners and firing trace events during template rendering.- Returns:
- the trace manager instance or
nullif tracing is disabled - See Also:
-
addTraceListener
Registers a newTraceListenerto receive trace events.The listener will be notified of template rendering and resolution events.
- Parameters:
listener- the trace listener to add; must not benull
-
removeTraceListener
Unregisters a previously registeredTraceListener.After removal, the listener will no longer receive trace events.
- Parameters:
listener- the trace listener to remove; must not benull
-
newBuilder
EngineBuilder newBuilder()
-