Class ResourceURLWrapper

  • All Implemented Interfaces:
    BaseURL, RenderState, ResourceURL

    public class ResourceURLWrapper
    extends BaseURLWrapper
    implements ResourceURL
    The ResourceURLWrapper provides a convenient implementation of the ResourceURL interface that can be subclassed by developers. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.
    Since:
    3.0
    • Constructor Detail

      • ResourceURLWrapper

        public ResourceURLWrapper​(ResourceURL wrapped)
        Parameters:
        wrapped - the wrapped object to set.
        Throws:
        IllegalArgumentException - if the ResourceURL is null.
    • Method Detail

      • setWrapped

        public void setWrapped​(ResourceURL wrapped)
        Sets the wrapped object.
        Parameters:
        wrapped - the wrapped object to set.
        Throws:
        IllegalArgumentException - if the ResourceURL is null.
      • getResourceParameters

        public MutableResourceParameters getResourceParameters()
        Description copied from interface: ResourceURL
        Gets the resource parameter values set for this URL.

        Resource parameters are additional portlet parameters added to the URL that extend the state information provided by the render parameters.

        Initially the returned object is empty.

        Modifying the parameter values encapsulated by the returned object directly modifies the resource parameters applied to the URL.

        PortletParameters provides a description of the parameter concept.

        Specified by:
        getResourceParameters in interface ResourceURL
        Returns:
        a mutable PortletParameters object representing the private and public render parameters
        See Also:
        PortletParameters, MutableResourceParameters, ResourceRequest
      • getResourceID

        public String getResourceID()
        Description copied from interface: ResourceURL
        Returns the resource ID set on the ResourceURL or null if no resource ID was set on the URL.
        Specified by:
        getResourceID in interface ResourceURL
        Returns:
        the resource ID set on the ResourceURL,or null if no resource ID was set on the URL.
      • getCacheability

        public String getCacheability()
        Description copied from interface: ResourceURL
        Returns the cache level of this resource URL.

        Possible return values are: FULL, PORTLET or PAGE.

        Specified by:
        getCacheability in interface ResourceURL
        Returns:
        the cache level of this resource URL.
      • setCacheability

        public void setCacheability​(String cacheLevel)
        Description copied from interface: ResourceURL
        Sets the cache level of this resource URL.

        Possible values are: FULL, PORTLET or PAGE.

        Note that if this URL is created inside a serveResource call it must have at minimum the same cacheablity, or a more restrictive one, as the parent resource URL, otherwise an IllegalStateException is thrown.

        The default cache level of a resource URL is either the cache level of the parent resource URL, or PAGE if no parent resource URL is available.

        Specified by:
        setCacheability in interface ResourceURL
        Parameters:
        cacheLevel - the cache level of this resource URL.