KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > displaytag > util > Href


1 /**
2  * Licensed under the Artistic License; you may not use this file
3  * except in compliance with the License.
4  * You may obtain a copy of the License at
5  *
6  * http://displaytag.sourceforge.net/license.html
7  *
8  * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
9  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11  */

12 package org.displaytag.util;
13
14 import java.io.Serializable JavaDoc;
15 import java.util.Map JavaDoc;
16
17
18 /**
19  * Interface representing an URI (the href parameter of an <a> tag). Provides methods to insert new parameters. It
20  * doesn't support multiple parameter values
21  * @author Fabrizio Giustina
22  * @version $Revision: 999 $ ($Author: fgiust $)
23  */

24 public interface Href extends Cloneable JavaDoc, Serializable JavaDoc
25 {
26
27     /**
28      * Adds a parameter to the href.
29      * @param name String
30      * @param value Object
31      * @return this Href instance, useful for concatenation.
32      */

33     Href addParameter(String JavaDoc name, Object JavaDoc value);
34
35     /**
36      * Removes a parameter from the href.
37      * @param name String
38      */

39     void removeParameter(String JavaDoc name);
40
41     /**
42      * Adds an int parameter to the href.
43      * @param name String
44      * @param value int
45      * @return this Href instance, useful for concatenation.
46      */

47     Href addParameter(String JavaDoc name, int value);
48
49     /**
50      * Getter for the map containing link parameters. The returned map is always a copy and not the original instance.
51      * @return parameter Map (copy)
52      */

53     Map JavaDoc getParameterMap();
54
55     /**
56      * Adds all the parameters contained in the map to the Href. The value in the given Map will be escaped before
57      * added. Any parameter already present in the href object is removed.
58      * @param parametersMap Map containing parameters
59      */

60     void setParameterMap(Map JavaDoc parametersMap);
61
62     /**
63      * Adds all the parameters contained in the map to the Href. The value in the given Map will be escaped before
64      * added. Parameters in the original href are kept and not overridden.
65      * @param parametersMap Map containing parameters
66      */

67     void addParameterMap(Map JavaDoc parametersMap);
68
69     /**
70      * Getter for the base url (without parameters).
71      * @return String
72      */

73     String JavaDoc getBaseUrl();
74
75     /**
76      * Set the full url, overriding any existing parameter.
77      * @param url full url
78      */

79     void setFullUrl(String JavaDoc url);
80
81     /**
82      * Returns the URI anchor.
83      * @return anchor or <code>null</code> if no anchor has been set.
84      */

85     String JavaDoc getAnchor();
86
87     /**
88      * Setter for the URI anchor.
89      * @param name string to be used as anchor name (without #).
90      */

91     void setAnchor(String JavaDoc name);
92
93     /**
94      * toString: output the full url with parameters.
95      * @return String
96      */

97     String JavaDoc toString();
98
99     /**
100      * @see java.lang.Object#clone()
101      */

102     Object JavaDoc clone();
103
104     /**
105      * @see java.lang.Object#equals(Object)
106      */

107     boolean equals(Object JavaDoc object);
108
109 }
Popular Tags