Package javax.portlet.filter
Class EventResponseWrapper
- java.lang.Object
-
- javax.portlet.filter.PortletResponseWrapper
-
- javax.portlet.filter.EventResponseWrapper
-
- All Implemented Interfaces:
EventResponse,PortletResponse,StateAwareResponse
public class EventResponseWrapper extends PortletResponseWrapper implements EventResponse
TheEventResponseWrapperprovides a convenient implementation of theEventResponseinterface 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.- Since:
- 2.0
- See Also:
EventResponse
-
-
Constructor Summary
Constructors Constructor Description EventResponseWrapper(EventResponse response)Creates anEventResponseadaptor wrapping the given response object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortletModegetPortletMode()The default behavior of this method is to callgetPortletMode()on the wrapped response object.java.util.Map<java.lang.String,java.lang.String[]>getRenderParameterMap()The default behavior of this method is to callgetRenderParameterMap()on the wrapped response object.EventResponsegetResponse()Return the wrapped response object.WindowStategetWindowState()The default behavior of this method is to callgetWindowState()on the wrapped response object.voidremovePublicRenderParameter(java.lang.String name)The default behavior of this method is to callremovePublicRenderParameter()on the wrapped response object.voidsetEvent(java.lang.String name, java.io.Serializable value)The default behavior of this method is to callsetEvent()on the wrapped response object.voidsetEvent(javax.xml.namespace.QName name, java.io.Serializable value)The default behavior of this method is to callsetEvent(name, value)on the wrapped response object.voidsetPortletMode(PortletMode portletMode)The default behavior of this method is to callsetPortletMode(portletMode)on the wrapped response object.voidsetRenderParameter(java.lang.String key, java.lang.String value)The default behavior of this method is to callsetRenderParameter(key, value)on the wrapped response object.voidsetRenderParameter(java.lang.String key, java.lang.String[] values)The default behavior of this method is to callsetRenderParameter(key, value)on the wrapped response object.voidsetRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)The default behavior of this method is to callsetRenderParameters(parameters)on the wrapped response object.voidsetRenderParameters(EventRequest request)The default behavior of this method is to callsetRenderParameters()on the wrapped response object.voidsetResponse(EventResponse response)Sets the response object being wrapped.voidsetWindowState(WindowState windowState)The default behavior of this method is to callsetWindowState(windowState)on the wrapped response object.-
Methods inherited from class javax.portlet.filter.PortletResponseWrapper
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty, setResponse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, setProperty
-
-
-
-
Constructor Detail
-
EventResponseWrapper
public EventResponseWrapper(EventResponse response)
Creates anEventResponseadaptor wrapping the given response object.- Parameters:
response- the event response to wrap- Throws:
java.lang.IllegalArgumentException- if the response isnull
-
-
Method Detail
-
setEvent
public void setEvent(javax.xml.namespace.QName name, java.io.Serializable value)The default behavior of this method is to callsetEvent(name, value)on the wrapped response object.- Specified by:
setEventin interfaceStateAwareResponse- Parameters:
name- the event name to publish, must not benullvalue- the value of this event, must have a valid JAXB binding and be serializable, ornull.
-
setPortletMode
public void setPortletMode(PortletMode portletMode) throws PortletModeException
The default behavior of this method is to callsetPortletMode(portletMode)on the wrapped response object.- Specified by:
setPortletModein interfaceStateAwareResponse- Parameters:
portletMode- the new portlet mode- Throws:
PortletModeException- 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 withRequest.isPortletModeAllowed().
-
setRenderParameter
public void setRenderParameter(java.lang.String key, java.lang.String value)The default behavior of this method is to callsetRenderParameter(key, value)on the wrapped response object.- Specified by:
setRenderParameterin interfaceStateAwareResponse- Parameters:
key- key of the render parametervalue- value of the render parameter
-
setRenderParameter
public void setRenderParameter(java.lang.String key, java.lang.String[] values)The default behavior of this method is to callsetRenderParameter(key, value)on the wrapped response object.- Specified by:
setRenderParameterin interfaceStateAwareResponse- Parameters:
key- key of the render parametervalues- values of the render parameter
-
setRenderParameters
public void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
The default behavior of this method is to callsetRenderParameters(parameters)on the wrapped response object.- Specified by:
setRenderParametersin interfaceStateAwareResponse- Parameters:
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[]).
-
setWindowState
public void setWindowState(WindowState windowState) throws WindowStateException
The default behavior of this method is to callsetWindowState(windowState)on the wrapped response object.- Specified by:
setWindowStatein interfaceStateAwareResponse- Parameters:
windowState- the new portlet window state- Throws:
WindowStateException- if the portlet cannot switch to the specified window state. To avoid this exception the portlet can check the allowed window states withRequest.isWindowStateAllowed().- See Also:
WindowState
-
getResponse
public EventResponse getResponse()
Return the wrapped response object.- Overrides:
getResponsein classPortletResponseWrapper- Returns:
- the wrapped response
-
setResponse
public void setResponse(EventResponse response)
Sets the response object being wrapped.- Parameters:
response- the response to set- Throws:
java.lang.IllegalArgumentException- if the response is null.
-
getPortletMode
public PortletMode getPortletMode()
The default behavior of this method is to callgetPortletMode()on the wrapped response object.- Specified by:
getPortletModein interfaceStateAwareResponse- Returns:
- the portlet mode, or
nullif none is set
-
getRenderParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getRenderParameterMap()
The default behavior of this method is to callgetRenderParameterMap()on the wrapped response object.- Specified by:
getRenderParameterMapin interfaceStateAwareResponse- Returns:
Mapcontaining render parameter names as keys and parameter values as map values, or an emptyMapif 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[]).
-
getWindowState
public WindowState getWindowState()
The default behavior of this method is to callgetWindowState()on the wrapped response object.- Specified by:
getWindowStatein interfaceStateAwareResponse- Returns:
- the window state, or
nullif none is set
-
setRenderParameters
public void setRenderParameters(EventRequest request)
The default behavior of this method is to callsetRenderParameters()on the wrapped response object.- Specified by:
setRenderParametersin interfaceEventResponse- Parameters:
request- The request the portlet has been provided with by the portlet container for the currentprocessEventcall, must not benull.
-
setEvent
public void setEvent(java.lang.String name, java.io.Serializable value)The default behavior of this method is to callsetEvent()on the wrapped response object.- Specified by:
setEventin interfaceStateAwareResponse- Parameters:
name- the local part of the event name to publish, must not benullvalue- the value of this event, must have a valid JAXB binding and be serializable, ornull.
-
removePublicRenderParameter
public void removePublicRenderParameter(java.lang.String name)
The default behavior of this method is to callremovePublicRenderParameter()on the wrapped response object.- Specified by:
removePublicRenderParameterin interfaceStateAwareResponse- Parameters:
name- aStringspecifying the name of the public render parameter to be removed
-
-