public interface ILinkBuilder
Common interface for all objects used for the building of links (URLs). This extension point provides a way to integrate Thymeleaf with different web execution environments, be these based on the Servlet API or not.
A Template Engine can be set several link builders, which will be asked for
link building in the order established by the getOrder()
method.
Note that a link builder will return null if a link cannot be built (because of it not falling under its responsibilities for whatever reason). In such case, the next builder will be asked. If the entire chain of link builders fail, an exception will be raised.
Implementations of this interface should be thread-safe.
Modifier and Type | Method and Description |
---|---|
String |
buildLink(IExpressionContext context,
String base,
Map<String,Object> parameters)
Build a link, returning null if not possible.
|
String |
getName()
Returns the name of the link builder.
|
Integer |
getOrder()
Return the order in which this link builder will be executed in the
chain when several link builders are set for the same Template Engine.
|
String getName()
Returns the name of the link builder.
Integer getOrder()
Return the order in which this link builder will be executed in the chain when several link builders are set for the same Template Engine.
String buildLink(IExpressionContext context, String base, Map<String,Object> parameters)
Build a link, returning null if not possible.
context
- the IExpressionContext
object being used for template processing. Cannot be null.base
- the base of the link URL to be built, i.e. its path. Can be null.parameters
- the (optional) URL parameters.Copyright © 2017 The THYMELEAF team. All rights reserved.