org.cafesip.jiplet
Class ScopedVariables

java.lang.Object
  extended by org.cafesip.jiplet.ScopedVariables
Direct Known Subclasses:
JipletContext, JipletDialog, JipletEvent, JipletSession, JipletTransaction

public class ScopedVariables
extends java.lang.Object

This is a base class for all scoped-variables. The jiplet container supports scoped variables similar to Java servlets. Scoped variables can be created, retrieved, and deleted by jiplets by calling the setAttribute(), getAttribute(), and removeAttribute() methods. The jiplet container supports the following types of scoped-variables:


Constructor Summary
protected ScopedVariables()
          A constructor for this class.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          This method retrieves a previously stored variable.
 java.util.Enumeration getAttributeNames()
          Gets a list of all the variables stored in the scope variables.
 void removeAttribute(java.lang.String name)
          Remove a variable.
 void setAttribute(java.lang.String name, java.lang.Object obj)
          This method is used to store a variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopedVariables

protected ScopedVariables()
A constructor for this class.

Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
This method retrieves a previously stored variable.

Parameters:
name - of the variable.
Returns:
The value. A null value is returned if the variable is not found.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object obj)
This method is used to store a variable.

Parameters:
name - name of the variable.Note: if this method is called multiple times with the same name, the object stored by this variable is overwritten.
obj - The object to be stored as a variable.

removeAttribute

public void removeAttribute(java.lang.String name)
Remove a variable.

Parameters:
name - of the variable.

getAttributeNames

public java.util.Enumeration getAttributeNames()
Gets a list of all the variables stored in the scope variables.

Returns:
An Enumeration object. Each element is a String containing a variable name.


http://www.cafesip.org