类 MockPortletSession
- java.lang.Object
- org.springframework.mock.web.portlet.MockPortletSession
- 所有已实现的接口:
PortletSession
public class MockPortletSession extends Object implements PortletSession
Mock implementation of thePortletSession
interface.- 从以下版本开始:
- 2.0
- 作者:
- John A. Lewis, Juergen Hoeller
字段概要
从接口继承的字段 javax.portlet.PortletSession
APPLICATION_SCOPE, PORTLET_SCOPE
构造器概要
构造器 构造器 说明 MockPortletSession()
Create a new MockPortletSession with a defaultMockPortletContext
.MockPortletSession(PortletContext portletContext)
Create a new MockPortletSession.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
access()
void
clearAttributes()
Clear all of this session's attributes.protected void
doClearAttributes(Map<String,Object> attributes)
Object
getAttribute(String name)
Object
getAttribute(String name, int scope)
Map<String,Object>
getAttributeMap()
Map<String,Object>
getAttributeMap(int scope)
Enumeration<String>
getAttributeNames()
Enumeration<String>
getAttributeNames(int scope)
long
getCreationTime()
String
getId()
long
getLastAccessedTime()
int
getMaxInactiveInterval()
PortletContext
getPortletContext()
void
invalidate()
boolean
isInvalid()
boolean
isNew()
void
removeAttribute(String name)
void
removeAttribute(String name, int scope)
void
setAttribute(String name, Object value)
void
setAttribute(String name, Object value, int scope)
void
setMaxInactiveInterval(int interval)
void
setNew(boolean value)
构造器详细资料
MockPortletSession
public MockPortletSession()
Create a new MockPortletSession with a defaultMockPortletContext
.- 另请参阅:
MockPortletContext
MockPortletSession
public MockPortletSession(PortletContext portletContext)
Create a new MockPortletSession.- 参数:
portletContext
- the PortletContext that the session runs in
方法详细资料
getAttribute
public Object getAttribute(String name)
- 指定者:
getAttribute
在接口中PortletSession
getAttribute
public Object getAttribute(String name, int scope)
- 指定者:
getAttribute
在接口中PortletSession
getAttributeNames
public Enumeration<String> getAttributeNames()
- 指定者:
getAttributeNames
在接口中PortletSession
getAttributeNames
public Enumeration<String> getAttributeNames(int scope)
- 指定者:
getAttributeNames
在接口中PortletSession
getCreationTime
public long getCreationTime()
- 指定者:
getCreationTime
在接口中PortletSession
getId
public String getId()
- 指定者:
getId
在接口中PortletSession
access
public void access()
getLastAccessedTime
public long getLastAccessedTime()
- 指定者:
getLastAccessedTime
在接口中PortletSession
getMaxInactiveInterval
public int getMaxInactiveInterval()
- 指定者:
getMaxInactiveInterval
在接口中PortletSession
clearAttributes
public void clearAttributes()
Clear all of this session's attributes.
doClearAttributes
protected void doClearAttributes(Map<String,Object> attributes)
invalidate
public void invalidate()
- 指定者:
invalidate
在接口中PortletSession
isInvalid
public boolean isInvalid()
setNew
public void setNew(boolean value)
isNew
public boolean isNew()
- 指定者:
isNew
在接口中PortletSession
removeAttribute
public void removeAttribute(String name)
- 指定者:
removeAttribute
在接口中PortletSession
removeAttribute
public void removeAttribute(String name, int scope)
- 指定者:
removeAttribute
在接口中PortletSession
setAttribute
public void setAttribute(String name, Object value)
- 指定者:
setAttribute
在接口中PortletSession
setAttribute
public void setAttribute(String name, Object value, int scope)
- 指定者:
setAttribute
在接口中PortletSession
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- 指定者:
setMaxInactiveInterval
在接口中PortletSession
getPortletContext
public PortletContext getPortletContext()
- 指定者:
getPortletContext
在接口中PortletSession
getAttributeMap
public Map<String,Object> getAttributeMap()
- 指定者:
getAttributeMap
在接口中PortletSession
getAttributeMap
public Map<String,Object> getAttributeMap(int scope)
- 指定者:
getAttributeMap
在接口中PortletSession