org.apache.tapestry.engine
Interface ILink

All Known Implementing Classes:
EngineServiceLink, 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 services and 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
Version:
$Id: ILink.java 243791 2004-02-19 17:38:13Z hlship $
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 specified 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.
 

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

getParameterNames

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

See Also:
getParameterValues(String)

getParameterValues

String[] getParameterValues(String name)
Returns the values for the named parameter.

Throws:
IllegalArgumentException - if the link does not define values for the specified name.