com.ibm.portal.state.accessors.portlet
Interface PortletAccessor

All Superinterfaces:
Accessor, Disposable, Identifiable
All Known Subinterfaces:
LegacyPortletAccessor, LegacyPortletAccessorController, PortletAccessorController

public interface PortletAccessor
extends Identifiable, Accessor

Interface providing read-only accessor methods which allow for inspecting state information related to the portlet this accessor operates on, in particular portlet mode, window state, and render parameters.
Note that this accessor is suitable for legacy portlets as well as standard portlets.
Any implementation of this interface should ensure that also the return types (e.g. the render parameter map) are not modifiable.

Since:
5.1

Method Summary
 java.lang.String getDigest()
          Returns a string that represents a hash over the representation of the portlet window for its current navigational state.
 java.util.Map<java.lang.String,java.lang.String[]> getParameters()
          Returns a map of portlet parameters (String -> String[]).
 PortletMode getPortletMode()
          Returns the current portlet mode.
 PortletMode getPortletMode(PortletMode defaultMode)
          Returns the current portlet mode.
 WindowState getWindowState()
          Returns the current window state.
 WindowState getWindowState(WindowState defaultState)
          Returns the current window state.
 
Methods inherited from interface com.ibm.portal.Identifiable
getObjectID
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Method Detail

getDigest

java.lang.String getDigest()
Returns a string that represents a hash over the representation of the portlet window for its current navigational state.

Returns:
the hash string for this portlet, can be null if the digest could not be computed
Since:
8.0

getParameters

java.util.Map<java.lang.String,java.lang.String[]> getParameters()
Returns a map of portlet parameters (String -> String[]). If no render parameters can be found, an empty map is returned. Note that it is not guaranteed that the returned map is modifiable.

Returns:
Map of render parameters (potentially unmodifiable). If there are no render parameters at all, an empty map is returned. Does not return null.

getPortletMode

PortletMode getPortletMode()
                           throws InvalidPortletModeException
Returns the current portlet mode. If there is no portlet mode information in the state holder, the portlet mode 'View' will be returned.

Returns:
The current PortletMode or the default portlet mode 'View'. Does not return null.
Throws:
InvalidPortletModeException - - if the portlet mode found in the state holder is invalid (e.g. if it cannot be converted to PortletMode).

getPortletMode

PortletMode getPortletMode(PortletMode defaultMode)
                           throws InvalidPortletModeException
Returns the current portlet mode. If there is no portlet mode information in the state holder, the default mode is returned

Parameters:
defaultMode - the mode returned if no portlet-state is set explicitly in the state object
Returns:
The current PortletMode or the default portlet mode. Does not return null.
Throws:
InvalidPortletModeException - - if the portlet mode found in the state holder is invalid (e.g. if it cannot be converted to PortletMode).
Since:
6.1.0.1

getWindowState

WindowState getWindowState()
                           throws InvalidWindowStateException
Returns the current window state. If there is no window state information in the state holder, the window state 'Normal' will be returned.

Returns:
The current WindowState or the default window state 'Normal'. Does not return null).
Throws:
InvalidWindowStateException - - if the window state found in the state holder is invalid (e.g. if it cannot be converted to WindowState).

getWindowState

WindowState getWindowState(WindowState defaultState)
                           throws InvalidWindowStateException
Returns the current window state. If there is no window state information in the state holder, the default state is returned

Parameters:
defaultState - the state returned if no window-state is set explicitly in the state object
Returns:
The current WindowState or the default window. Does not return null).
Throws:
InvalidWindowStateException - - if the window state found in the state holder is invalid (e.g. if it cannot be converted to WindowState).
Since:
6.1.0.1