Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
ResourceReference | 31 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.resource; | |
21 | ||
22 | import java.util.List; | |
23 | import java.util.Map; | |
24 | ||
25 | /** | |
26 | * Represents a reference to an XWiki Resource (Entity Resource, Attachment Resource, Template Resource, etc). | |
27 | * | |
28 | * @version $Id: b253de17710ffd9f07250904ce0f919d7e7c92d8 $ | |
29 | * @since 6.1M2 | |
30 | */ | |
31 | public interface ResourceReference | |
32 | { | |
33 | /** | |
34 | * @return the type of Resource (Entity Resource, Attachment Resource, Template Resource, etc) | |
35 | */ | |
36 | ResourceType getType(); | |
37 | ||
38 | /** | |
39 | * @param name the name of the parameter to add | |
40 | * @param value the value of the parameter to add. If null then no value is added. Collections are also supported | |
41 | * in which case a multivalued parameter is used. | |
42 | */ | |
43 | void addParameter(String name, Object value); | |
44 | ||
45 | /** | |
46 | * A Resource Reference parameter provides optional additional information about the Resource Reference. | |
47 | * For example these will find their way into the Query String when the Resource Reference is serialized to a | |
48 | * standard URL. | |
49 | * | |
50 | * Note that there can be several values for the same name (since for example this is allowed in URLs and we want | |
51 | * to map a URL to an XWiki Resource Reference). Also note that the order in the map is the same as the order in the | |
52 | * representation when it was parsed. | |
53 | * | |
54 | * @return the Resource Reference parameters | |
55 | */ | |
56 | Map<String, List<String>> getParameters(); | |
57 | ||
58 | /** | |
59 | * @param name the parameter name for which to return the values | |
60 | * @return all the parameter values matching the passed parameter name | |
61 | */ | |
62 | List<String> getParameterValues(String name); | |
63 | ||
64 | /** | |
65 | * @param name the parameter name for which to return the value | |
66 | * @return the first parameter value matching the passed parameter name | |
67 | */ | |
68 | String getParameterValue(String name); | |
69 | } |