public class ActionResponseWrapper extends PortletResponseWrapper implements ActionResponse
ActionResponseWrapper
provides a convenient
implementation of the ActionResponse
interface
that can be subclassed by developers wishing to adapt the response.
This class implements the Wrapper or Decorator pattern.
Methods default to calling through to the wrapped response object.ActionResponse
Constructor and Description |
---|
ActionResponseWrapper(ActionResponse response)
Creates an
ActionResponse adaptor
wrapping the given response object. |
Modifier and Type | Method and Description |
---|---|
PortletMode |
getPortletMode()
The default behavior of this method is to call
getPortletMode() on the wrapped response object. |
Map<String,String[]> |
getRenderParameterMap()
The default behavior of this method is to call
getRenderParameterMap() on the wrapped response object. |
ActionResponse |
getResponse()
Return the wrapped response object.
|
WindowState |
getWindowState()
The default behavior of this method is to call
getWindowState() on the wrapped response object. |
void |
removePublicRenderParameter(String name)
The default behavior of this method is to call
removePublicRenderParameter() on the wrapped response object. |
void |
sendRedirect(String location)
The default behavior of this method is to call
sendRedirect(location) on the wrapped response object. |
void |
sendRedirect(String location,
String renderUrlParamName)
The default behavior of this method is to call
sendRedirect(location, renderUrlParamName) on the wrapped response object. |
void |
setEvent(QName name,
Serializable value)
The default behavior of this method is to call
setEvent(name, value) on the wrapped response object. |
void |
setEvent(String name,
Serializable value)
The default behavior of this method is to call
setEvent() on the wrapped response object. |
void |
setPortletMode(PortletMode portletMode)
The default behavior of this method is to call
setPortletMode(portletMode) on the wrapped response object. |
void |
setRenderParameter(String key,
String value)
The default behavior of this method is to call
setRenderParameter(key, value) on the wrapped response object. |
void |
setRenderParameter(String key,
String[] values)
The default behavior of this method is to call
setRenderParameter(key, value) on the wrapped response object. |
void |
setRenderParameters(Map<String,String[]> parameters)
The default behavior of this method is to call
setRenderParameters(parameters) on the wrapped response object. |
void |
setResponse(ActionResponse response)
Sets the response object being wrapped.
|
void |
setWindowState(WindowState windowState)
The default behavior of this method is to call
setWindowState(windowState) on the wrapped response object. |
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty, setResponse
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty
public ActionResponseWrapper(ActionResponse response)
ActionResponse
adaptor
wrapping the given response object.response
- the action response to wrapIllegalArgumentException
- if the response is null
public void sendRedirect(String location) throws IOException
sendRedirect(location)
on the wrapped response object.sendRedirect
in interface ActionResponse
location
- the redirect location URLIOException
- if an input or output exception occurs.public void sendRedirect(String location, String renderUrlParamName) throws IOException
sendRedirect(location, renderUrlParamName)
on the wrapped response object.sendRedirect
in interface ActionResponse
location
- the redirect location URLrenderUrlParamName
- name of the query parameter under which the portlet container should
store a render URL to this portletIOException
- if an input or output exception occurs.public void setEvent(QName name, Serializable value)
setEvent(name, value)
on the wrapped response object.setEvent
in interface StateAwareResponse
name
- the event name to publish, must not be null
value
- the value of this event, must have a valid JAXB binding and
be serializable, or null
.public void setPortletMode(PortletMode portletMode) throws PortletModeException
setPortletMode(portletMode)
on the wrapped response object.setPortletMode
in interface StateAwareResponse
portletMode
- the new portlet modePortletModeException
- if the portlet cannot switch to this portlet mode, because
the portlet or portal does not support it for this markup,
or the current user is not allowed to switch to this
portlet mode. To avoid this exception the portlet can
check the allowed portlet modes with
Request.isPortletModeAllowed()
.public void setRenderParameter(String key, String value)
setRenderParameter(key, value)
on the wrapped response object.setRenderParameter
in interface StateAwareResponse
key
- key of the render parametervalue
- value of the render parameterpublic void setRenderParameter(String key, String[] values)
setRenderParameter(key, value)
on the wrapped response object.setRenderParameter
in interface StateAwareResponse
key
- key of the render parametervalues
- values of the render parameterpublic void setRenderParameters(Map<String,String[]> parameters)
setRenderParameters(parameters)
on the wrapped response object.setRenderParameters
in interface StateAwareResponse
parameters
- Map containing parameter names for the render phase as keys
and parameter values as map values. The keys in the parameter
map must be of type String. The values in the parameter map
must be of type String array (String[]
).public void setWindowState(WindowState windowState) throws WindowStateException
setWindowState(windowState)
on the wrapped response object.setWindowState
in interface StateAwareResponse
windowState
- the new portlet window stateWindowStateException
- if the portlet cannot switch to the specified window
state. To avoid this exception the portlet can check the
allowed window states with
Request.isWindowStateAllowed()
.WindowState
public ActionResponse getResponse()
getResponse
in class PortletResponseWrapper
public void setResponse(ActionResponse response)
response
- the response to setIllegalArgumentException
- if the response is null.public PortletMode getPortletMode()
getPortletMode()
on the wrapped response object.getPortletMode
in interface StateAwareResponse
null
if none is setpublic Map<String,String[]> getRenderParameterMap()
getRenderParameterMap()
on the wrapped response object.getRenderParameterMap
in interface StateAwareResponse
Map
containing render parameter names as keys and
parameter values as map values, or an empty Map
if
no parameters exist. The keys in the parameter map are of type
String. The values in the parameter map are of type String array (String[]
).public WindowState getWindowState()
getWindowState()
on the wrapped response object.getWindowState
in interface StateAwareResponse
null
if none is setpublic void setEvent(String name, Serializable value)
setEvent()
on the wrapped response object.setEvent
in interface StateAwareResponse
name
- the local part of the event name to publish, must not be null
value
- the value of this event, must have a valid JAXB binding and
be serializable, or null
.public void removePublicRenderParameter(String name)
removePublicRenderParameter()
on the wrapped response object.removePublicRenderParameter
in interface StateAwareResponse
name
- a String
specifying
the name of the public render parameter to be removedCopyright © 2004–2015 The Apache Software Foundation. All rights reserved.