net.sourceforge.scopes
Interface State

All Known Implementing Classes:
StateImpl

public interface State

It represents a state of a web application. It is in fact a set of contexts, where each context has its own attributes, that represents a part of the state.
The concept of a state has been used for this class, because, in fact, it represents a state of a web application in a certain moment.


Method Summary
 java.lang.Object getAttribute(java.lang.String attributeName)
          Returns an attribute, searching in all contexts, until it finds one.
 java.lang.Object getAttribute(java.lang.String contextName, java.lang.String attributeName)
          Returns an attribute in a context.
 java.util.Set<java.lang.String> getAttributeNames()
          Returns all attribute names in all contexts.
 java.util.Set<java.lang.String> getAttributeNames(java.lang.String contextName)
          Returns the attribute names for a particular context.
 Context getContext(java.lang.String contextName)
          Returns a context object.
 java.util.Set<java.lang.String> getContextNames()
          Returns the names of the used contexts.
 void removeAttribute(java.lang.String attributeName)
          Removes an attribute in every context.
 void removeAttribute(java.lang.String contextName, java.lang.String attributeName)
          Removes an attribute from a context.
 void setAttribute(java.lang.String attributeName, java.lang.Object object)
          Sets an attribute, searching if it exists.
 void setAttribute(java.lang.String contextName, java.lang.String attributeName, java.lang.Object object)
           
 

Method Detail

getContextNames

java.util.Set<java.lang.String> getContextNames()
Returns the names of the used contexts.

Returns:
The set of context names.

getContext

Context getContext(java.lang.String contextName)
Returns a context object.

Parameters:
contextName - The context name.
Returns:
The needed context object.

getAttribute

java.lang.Object getAttribute(java.lang.String contextName,
                              java.lang.String attributeName)
Returns an attribute in a context.

Parameters:
contextName - The name of the context.
attributeName - The name of the attribute.
Returns:
The needed attribute.

getAttributeNames

java.util.Set<java.lang.String> getAttributeNames(java.lang.String contextName)
Returns the attribute names for a particular context.

Parameters:
contextName - The name of the context.
Returns:
The attribute name set.

setAttribute

void setAttribute(java.lang.String contextName,
                  java.lang.String attributeName,
                  java.lang.Object object)

removeAttribute

void removeAttribute(java.lang.String contextName,
                     java.lang.String attributeName)
Removes an attribute from a context.

Parameters:
contextName - The name of the context.
attributeName - The attribute to remove.

getAttribute

java.lang.Object getAttribute(java.lang.String attributeName)
Returns an attribute, searching in all contexts, until it finds one.

Parameters:
attributeName - The attribute name to search.
Returns:
The attribute.

getAttributeNames

java.util.Set<java.lang.String> getAttributeNames()
Returns all attribute names in all contexts.

Returns:
The attribute name set.

setAttribute

void setAttribute(java.lang.String attributeName,
                  java.lang.Object object)
Sets an attribute, searching if it exists. If it is found, it overwrites it, otherwise does nothing.

Parameters:
attributeName - The name of the attribute to overwrite.
object - The new attribute

removeAttribute

void removeAttribute(java.lang.String attributeName)
Removes an attribute in every context.

Parameters:
attributeName - The attribute to remove.