org.springframework.extensions.surf.render
Class AbstractRenderContext
java.lang.Object
org.springframework.extensions.surf.WrappedRequestContext
org.springframework.extensions.surf.render.AbstractRenderContext
- All Implemented Interfaces:
- Serializable, RenderContext, RequestContext
- Direct Known Subclasses:
- DefaultRenderContext
public abstract class AbstractRenderContext
- extends WrappedRequestContext
- implements RenderContext, Serializable
An abstract base class which developers can use to extend and build
their own implementations of render context types.
This wraps the request context for you automatically and provides
callthrus to the underlying request context.
It also establishes the idea of connecting the provider to the
render context so that threading is possible.
- Author:
- muzquiano
- See Also:
- Serialized Form
| Methods inherited from class org.springframework.extensions.surf.WrappedRequestContext |
getCredentialVault, getCurrentObject, getCurrentObjectId, getFormatId, getLinkBuilder, getModel, getOriginalContext, getPage, getPageId, getPageTitle, getParameter, getParameters, getRenderingComponents, getRequestContent, getRequestContentType, getRequestMethod, getRootPage, getServiceRegistry, getSiteConfiguration, getTemplate, getTemplateId, getTheme, getThemeId, getUri, getUser, getUserId, getValue, getValuesMap, getViewModel, getWebsiteTitle, hasParameter, hasValue, removeValue, setCurrentObject, setFormatId, setModel, setPage, setRenderingComponent, setTemplate, setThemeId, setUri, setUser, setValue, setViewModel |
| Methods inherited from interface org.springframework.extensions.surf.RequestContext |
getCredentialVault, getCurrentObject, getCurrentObjectId, getFormatId, getLinkBuilder, getModel, getPage, getPageId, getPageTitle, getParameter, getParameters, getRenderingComponents, getRequestContent, getRequestContentType, getRequestMethod, getRootPage, getServiceRegistry, getSiteConfiguration, getTemplate, getTemplateId, getTheme, getThemeId, getUri, getUser, getUserId, getValue, getValuesMap, getViewModel, getWebsiteTitle, hasParameter, hasValue, removeValue, setCurrentObject, setFormatId, setModel, setPage, setRenderingComponent, setTemplate, setThemeId, setUri, setUser, setValue, setViewModel |
provider
protected final RenderContextProvider provider
object
protected ModelObject object
request
protected javax.servlet.http.HttpServletRequest request
response
protected javax.servlet.http.HttpServletResponse response
mode
protected RenderMode mode
renderId
protected String renderId
passiveMode
protected boolean passiveMode
idCounter
protected static int idCounter
- Increments every time a request id is required
AbstractRenderContext
public AbstractRenderContext(RenderContextProvider provider,
RequestContext requestContext)
- Constructor
- Parameters:
provider - requestContext -
getRenderMode
public final RenderMode getRenderMode()
- Specified by:
getRenderMode in interface RenderContext
setRenderMode
public final void setRenderMode(RenderMode mode)
- Specified by:
setRenderMode in interface RenderContext
getRequest
public final javax.servlet.http.HttpServletRequest getRequest()
- Description copied from interface:
RequestContext
- Returns the HTTP Servlet Request bound to this request
- Specified by:
getRequest in interface RequestContext- Overrides:
getRequest in class WrappedRequestContext
- Returns:
setRequest
public final void setRequest(javax.servlet.http.HttpServletRequest request)
- Specified by:
setRequest in interface RenderContext
getResponse
public final javax.servlet.http.HttpServletResponse getResponse()
- Specified by:
getResponse in interface RenderContext
setResponse
public final void setResponse(javax.servlet.http.HttpServletResponse response)
- Specified by:
setResponse in interface RenderContext
getObject
public ModelObject getObject()
- Specified by:
getObject in interface RenderContext
setObject
public void setObject(ModelObject object)
- Specified by:
setObject in interface RenderContext
getRenderId
public final String getRenderId()
- Specified by:
getRenderId in interface RenderContext
getId
public final String getId()
- Description copied from interface:
RequestContext
- Each request context instance is stamped with a unique id
- Specified by:
getId in interface RequestContext- Overrides:
getId in class WrappedRequestContext
- Returns:
- The id of the request context
getProvider
public final RenderContextProvider getProvider()
- Specified by:
getProvider in interface RenderContext
release
public void release()
- Description copied from interface:
RequestContext
- Release any resources held by the request context
As part of the contract for a RequestContext object, this will only ever be called once
and no further method calls will be made to the RequestContext object.
- Specified by:
release in interface RenderContext- Specified by:
release in interface RequestContext- Overrides:
release in class WrappedRequestContext
toString
public String toString()
- Overrides:
toString in class WrappedRequestContext
setPassiveMode
public final void setPassiveMode(boolean passiveMode)
- Specified by:
setPassiveMode in interface RenderContext
isPassiveMode
public final boolean isPassiveMode()
- Specified by:
isPassiveMode in interface RenderContext
setValue
public void setValue(String key,
Serializable value,
RenderContextScope scope)
- Specified by:
setValue in interface RenderContext
getValue
public Serializable getValue(String key,
RenderContextScope scope)
- Specified by:
getValue in interface RenderContext
removeValue
public void removeValue(String key,
RenderContextScope scope)
- Specified by:
removeValue in interface RenderContext
hasValue
public boolean hasValue(String key,
RenderContextScope scope)
- Specified by:
hasValue in interface RenderContext
getRequestContext
public final RequestContext getRequestContext()
Copyright © 2009 SpringSource, Inc. All Rights Reserved.