Package org.xwiki.url

Class 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: 90269f6a4aae81012c765905a048e97983dbbba2 $
    • 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)
      • 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