Package org.xwiki.resource
Class AbstractResourceReference
- java.lang.Object
-
- org.xwiki.resource.AbstractResourceReference
-
- All Implemented Interfaces:
ResourceReference
public abstract class AbstractResourceReference extends Object implements ResourceReference
Base XWiki Resource Reference implementation common to all extending classes. Manages XWiki Resource Reference parameters.- Since:
- 6.1M2
- Version:
- $Id: 227dfc3b07a5bd4da7ccffe298e4d95d6a14cf9a $
-
-
Constructor Summary
Constructors Constructor Description AbstractResourceReference()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addParameter(String name, Object value)
boolean
equals(Object object)
Map<String,List<String>>
getParameters()
A Resource Reference parameter provides optional additional information about the Resource Reference.String
getParameterValue(String name)
List<String>
getParameterValues(String name)
ResourceType
getType()
int
hashCode()
protected void
setParameter(String name, Object value)
Add or replace an existing parameter with the passed value.void
setType(ResourceType type)
String
toString()
-
-
-
Method Detail
-
getType
public ResourceType getType()
- Specified by:
getType
in interfaceResourceReference
- Returns:
- the type of Resource (Entity Resource, Attachment Resource, Template Resource, etc)
-
setType
public void setType(ResourceType type)
- Parameters:
type
- seegetType()
-
addParameter
public void addParameter(String name, Object value)
- Specified by:
addParameter
in interfaceResourceReference
- Parameters:
name
- the name of the parameter to addvalue
- the value of the parameter to add. If null then no value is added. Collections are also supported in which case a multivalued parameter is used.
-
setParameter
protected void setParameter(String name, Object value)
Add or replace an existing parameter with the passed value.- Parameters:
name
- the name of the parameter to addvalue
- the value of the parameter to add. If null then no value is added. Collections are also supported in which case a multivalued parameter is used.- Since:
- 12.3RC1
-
getParameters
public Map<String,List<String>> getParameters()
Description copied from interface:ResourceReference
A Resource Reference parameter provides optional additional information about the Resource Reference. For example these will find their way into the Query String when the Resource Reference is serialized to a standard URL. Note that there can be several values for the same name (since for example this is allowed in URLs and we want 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 representation when it was parsed.- Specified by:
getParameters
in interfaceResourceReference
- Returns:
- the Resource Reference parameters
-
getParameterValues
public List<String> getParameterValues(String name)
- Specified by:
getParameterValues
in interfaceResourceReference
- Parameters:
name
- the parameter name for which to return the values- Returns:
- all the parameter values matching the passed parameter name
-
getParameterValue
public String getParameterValue(String name)
- Specified by:
getParameterValue
in interfaceResourceReference
- Parameters:
name
- the parameter name for which to return the value- Returns:
- the first parameter value matching the passed parameter name
-
-