org.apache.tapestry.link
Class StaticLink

java.lang.Object
  extended by org.apache.tapestry.link.StaticLink
All Implemented Interfaces:
ILink

public class StaticLink
extends java.lang.Object
implements ILink

Used by GenericLink to represent an external, static URL.

Since:
3.0
Author:
Howard Lewis Ship

Constructor Summary
StaticLink(java.lang.String url)
           
 
Method Summary
 java.lang.String getAbsoluteURL()
          Returns the absolute URL as a String, using default scheme, server and port, including parameters, and no anchor.
 java.lang.String getAbsoluteURL(java.lang.String scheme, java.lang.String server, int port, java.lang.String anchor, boolean includeParameters)
          Ignores its parameter and return getURL(String, boolean).
 java.lang.String[] getParameterNames()
          Returns an array of parameters names (in no alphabetical order).
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns the values for the named parameter.
 java.lang.String getURL()
          Returns the relative URL as a String.
 java.lang.String getURL(java.lang.String anchor, boolean includeParameters)
          Returns the relative URL as a String.
 java.lang.String getURL(java.lang.String scheme, java.lang.String server, int port, java.lang.String anchor, boolean includeParameters)
          Ignores its parameter and return getURL(String, boolean).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticLink

public StaticLink(java.lang.String url)
Method Detail

getURL

public java.lang.String getURL()
Description copied from interface: ILink
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.

Specified by:
getURL in interface ILink
Returns:
the relative URL, with no anchor, but including query parameters.

getURL

public java.lang.String getURL(java.lang.String anchor,
                               boolean includeParameters)
Description copied from interface: ILink
Returns the relative URL as a String. This is used for most links.

Specified by:
getURL in interface ILink
Parameters:
anchor - if not null, appended to the URL
includeParameters - if true, parameters are included

getAbsoluteURL

public java.lang.String getAbsoluteURL()
Description copied from interface: ILink
Returns the absolute URL as a String, using default scheme, server and port, including parameters, and no anchor.

Specified by:
getAbsoluteURL in interface ILink

getAbsoluteURL

public java.lang.String getAbsoluteURL(java.lang.String scheme,
                                       java.lang.String server,
                                       int port,
                                       java.lang.String anchor,
                                       boolean includeParameters)
Ignores its parameter and return getURL(String, boolean).

Specified by:
getAbsoluteURL in interface ILink
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

public java.lang.String getURL(java.lang.String scheme,
                               java.lang.String server,
                               int port,
                               java.lang.String anchor,
                               boolean includeParameters)
Ignores its parameter and return getURL(String, boolean).

Specified by:
getURL in interface ILink
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
See Also:
ILink.getURL(String, boolean), ILink.getAbsoluteURL(String, String, int, String, boolean)

getParameterNames

public java.lang.String[] getParameterNames()
Description copied from interface: ILink
Returns an array of parameters names (in no alphabetical order).

Specified by:
getParameterNames in interface ILink
See Also:
ILink.getParameterValues(String)

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface: ILink
Returns the values for the named parameter. Will return null if the no value is defined for the parameter.

Specified by:
getParameterValues in interface ILink