org.displaytag.util
Interface Href

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
DefaultHref

public interface Href
extends java.lang.Cloneable, java.io.Serializable

Interface representing an URI (the href parameter of an <a> tag). Provides methods to insert new parameters. It doesn't support multiple parameter values

Version:
$Revision: 1081 $ ($Author: fgiust $)
Author:
Fabrizio Giustina

Method Summary
 Href addParameter(java.lang.String name, int value)
          Adds an int parameter to the href.
 Href addParameter(java.lang.String name, java.lang.Object value)
          Adds a parameter to the href.
 void addParameterMap(java.util.Map parametersMap)
          Adds all the parameters contained in the map to the Href.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object object)
           
 java.lang.String getAnchor()
          Returns the URI anchor.
 java.lang.String getBaseUrl()
          Getter for the base url (without parameters).
 java.util.Map getParameterMap()
          Getter for the map containing link parameters.
 void removeParameter(java.lang.String name)
          Removes a parameter from the href.
 void setAnchor(java.lang.String name)
          Setter for the URI anchor.
 void setFullUrl(java.lang.String url)
          Set the full url, overriding any existing parameter.
 void setParameterMap(java.util.Map parametersMap)
          Adds all the parameters contained in the map to the Href.
 java.lang.String toString()
          toString: output the full url with parameters.
 

Method Detail

addParameter

Href addParameter(java.lang.String name,
                  java.lang.Object value)
Adds a parameter to the href.

Parameters:
name - String
value - Object
Returns:
this Href instance, useful for concatenation.

removeParameter

void removeParameter(java.lang.String name)
Removes a parameter from the href.

Parameters:
name - String

addParameter

Href addParameter(java.lang.String name,
                  int value)
Adds an int parameter to the href.

Parameters:
name - String
value - int
Returns:
this Href instance, useful for concatenation.

getParameterMap

java.util.Map getParameterMap()
Getter for the map containing link parameters. The returned map is always a copy and not the original instance.

Returns:
parameter Map (copy)

setParameterMap

void setParameterMap(java.util.Map parametersMap)
Adds all the parameters contained in the map to the Href. The value in the given Map will be escaped before added. Any parameter already present in the href object is removed.

Parameters:
parametersMap - Map containing parameters

addParameterMap

void addParameterMap(java.util.Map parametersMap)
Adds all the parameters contained in the map to the Href. The value in the given Map will be escaped before added. Parameters in the original href are kept and not overridden.

Parameters:
parametersMap - Map containing parameters

getBaseUrl

java.lang.String getBaseUrl()
Getter for the base url (without parameters).

Returns:
String

setFullUrl

void setFullUrl(java.lang.String url)
Set the full url, overriding any existing parameter.

Parameters:
url - full url

getAnchor

java.lang.String getAnchor()
Returns the URI anchor.

Returns:
anchor or null if no anchor has been set.

setAnchor

void setAnchor(java.lang.String name)
Setter for the URI anchor.

Parameters:
name - string to be used as anchor name (without #).

toString

java.lang.String toString()
toString: output the full url with parameters.

Overrides:
toString in class java.lang.Object
Returns:
String

clone

java.lang.Object clone()
See Also:
Object.clone()

equals

boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.