org.apache.tapestry.web
Interface AttributeHolder

All Known Subinterfaces:
WebContext, WebRequest, WebSession
All Known Implementing Classes:
PortletWebContext, PortletWebRequest, PortletWebSession, ServletWebContext, ServletWebRequest, ServletWebSession

public interface AttributeHolder

Interface for objects that can hold attributes. Attributes are objects that are stored and retrieved using unique string names. There may be constraints on when attributes can be accessed (for example, WebSessionattributes should not be changed once the response is committed).

Since:
4.0
Author:
Howard M. Lewis Ship

Method Summary
 Object getAttribute(String name)
          Returns the named object, or null if no attribute has been stored with the given name.
 List getAttributeNames()
          Returns a list of all known attributes in ascending alphabetical order.
 void setAttribute(String name, Object attribute)
          Updates the attribute, replacing (or removing) its value.
 

Method Detail

getAttributeNames

List getAttributeNames()
Returns a list of all known attributes in ascending alphabetical order. May be empty (but won't be null).


getAttribute

Object getAttribute(String name)
Returns the named object, or null if no attribute has been stored with the given name.


setAttribute

void setAttribute(String name,
                  Object attribute)
Updates the attribute, replacing (or removing) its value. For certain implementations, the attribute may need to be serializable (for example, a WebSession  attribute in a clustered application).

Parameters:
name - the name of the attribute to update
attribute - the new value for the attribute, or null to delete the attribute entirely.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.