Class ResourceURLWrapper
- java.lang.Object
-
- jakarta.portlet.filter.RenderStateWrapper
-
- jakarta.portlet.filter.BaseURLWrapper
-
- jakarta.portlet.filter.ResourceURLWrapper
-
- All Implemented Interfaces:
BaseURL,RenderState,ResourceURL
public class ResourceURLWrapper extends BaseURLWrapper implements ResourceURL
TheResourceURLWrapperprovides a convenient implementation of theResourceURLinterface 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
-
-
Field Summary
-
Fields inherited from class jakarta.portlet.filter.RenderStateWrapper
wrapped
-
Fields inherited from interface jakarta.portlet.ResourceURL
FULL, PAGE, PORTLET, SHARED
-
-
Constructor Summary
Constructors Constructor Description ResourceURLWrapper(ResourceURL wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCacheability()Returns the cache level of this resource URL.StringgetResourceID()Returns the resource ID set on the ResourceURL ornullif no resource ID was set on the URL.MutableResourceParametersgetResourceParameters()Gets the resource parameter values set for this URL.ResourceURLgetWrapped()Gets the wrapped object.voidsetCacheability(String cacheLevel)Sets the cache level of this resource URL.voidsetResourceID(String resourceID)Allows setting a resource ID that can be retrieved when serving the resource through theResourceRequest.getResourceID()method.voidsetWrapped(ResourceURL wrapped)Sets the wrapped object.-
Methods inherited from class jakarta.portlet.filter.BaseURLWrapper
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, setWrapped, toString, write, write
-
Methods inherited from class jakarta.portlet.filter.RenderStateWrapper
getPortletMode, getRenderParameters, getWindowState, setWrapped
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jakarta.portlet.BaseURL
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
-
Methods inherited from interface jakarta.portlet.RenderState
getPortletMode, getRenderParameters, getWindowState
-
-
-
-
Constructor Detail
-
ResourceURLWrapper
public ResourceURLWrapper(ResourceURL wrapped)
- Parameters:
wrapped- the wrapped object to set.- Throws:
IllegalArgumentException- if the ResourceURL is null.
-
-
Method Detail
-
getWrapped
public ResourceURL getWrapped()
Gets the wrapped object.- Overrides:
getWrappedin classBaseURLWrapper- Returns:
- the wrapped object.
-
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:ResourceURLGets 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.
PortletParametersprovides a description of the parameter concept.- Specified by:
getResourceParametersin interfaceResourceURL- Returns:
- a mutable
PortletParametersobject representing the private and public render parameters - See Also:
PortletParameters,MutableResourceParameters,ResourceRequest
-
setResourceID
public void setResourceID(String resourceID)
Description copied from interface:ResourceURLAllows setting a resource ID that can be retrieved when serving the resource through theResourceRequest.getResourceID()method.- Specified by:
setResourceIDin interfaceResourceURL- Parameters:
resourceID- ID for this resource URL
-
getResourceID
public String getResourceID()
Description copied from interface:ResourceURLReturns the resource ID set on the ResourceURL ornullif no resource ID was set on the URL.- Specified by:
getResourceIDin interfaceResourceURL- Returns:
- the resource ID set on the ResourceURL,or
nullif no resource ID was set on the URL.
-
getCacheability
public String getCacheability()
Description copied from interface:ResourceURLReturns the cache level of this resource URL.Possible return values are:
FULL, PORTLETorPAGE.- Specified by:
getCacheabilityin interfaceResourceURL- Returns:
- the cache level of this resource URL.
-
setCacheability
public void setCacheability(String cacheLevel)
Description copied from interface:ResourceURLSets the cache level of this resource URL.Possible values are:
FULL, PORTLETorPAGE.Note that if this URL is created inside a
serveResourcecall 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
PAGEif no parent resource URL is available.- Specified by:
setCacheabilityin interfaceResourceURL- Parameters:
cacheLevel- the cache level of this resource URL.
-
-