org.enhydra.barracuda.core.comp
Class DefaultViewContext

java.lang.Object
  extended byorg.enhydra.barracuda.core.comp.DefaultViewContext
All Implemented Interfaces:
StateMap, ViewContext

public class DefaultViewContext
extends Object
implements ViewContext

This class provides the default implementation of a ViewContext. A View Context basically exists to provide the component models with the information they need to actually pass back the proper data to the component.


Field Summary
 
Fields inherited from interface org.enhydra.barracuda.core.comp.ViewContext
ELEMENT_FACTORY, EVENT_CONTEXT, REQUEST, RESPONSE, TEMPLATE_NODE, VIEW_CAPABILITIES
 
Constructor Summary
DefaultViewContext()
          Create a DefaultViewContext
DefaultViewContext(ViewCapabilities ivc, javax.servlet.http.HttpServletRequest ireq, javax.servlet.http.HttpServletResponse iresp)
          Create a DefaultViewContext for a specific ViewCapabilities obj
DefaultViewContext(ViewEventContext ivec)
          Create a DefaultViewContext for a specific EventContext
 
Method Summary
 void clearState()
          clear all state information
 ElementFactory getElementFactory()
          Get the underlying ElementFactory object (if it exists)
 EventContext getEventContext()
          Get the underlying EventContext object
 javax.servlet.http.HttpServletRequest getRequest()
          Get the underlying HttpServletRequest
 javax.servlet.http.HttpServletResponse getResponse()
          Get the underlying HttpServletResponse
 Object getState(Object key)
          get a property in this StateMap
 List getStateKeys()
          get a list of the keys for this StateMap
 Map getStateValues()
          get a copy of the underlying Map
 Node getTemplateNode()
          Get the underlying template Node (if it exists)
 ViewCapabilities getViewCapabilities()
          Get the underlying ViewCapabilities object
 void putState(Object key, Object val)
          set a property in this StateMap
 Object removeState(Object key)
          remove a property in this StateMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultViewContext

public DefaultViewContext()
Create a DefaultViewContext


DefaultViewContext

public DefaultViewContext(ViewCapabilities ivc,
                          javax.servlet.http.HttpServletRequest ireq,
                          javax.servlet.http.HttpServletResponse iresp)
Create a DefaultViewContext for a specific ViewCapabilities obj


DefaultViewContext

public DefaultViewContext(ViewEventContext ivec)
Create a DefaultViewContext for a specific EventContext

Method Detail

getViewCapabilities

public ViewCapabilities getViewCapabilities()
Get the underlying ViewCapabilities object

Specified by:
getViewCapabilities in interface ViewContext
Returns:
the underlying ViewCapabilities object

getEventContext

public EventContext getEventContext()
Get the underlying EventContext object

Specified by:
getEventContext in interface ViewContext
Returns:
the underlying EventContext object

getElementFactory

public ElementFactory getElementFactory()
Get the underlying ElementFactory object (if it exists)

Specified by:
getElementFactory in interface ViewContext
Returns:
the underlying ElementFactory object (if it exists)

getTemplateNode

public Node getTemplateNode()
Get the underlying template Node (if it exists)

Specified by:
getTemplateNode in interface ViewContext
Returns:
the underlying template Node (if it exists)

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Get the underlying HttpServletRequest

Specified by:
getRequest in interface ViewContext
Returns:
the underlying HttpServletRequest

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Get the underlying HttpServletResponse

Specified by:
getResponse in interface ViewContext
Returns:
the underlying HttpServletResponse

putState

public void putState(Object key,
                     Object val)
set a property in this StateMap

Specified by:
putState in interface StateMap
Parameters:
key - the state key object
val - the state value object

getState

public Object getState(Object key)
get a property in this StateMap

Specified by:
getState in interface StateMap
Parameters:
key - the state key object
Returns:
the value for the given key

removeState

public Object removeState(Object key)
remove a property in this StateMap

Specified by:
removeState in interface StateMap
Parameters:
key - the key object
Returns:
the object which was removed

getStateKeys

public List getStateKeys()
get a list of the keys for this StateMap

Specified by:
getStateKeys in interface StateMap
Returns:
a list the keys for this StateMap

getStateValues

public Map getStateValues()
get a copy of the underlying Map

Specified by:
getStateValues in interface StateMap
Returns:
a copy of the underlying state Map

clearState

public void clearState()
clear all state information

Specified by:
clearState in interface StateMap


Copyright © 2003 BarracudaMVC.org All Rights Reserved.