org.jboss.portal.portlet.state
Class AbstractPropertyContext

java.lang.Object
  extended by org.jboss.portal.portlet.state.AbstractPropertyContext
All Implemented Interfaces:
PropertyContext

public class AbstractPropertyContext
extends java.lang.Object
implements PropertyContext

Version:
$Revision: 6757 $
Author:
Julien Viet

Field Summary
static int NO_CHANGE
          No change have been done or attempted.
static int UPDATE_FAILED
          Attempts to update the state that failed has been performed.
static int UPDATE_SUCCESSFUL
          The state has been succesfully updated.
 
Fields inherited from interface org.jboss.portal.portlet.state.PropertyContext
PREFERENCES_ATTRIBUTE
 
Constructor Summary
AbstractPropertyContext(AccessMode access, PropertyMap prefs, boolean render)
          Create a new object.
 
Method Summary
 java.util.Set getKeys()
          Return the key set.
 PropertyMap getPrefs()
           
 int getStatus()
           
 Value getValue(java.lang.String key)
          Return for a specified key its value or null if the value does not exist.
 boolean isReadOnly()
          Return true if the preferences are globally read only.
 void update(PropertyChange[] changes)
          Update the preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHANGE

public static final int NO_CHANGE
No change have been done or attempted.

See Also:
Constant Field Values

UPDATE_FAILED

public static final int UPDATE_FAILED
Attempts to update the state that failed has been performed.

See Also:
Constant Field Values

UPDATE_SUCCESSFUL

public static final int UPDATE_SUCCESSFUL
The state has been succesfully updated.

See Also:
Constant Field Values
Constructor Detail

AbstractPropertyContext

public AbstractPropertyContext(AccessMode access,
                               PropertyMap prefs,
                               boolean render)
                        throws java.lang.IllegalArgumentException
Create a new object.

Parameters:
prefs - the user prefs
Throws:
java.lang.IllegalArgumentException - if the portletPrefs are null
Method Detail

update

public void update(PropertyChange[] changes)
            throws java.lang.IllegalStateException
Description copied from interface: PropertyContext
Update the preferences.

Specified by:
update in interface PropertyContext
Throws:
java.lang.IllegalStateException - if the preferences is not writable

getKeys

public java.util.Set getKeys()
Description copied from interface: PropertyContext
Return the key set.

Specified by:
getKeys in interface PropertyContext
Returns:
the set of keys

getValue

public Value getValue(java.lang.String key)
               throws java.lang.IllegalArgumentException
Description copied from interface: PropertyContext
Return for a specified key its value or null if the value does not exist.

Specified by:
getValue in interface PropertyContext
Parameters:
key - the lookup key
Returns:
the key value or null if it does not exist
Throws:
java.lang.IllegalArgumentException - if the key is null

isReadOnly

public boolean isReadOnly()
Description copied from interface: PropertyContext
Return true if the preferences are globally read only. The value returned by this method is valid only during the action request. Any call to this method during the render request will produce a non accurate value.

Specified by:
isReadOnly in interface PropertyContext
Returns:
true if the preferences are read only

getPrefs

public PropertyMap getPrefs()

getStatus

public int getStatus()