Package org.apache.tapestry5.internal.services

# Class LinkSourceImpl

java.lang.Object
org.apache.tapestry5.internal.services.LinkSourceImpl

All Implemented Interfaces:
  `LinkSource`, `LinkCreationHub`

public class LinkSourceImpl extends Object implements LinkSource, LinkCreationHub

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LinkSourceImpl(PageRenderQueue pageRenderQueue, PageActivationContextCollector contextCollector, TypeCoercer typeCoercer, ComponentClassResolver resolver, ComponentEventLinkEncoder linkEncoder, RequestGlobals requestGlobals, RequestPageCache pageCache, List<LinkCreationListener2> configuration)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addListener(LinkCreationListener listener)`
  Adds a listener.
  `void`
  `addListener(LinkCreationListener2 listener)`
  Adds a listener.
  `Link`
  `createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, Object... eventContext)`
  Creates a stateful action link.
  `Link`
  `createPageRenderLink(String pageName, boolean override, Object... pageActivationContext)`
  Creates a render link for the page.
  `LinkCreationHub`
  `getLinkCreationHub()`
  Returns the hub, used to register and de-register `LinkCreationListener2`s.

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

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

- ## Constructor Details

  - ### LinkSourceImpl

    public LinkSourceImpl(PageRenderQueue pageRenderQueue, PageActivationContextCollector contextCollector, TypeCoercer typeCoercer, ComponentClassResolver resolver, ComponentEventLinkEncoder linkEncoder, RequestGlobals requestGlobals, RequestPageCache pageCache, List<LinkCreationListener2> configuration)

- ## Method Details

  - ### createComponentEventLink

    public Link createComponentEventLink(Page page, String nestedId, String eventType, boolean forForm, Object... eventContext)
    Description copied from interface: `LinkSource`
    Creates a stateful action link. Action links are built for components. Action links are encoded by the current request (that is, bound to the current request's session, if any).
    Specified by:
      `createComponentEventLink` in interface `LinkSource`
    Parameters:
      `page` - the page holding the component
      `nestedId` - the component's qualified id (a sequence of simple ids, separated by dots).
      `eventType` - the type of event to trigger
      `forForm` - true if the link is for a form, false otherwise
      `eventContext` - Additional path data, each value will be converted to a string and appended to the URI @return a link
    See Also:
      - `ComponentResourcesCommon.createEventLink(String, Object...)`

  - ### createPageRenderLink

    public Link createPageRenderLink(String pageName, boolean override, Object... pageActivationContext)
    Description copied from interface: `LinkSource`
    Creates a render link for the page. If an activation context is supplied then that context is built into the URI. If no activation context is supplied, then the activation context is obtained from the page itself, by triggering a passivate event on its root component. When the activationContext is an empty array, the targeted page is checked to see if it can provide an activation context. This is accomplished by triggering a "passivate" event on the targeted page. If the override parameter is true, this will not occur (even when the activation context is empty).
    Specified by:
      `createPageRenderLink` in interface `LinkSource`
    Parameters:
      `pageName` - name of the page to which a link should be created
      `override` - if true, then the provided activation context is always used even if empty
      `pageActivationContext` - the activation context for the page
    Returns:
      a link
    See Also:
      - `PageRenderLinkSource.createPageRenderLink(String)`
      - `PageRenderLinkSource.createPageRenderLinkWithContext(String, Object[])`

  - ### getLinkCreationHub

    public LinkCreationHub getLinkCreationHub()
    Description copied from interface: `LinkSource`
    Returns the hub, used to register and de-register `LinkCreationListener2`s.
    Specified by:
      `getLinkCreationHub` in interface `LinkSource`
    Returns:
      the hub

  - ### addListener

    public void addListener(LinkCreationListener listener)
    Description copied from interface: `LinkCreationHub`
    Adds a listener. If the scope of the listener is per-thread, then it must be removed.
    Specified by:
      `addListener` in interface `LinkCreationHub`

  - ### addListener

    public void addListener(LinkCreationListener2 listener)
    Description copied from interface: `LinkCreationHub`
    Adds a listener. If the scope of the listener is per-thread, then it must be removed.
    Specified by:
      `addListener` in interface `LinkCreationHub`