org.springframework.extensions.surf.render.bean
Class DefaultRenderContext

java.lang.Object
  extended by org.springframework.extensions.surf.WrappedRequestContext
      extended by org.springframework.extensions.surf.render.AbstractRenderContext
          extended by org.springframework.extensions.surf.render.bean.DefaultRenderContext
All Implemented Interfaces:
Serializable, RenderContext, RequestContext

public final class DefaultRenderContext
extends AbstractRenderContext

A render context instance is available to all rendering engines and provides a convenient grab bag of things that are useful to component or template developer.

Author:
muzquiano
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.extensions.surf.render.AbstractRenderContext
idCounter, mode, object, passiveMode, provider, renderId, request, response
 
Fields inherited from interface org.springframework.extensions.surf.RequestContext
ATTR_REQUEST_CONTEXT, DEBUG_MODE_VALUE_COMPONENTS, VALUE_CREDENTIAL_VAULT, VALUE_HEAD_TAGS, VALUE_IDENTITY_VAULT
 
Constructor Summary
DefaultRenderContext(RenderContextProvider provider, RequestContext context)
          Constructor
 
Method Summary
 Serializable getValue(String key)
          Retrieves a custom value from the request context
 Map<String,Serializable> getValuesMap()
          Returns the underlying map of the custom key/values pairs stored on this RequestContext instance.
 boolean hasValue(String key)
          Returns true if a custom value exists in the request context
 void removeValue(String key)
          Removes a custom value from the request context
 void setValue(String key, Serializable value)
          Sets a custom attribute onto the request context
 
Methods inherited from class org.springframework.extensions.surf.render.AbstractRenderContext
getId, getObject, getProvider, getRenderId, getRenderMode, getRequest, getRequestContext, getResponse, getValue, hasValue, isPassiveMode, release, removeValue, setObject, setPassiveMode, setRenderMode, setRequest, setResponse, setValue, toString
 
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, getViewModel, getWebsiteTitle, hasParameter, setCurrentObject, setFormatId, setModel, setPage, setRenderingComponent, setTemplate, setThemeId, setUri, setUser, setViewModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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, getViewModel, getWebsiteTitle, hasParameter, setCurrentObject, setFormatId, setModel, setPage, setRenderingComponent, setTemplate, setThemeId, setUri, setUser, setViewModel
 

Constructor Detail

DefaultRenderContext

public DefaultRenderContext(RenderContextProvider provider,
                            RequestContext context)
Constructor

Parameters:
provider - RenderContextProvider
context - RequestContext to wrap
Method Detail

setValue

public void setValue(String key,
                     Serializable value)
Description copied from interface: RequestContext
Sets a custom attribute onto the request context

Specified by:
setValue in interface RequestContext
Overrides:
setValue in class WrappedRequestContext

getValue

public Serializable getValue(String key)
Description copied from interface: RequestContext
Retrieves a custom value from the request context

Specified by:
getValue in interface RequestContext
Overrides:
getValue in class WrappedRequestContext
Returns:

removeValue

public void removeValue(String key)
Description copied from interface: RequestContext
Removes a custom value from the request context

Specified by:
removeValue in interface RequestContext
Overrides:
removeValue in class WrappedRequestContext

hasValue

public boolean hasValue(String key)
Description copied from interface: RequestContext
Returns true if a custom value exists in the request context

Specified by:
hasValue in interface RequestContext
Overrides:
hasValue in class WrappedRequestContext
Returns:
true if a custom value exists in the request context

getValuesMap

public Map<String,Serializable> getValuesMap()
Description copied from interface: RequestContext
Returns the underlying map of the custom key/values pairs stored on this RequestContext instance. Use with caution!

Specified by:
getValuesMap in interface RequestContext
Overrides:
getValuesMap in class WrappedRequestContext
Returns:
the underlying map of custom key/value pairs.


Copyright © 2009 SpringSource, Inc. All Rights Reserved.