Class MutableRenderStateWrapper
- java.lang.Object
-
- jakarta.portlet.filter.RenderStateWrapper
-
- jakarta.portlet.filter.MutableRenderStateWrapper
-
- All Implemented Interfaces:
Mutable,MutableRenderState,RenderState
public class MutableRenderStateWrapper extends RenderStateWrapper implements MutableRenderState, Mutable
TheMutableRenderStateWrapperprovides a convenient implementation of theMutableRenderStateinterface 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
-
-
Constructor Summary
Constructors Constructor Description MutableRenderStateWrapper(MutableRenderState wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MutableRenderParametersgetRenderParameters()Gets the render parameters.MutableRenderStategetWrapped()Gets the wrapped object.voidsetPortletMode(PortletMode portletMode)Sets the portlet mode of a portlet to the given portlet mode.voidsetWindowState(WindowState windowState)Sets the window state of a portlet to the given window state.voidsetWrapped(MutableRenderState wrapped)Sets the wrapped object.-
Methods inherited from class jakarta.portlet.filter.RenderStateWrapper
getPortletMode, getWindowState, setWrapped
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.portlet.RenderState
getPortletMode, getWindowState
-
-
-
-
Constructor Detail
-
MutableRenderStateWrapper
public MutableRenderStateWrapper(MutableRenderState wrapped)
- Parameters:
wrapped- the wrapped object to set.- Throws:
IllegalArgumentException- if the MutableRenderState is null.
-
-
Method Detail
-
getWrapped
public MutableRenderState getWrapped()
Gets the wrapped object.- Overrides:
getWrappedin classRenderStateWrapper- Returns:
- the wrapped object.
-
setWrapped
public void setWrapped(MutableRenderState wrapped)
Sets the wrapped object.- Parameters:
wrapped- the wrapped object to set.- Throws:
IllegalArgumentException- if the MutableRenderState is null.
-
getRenderParameters
public MutableRenderParameters getRenderParameters()
Description copied from interface:RenderStateGets the render parameters.- Specified by:
getRenderParametersin interfaceMutableRenderState- Specified by:
getRenderParametersin interfaceRenderState- Overrides:
getRenderParametersin classRenderStateWrapper- Returns:
- an immutable
RenderParametersobject representing the private and public render parameters - See Also:
PortletParameters,RenderParameters
-
setWindowState
public void setWindowState(WindowState windowState) throws WindowStateException
Description copied from interface:MutableRenderStateSets the window state of a portlet to the given window state.Possible values are the standard window states and any custom window states supported by the portal and the portlet. Standard window states are:
- MINIMIZED
- NORMAL
- MAXIMIZED
Not more than one window state can be set. If more than one window state is set, only the last one set is valid.
- Specified by:
setWindowStatein interfaceMutableRenderState- Parameters:
windowState- the new portlet window state- Throws:
WindowStateException- if the portlet cannot switch to this state, because the portal does not support this state, the portlet has not declared in its deployment descriptor that it supports this state, or the current user is not allowed to switch to this state. ThePortletRequest.isWindowStateAllowed()method can be used to check if the portlet can set a given window state.
-
setPortletMode
public void setPortletMode(PortletMode portletMode) throws PortletModeException
Description copied from interface:MutableRenderStateSets the portlet mode of a portlet to the given portlet mode.Possible values are the standard portlet modes and any custom portlet modes supported by the portal and the portlet. Portlets must declare in the deployment descriptor the portlet modes they support for each markup type. Standard portlet modes are:
- EDIT
- HELP
- VIEW
Not more than one portlet mode can be set. If more than one portlet mode is set, only the last one set is valid.
Note: The portlet may still be called in a different portlet mode in the next render call, depending on the portlet container / portal.
- Specified by:
setPortletModein interfaceMutableRenderState- Parameters:
portletMode- the new portlet mode- Throws:
PortletModeException- if the portlet cannot switch to this mode, because the portal does not support this mode, the portlet has not declared in its deployment descriptor that it supports this mode for the current markup, or the current user is not allowed to switch to this mode. ThePortletRequest.isPortletModeAllowed()method can be used to check if the portlet can set a given portlet mode.
-
-