org.apache.tapestry.engine
Interface ILink

All Known Implementing Classes:
EngineServiceLink, PortletLink, StaticLink

public interface ILink

Define a link that may be generated as part of a page render. The vast majority of links are tied to servicesand are, in fact, callbacks. A small number, such as those generated by GenericLink component, are to arbitrary locations. In addition, ILink differentiates between the path portion of the link, and any query parameters encoded into a link, primarily to benefit Form, which needs to encode the query parameters as hidden form fields.

In addition, an ILink is responsible for passing constructed URLs through IRequestCycle.encodeURL(String) as needed.

Since:
3.0
Author:
Howard Lewis Ship

Method Summary
 String getAbsoluteURL()
          Returns the absolute URL as a String, using default scheme, server and port, including parameters, and no anchor.
 String getAbsoluteURL(String scheme, String server, int port, String anchor, boolean includeParameters)
          Returns the absolute URL as a String.
 String[] getParameterNames()
          Returns an array of parameters names (in no alphabetical order).
 String[] getParameterValues(String name)
          Returns the values for the named parameter.
 String getURL()
          Returns the relative URL as a String.
 String getURL(String anchor, boolean includeParameters)
          Returns the relative URL as a String.
 String getURL(String scheme, String server, int port, String anchor, boolean includeParameters)
          Returns the URL as either a local or absoluate URL, depending on whether any of the parameters are both non-null and mismatched against the incoming request.
 

Method Detail

getURL

String getURL()
Returns the relative URL as a String. A relative URL may include a leading slash, but omits the scheme, host and port portions of a full URL.

Returns:
the relative URL, with no anchor, but including query parameters.

getURL

String getURL(String anchor,
              boolean includeParameters)
Returns the relative URL as a String. This is used for most links.

Parameters:
anchor - if not null, appended to the URL
includeParameters - if true, parameters are included

getAbsoluteURL

String getAbsoluteURL()
Returns the absolute URL as a String, using default scheme, server and port, including parameters, and no anchor.


getAbsoluteURL

String getAbsoluteURL(String scheme,
                      String server,
                      int port,
                      String anchor,
                      boolean includeParameters)
Returns the absolute URL as a String.

Parameters:
scheme - if not null, overrides the default scheme.
server - if not null, overrides the default server
port - if non-zero, overrides the default port
anchor - if not null, appended to the URL
includeParameters - if true, parameters are included

getURL

String getURL(String scheme,
              String server,
              int port,
              String anchor,
              boolean includeParameters)
Returns the URL as either a local or absoluate URL, depending on whether any of the parameters are both non-null and mismatched against the incoming request.

Parameters:
scheme - if not null, overrides the default scheme.
server - if not null, overrides the default server
port - if non-zero, overrides the default port
anchor - if not null, appended to the URL
includeParameters - if true, parameters are included
Since:
4.0
See Also:
getURL(String, boolean), getAbsoluteURL(String, String, int, String, boolean)

getParameterNames

String[] getParameterNames()
Returns an array of parameters names (in no alphabetical order).

See Also:
getParameterValues(String)

getParameterValues

String[] getParameterValues(String name)
Returns the values for the named parameter. Will return null if no value is defined for the parameter.



Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.