Class 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 Detail

      • AbstractResourceReference

        public AbstractResourceReference()
    • Method Detail

      • getType

        public ResourceType getType()
        Specified by:
        getType in interface ResourceReference
        Returns:
        the type of Resource (Entity Resource, Attachment Resource, Template Resource, etc)
      • addParameter

        public void addParameter​(String name,
                                 Object value)
        Specified by:
        addParameter in interface ResourceReference
        Parameters:
        name - the name of the parameter to add
        value - 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 add
        value - 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 interface ResourceReference
        Returns:
        the Resource Reference parameters
      • getParameterValues

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

        public int hashCode()
        Overrides:
        hashCode in class Object