org.apache.tapestry5.services.linktransform

## Interface PageRenderLinkTransformer

- All Known Subinterfaces:
    LinkTransformer
  All Known Implementing Classes:
    LinkTransformerImpl

      @UsesOrderedConfiguration(value=PageRenderLinkTransformer.class)
      public interface PageRenderLinkTransformer

  Allows the default `Link` for a page render request to be replaced. This is a service, but also the contribution to the service, as a chain of command. A contributed implementation of this interface is expected to identify which requests it wants to transform. The `transformPageRenderLink(Link, PageRenderRequestParameters)` method can return a `Link` that is allowed to differ from Tapestry normal default. Later, when that request is triggered, `decodePageRenderRequest(Request)` is required to reverse the operation, identifying the original parameters so that request handling can continue.
  Since:
    5.2.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `PageRenderRequestParameters` | `decodePageRenderRequest(Request request)` Attempts to decode the page render request, to perform the opposite action for `transformPageRenderLink(Link, PageRenderRequestParameters)`.
    `Link` | `transformPageRenderLink(Link defaultLink, PageRenderRequestParameters parameters)` Transforms a page render link.

- - ### Method Detail

    - #### transformPageRenderLink

          Link transformPageRenderLink(Link defaultLink,
                                       PageRenderRequestParameters parameters)

      Transforms a page render link.
      Parameters:
        `defaultLink` - default Link for this request
        `parameters` - that define the request
      Returns:
        replacement Link, or null

    - #### decodePageRenderRequest

          PageRenderRequestParameters decodePageRenderRequest(Request request)

      Attempts to decode the page render request, to perform the opposite action for `transformPageRenderLink(Link, PageRenderRequestParameters)`. The transformer is also responsible for identifying the locale in the request (as part of the path, or as a query parameter or cookie) and setting the locale for the request. This method will be invoked from the `PageRenderDispatcher` and a non-null value returned from this method will prevent the default `ComponentEventLinkEncoder.decodePageRenderRequest(Request)` method from being invoked.
      Returns:
        decoded parameters, or null to proceed normally
      See Also:
        `LocalizationSetter.setLocaleFromLocaleName(String)`

5.6.1 - Copyright © 2003-2020 The Apache Software Foundation.