public class ResourceURLWrapper extends BaseURLWrapper implements ResourceURL
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.
wrapped
FULL, PAGE, PORTLET, SHARED
Constructor and Description |
---|
ResourceURLWrapper(ResourceURL wrapped) |
Modifier and Type | Method and Description |
---|---|
String |
getCacheability()
Returns the cache level of this resource URL.
|
String |
getResourceID()
Returns the resource ID set on the ResourceURL or
null
if no resource ID was set on the URL. |
MutableResourceParameters |
getResourceParameters()
Gets the resource parameter values set for this URL.
|
ResourceURL |
getWrapped()
Gets the wrapped object.
|
void |
setCacheability(String cacheLevel)
Sets the cache level of this resource URL.
|
void |
setResourceID(String resourceID)
Allows setting a resource ID that can be retrieved when serving the
resource through the
ResourceRequest.getResourceID() method. |
void |
setWrapped(ResourceURL wrapped)
Sets the wrapped object.
|
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, setWrapped, toString, write, write
getPortletMode, getRenderParameters, getWindowState, setWrapped
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
getPortletMode, getRenderParameters, getWindowState
public ResourceURLWrapper(ResourceURL wrapped)
wrapped
- the wrapped object to set.IllegalArgumentException
- if the ResourceURL is null.public ResourceURL getWrapped()
getWrapped
in class BaseURLWrapper
public void setWrapped(ResourceURL wrapped)
wrapped
- the wrapped object to set.IllegalArgumentException
- if the ResourceURL is null.public MutableResourceParameters getResourceParameters()
ResourceURL
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.
getResourceParameters
in interface ResourceURL
PortletParameters
object representing
the private and public render parametersPortletParameters
,
MutableResourceParameters
,
ResourceRequest
public void setResourceID(String resourceID)
ResourceURL
ResourceRequest.getResourceID()
method.setResourceID
in interface ResourceURL
resourceID
- ID for this resource URLpublic String getResourceID()
ResourceURL
null
if no resource ID was set on the URL.getResourceID
in interface ResourceURL
null
if no resource ID was set on the URL.public String getCacheability()
ResourceURL
Possible return values are: FULL, PORTLET
or PAGE
.
getCacheability
in interface ResourceURL
public void setCacheability(String cacheLevel)
ResourceURL
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.
setCacheability
in interface ResourceURL
cacheLevel
- the cache level of this resource URL.Java Portlet 3.0 API Specification. See the Copyright and License provided with this distribution. Use is subject to license terms.