Package org.apache.tapestry5.internal.services.linktransform

# Class LinkTransformerImpl

java.lang.Object
org.apache.tapestry5.internal.services.linktransform.LinkTransformerImpl

All Implemented Interfaces:
  `ComponentEventLinkTransformer`, `LinkTransformer`, `PageRenderLinkTransformer`

public class LinkTransformerImpl extends Object implements LinkTransformer

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LinkTransformerImpl(ComponentEventLinkTransformer componentEventLinkTransformer, PageRenderLinkTransformer pageRenderLinkTransformer)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ComponentEventRequestParameters`
  `decodeComponentEventRequest(Request request)`
  Attempts to decode the page render request, to perform the opposite action for `ComponentEventLinkTransformer.transformComponentEventLink(Link, ComponentEventRequestParameters)`.
  `PageRenderRequestParameters`
  `decodePageRenderRequest(Request request)`
  Attempts to decode the page render request, to perform the opposite action for `PageRenderLinkTransformer.transformPageRenderLink(Link, PageRenderRequestParameters)`.
  `Link`
  `transformComponentEventLink(Link defaultLink, ComponentEventRequestParameters parameters)`
  Allows the default Link created for the component event request to be replaced.
  `Link`
  `transformPageRenderLink(Link defaultLink, PageRenderRequestParameters parameters)`
  Transforms a page render link.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LinkTransformerImpl

    public LinkTransformerImpl(@Primary ComponentEventLinkTransformer componentEventLinkTransformer, @Primary PageRenderLinkTransformer pageRenderLinkTransformer)

- ## Method Details

  - ### transformComponentEventLink

    public Link transformComponentEventLink(Link defaultLink, ComponentEventRequestParameters parameters)
    Description copied from interface: `ComponentEventLinkTransformer`
    Allows the default Link created for the component event request to be replaced.
    Specified by:
      `transformComponentEventLink` in interface `ComponentEventLinkTransformer`
    Parameters:
      `defaultLink` - the default Link generated for a component event request
      `parameters` - used to create the default Link
    Returns:
      a replacement Link, or null

  - ### transformPageRenderLink

    public Link transformPageRenderLink(Link defaultLink, PageRenderRequestParameters parameters)
    Description copied from interface: `PageRenderLinkTransformer`
    Transforms a page render link.
    Specified by:
      `transformPageRenderLink` in interface `PageRenderLinkTransformer`
    Parameters:
      `defaultLink` - default Link for this request
      `parameters` - that define the request
    Returns:
      replacement Link, or null

  - ### decodeComponentEventRequest

    public ComponentEventRequestParameters decodeComponentEventRequest(Request request)
    Description copied from interface: `ComponentEventLinkTransformer`
    Attempts to decode the page render request, to perform the opposite action for `ComponentEventLinkTransformer.transformComponentEventLink(Link, ComponentEventRequestParameters)`. 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 `ComponentEventDispatcher` and a non-null value returned from this method will prevent the default `ComponentEventLinkEncoder.decodeComponentEventRequest(Request)` method from being invoked.
    Specified by:
      `decodeComponentEventRequest` in interface `ComponentEventLinkTransformer`
    Returns:
      decoded parameters, or null to proceed normally
    See Also:
      - `LocalizationSetter.setLocaleFromLocaleName(String)`

  - ### decodePageRenderRequest

    public PageRenderRequestParameters decodePageRenderRequest(Request request)
    Description copied from interface: `PageRenderLinkTransformer`
    Attempts to decode the page render request, to perform the opposite action for `PageRenderLinkTransformer.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.
    Specified by:
      `decodePageRenderRequest` in interface `PageRenderLinkTransformer`
    Returns:
      decoded parameters, or null to proceed normally
    See Also:
      - `LocalizationSetter.setLocaleFromLocaleName(String)`