Package io.quarkus.qute
Interface Engine
- 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 TypeMethodDescriptionstatic EngineBuilderbuilder()voidRemoves all templates from the cache.getTemplate(String id) Obtain a template for the given identifier.longThe global rendering timeout in milliseconds.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) booleanvoidremoveTemplates(Predicate<String> test) Removes the templates for which the mapping id matches the given predicate.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
- 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
-
newBuilder
EngineBuilder newBuilder()Initializes a newEngineBuilderinstance from this engine.- Returns:
- a new builder instance initialized from this engine
-