public class SpringWebFluxEngineContext extends org.thymeleaf.context.AbstractEngineContext implements org.thymeleaf.context.IEngineContext, ISpringWebFluxContext
Basic web implementation of the IEngineContext interface, based on the Spring WebFlux
infrastructure.
This is the context implementation that will be used by default for template processing in Spring WebFlux environments. Note that this is an internal implementation, and there is no reason for users' code to directly reference or use it instead of its implemented interfaces.
This class is NOT thread-safe. Thread-safety is not a requirement for context implementations.
| Constructor and Description |
|---|
SpringWebFluxEngineContext(org.thymeleaf.IEngineConfiguration configuration,
org.thymeleaf.engine.TemplateData templateData,
Map<String,Object> templateResolutionAttributes,
org.springframework.web.server.ServerWebExchange exchange,
Locale locale,
Map<String,Object> variables)
Creates a new instance of this
IEngineContext implementation binding engine execution to
the Spring WebFlux request handling mechanisms, mainly modelled by ServerWebExchange. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsVariable(String name) |
void |
decreaseLevel() |
List<org.thymeleaf.model.IProcessableElementTag> |
getElementStack() |
List<org.thymeleaf.model.IProcessableElementTag> |
getElementStackAbove(int contextLevel) |
org.springframework.web.server.ServerWebExchange |
getExchange()
Returns the
ServerWebExchange object associated with the template execution. |
org.thymeleaf.inline.IInliner |
getInliner() |
org.springframework.http.server.reactive.ServerHttpRequest |
getRequest()
Returns the
ServerHttpRequest object associated with the template execution. |
org.springframework.http.server.reactive.ServerHttpResponse |
getResponse()
Returns the
ServerHttpResponse object associated with the template execution. |
Object |
getSelectionTarget() |
reactor.core.publisher.Mono<org.springframework.web.server.WebSession> |
getSession()
Returns the
WebSession object associated with the template execution. |
String |
getStringRepresentationByLevel() |
org.thymeleaf.engine.TemplateData |
getTemplateData() |
List<org.thymeleaf.engine.TemplateData> |
getTemplateStack() |
Object |
getVariable(String key) |
Set<String> |
getVariableNames() |
boolean |
hasSelectionTarget() |
void |
increaseLevel() |
boolean |
isVariableLocal(String name) |
int |
level() |
void |
removeVariable(String name) |
void |
setElementTag(org.thymeleaf.model.IProcessableElementTag elementTag) |
void |
setInliner(org.thymeleaf.inline.IInliner inliner) |
void |
setSelectionTarget(Object selectionTarget) |
void |
setTemplateData(org.thymeleaf.engine.TemplateData templateData) |
void |
setVariable(String name,
Object value) |
void |
setVariables(Map<String,Object> variables) |
String |
toString() |
buildLink, getConfiguration, getExpressionObjects, getIdentifierSequences, getLocale, getMessage, getModelFactory, getTemplateMode, getTemplateResolutionAttributesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbuildLink, getIdentifierSequences, getMessage, getModelFactory, getTemplateMode, getTemplateResolutionAttributespublic SpringWebFluxEngineContext(org.thymeleaf.IEngineConfiguration configuration,
org.thymeleaf.engine.TemplateData templateData,
Map<String,Object> templateResolutionAttributes,
org.springframework.web.server.ServerWebExchange exchange,
Locale locale,
Map<String,Object> variables)
Creates a new instance of this IEngineContext implementation binding engine execution to
the Spring WebFlux request handling mechanisms, mainly modelled by ServerWebExchange.
Note that implementations of IEngineContext are not meant to be used in order to call
the template engine (use implementations of IContext such as Context or WebContext
instead). This is therefore mostly an internal implementation, and users should have no reason
to ever call this constructor except in very specific integration/extension scenarios.
configuration - the configuration instance being used.templateData - the template data for the template to be processed.templateResolutionAttributes - the template resolution attributes.exchange - the web exchange object being used for request handling.locale - the locale.variables - the context variables, probably coming from another IContext implementation.public org.springframework.http.server.reactive.ServerHttpRequest getRequest()
ISpringWebFluxContext
Returns the ServerHttpRequest object associated with the template execution.
getRequest in interface ISpringWebFluxContextpublic org.springframework.http.server.reactive.ServerHttpResponse getResponse()
ISpringWebFluxContext
Returns the ServerHttpResponse object associated with the template execution.
getResponse in interface ISpringWebFluxContextpublic reactor.core.publisher.Mono<org.springframework.web.server.WebSession> getSession()
ISpringWebFluxContext
Returns the WebSession object associated with the template execution.
The returned Mono will always return an instance, either matching the client's session id
or a new session. Note that calling this method does not create the session object itself.
getSession in interface ISpringWebFluxContextpublic org.springframework.web.server.ServerWebExchange getExchange()
ISpringWebFluxContext
Returns the ServerWebExchange object associated with the template execution.
getExchange in interface ISpringWebFluxContextpublic boolean containsVariable(String name)
containsVariable in interface org.thymeleaf.context.IContextpublic Object getVariable(String key)
getVariable in interface org.thymeleaf.context.IContextpublic Set<String> getVariableNames()
getVariableNames in interface org.thymeleaf.context.IContextpublic void setVariable(String name, Object value)
setVariable in interface org.thymeleaf.context.IEngineContextpublic void setVariables(Map<String,Object> variables)
setVariables in interface org.thymeleaf.context.IEngineContextpublic void removeVariable(String name)
removeVariable in interface org.thymeleaf.context.IEngineContextpublic boolean isVariableLocal(String name)
isVariableLocal in interface org.thymeleaf.context.IEngineContextpublic boolean hasSelectionTarget()
hasSelectionTarget in interface org.thymeleaf.context.ITemplateContextpublic Object getSelectionTarget()
getSelectionTarget in interface org.thymeleaf.context.ITemplateContextpublic void setSelectionTarget(Object selectionTarget)
setSelectionTarget in interface org.thymeleaf.context.IEngineContextpublic org.thymeleaf.inline.IInliner getInliner()
getInliner in interface org.thymeleaf.context.ITemplateContextpublic void setInliner(org.thymeleaf.inline.IInliner inliner)
setInliner in interface org.thymeleaf.context.IEngineContextpublic org.thymeleaf.engine.TemplateData getTemplateData()
getTemplateData in interface org.thymeleaf.context.ITemplateContextpublic void setTemplateData(org.thymeleaf.engine.TemplateData templateData)
setTemplateData in interface org.thymeleaf.context.IEngineContextpublic List<org.thymeleaf.engine.TemplateData> getTemplateStack()
getTemplateStack in interface org.thymeleaf.context.ITemplateContextpublic void setElementTag(org.thymeleaf.model.IProcessableElementTag elementTag)
setElementTag in interface org.thymeleaf.context.IEngineContextpublic List<org.thymeleaf.model.IProcessableElementTag> getElementStack()
getElementStack in interface org.thymeleaf.context.ITemplateContextpublic List<org.thymeleaf.model.IProcessableElementTag> getElementStackAbove(int contextLevel)
getElementStackAbove in interface org.thymeleaf.context.IEngineContextpublic int level()
level in interface org.thymeleaf.context.IEngineContextpublic void increaseLevel()
increaseLevel in interface org.thymeleaf.context.IEngineContextpublic void decreaseLevel()
decreaseLevel in interface org.thymeleaf.context.IEngineContextpublic String getStringRepresentationByLevel()
Copyright © 2017 The THYMELEAF team. All rights reserved.