org.xwiki.url
Class AbstractXWikiURL

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

public class AbstractXWikiURL
extends java.lang.Object
implements XWikiURL

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

Since:
2.0M1
Version:
$Id$

Constructor Summary
AbstractXWikiURL(XWikiURLType type)
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String value)
           
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameters()
          A XWiki URL parameter provides optional additional information about the URL.
 java.lang.String getParameterValue(java.lang.String name)
          
 java.util.List<java.lang.String> getParameterValues(java.lang.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)
See Also:
XWikiURL.getType()

setType

public void setType(XWikiURLType type)

addParameter

public void addParameter(java.lang.String name,
                         java.lang.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 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getParameters()
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
See Also:
XWikiURL.getParameters()

getParameterValues

public java.util.List<java.lang.String> getParameterValues(java.lang.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
See Also:
XWikiURL.getParameterValues(String)

getParameterValue

public java.lang.String getParameterValue(java.lang.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
See Also:
XWikiURL.getParameterValue(String)


Copyright © 2004-2011 XWiki. All Rights Reserved.