org.xwiki.url
Class AbstractXWikiURL

java.lang.Object
  extended by org.xwiki.url.AbstractXWikiURL
All Implemented Interfaces:
XWikiURL
Direct Known Subclasses:
XWikiEntityURL

public abstract class AbstractXWikiURL
extends Object
implements XWikiURL

Base XWikiURL implementation common to all extending classes. Manages XWiki URL parameters.

Since:
2.0M1
Version:
$Id: c0a247a1c0013e2b889b268d8187e9b6b80fc41c $

Constructor Summary
AbstractXWikiURL(XWikiURLType type)
           
 
Method Summary
 void addParameter(String name, String value)
           
 Map<String,List<String>> getParameters()
          A XWiki URL parameter provides optional additional information about the URL.
 String getParameterValue(String name)
           
 List<String> getParameterValues(String name)
           
 XWikiURLType getType()
           
 void setType(XWikiURLType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractXWikiURL

public AbstractXWikiURL(XWikiURLType type)
Method Detail

getType

public XWikiURLType getType()
Specified by:
getType in interface XWikiURL
Returns:
the type of URL (Entity URL, Attachment URL, Template URL, etc)

setType

public void setType(XWikiURLType type)

addParameter

public void addParameter(String name,
                         String value)
Specified by:
addParameter in interface XWikiURL
value - the value of the parameter to add. If null then no value is added.

getParameters

public Map<String,List<String>> getParameters()
Description copied from interface: XWikiURL
A XWiki URL parameter provides optional additional information about the URL. For example these will find their way into the Query String when the XWiki URL serialized to a standard URL. Note that there can be several values for the same name (since this is allowed in URLs and we want to map a URL to a XWiki URL). Also note that the order in the map is the same as the order in the URL.

Specified by:
getParameters in interface XWikiURL
Returns:
the XWiki URL parameters

getParameterValues

public List<String> getParameterValues(String name)
Specified by:
getParameterValues in interface XWikiURL
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 interface XWikiURL
Parameters:
name - the parameter name for which to return the value
Returns:
the first parameter value matching the passed parameter name


Copyright © 2004-2013 XWiki. All Rights Reserved.