FileDocCategorySizeDatePackage
ServletPortletPreferences.javaAPI DocExample2873Mon Jul 23 13:26:38 BST 2007org.apache.struts2.portlet.interceptor

ServletPortletPreferences

public class ServletPortletPreferences extends Object implements javax.portlet.PortletPreferences
Simple portlet preferences implementation that uses a map in the Session as storage.

Fields Summary
private Map
session
private String
PREFERENCES_KEY
Constructors Summary
public ServletPortletPreferences(Map session)

    
       
        this.session = session;
    
Methods Summary
public java.util.MapgetMap()

        Map map = (Map) session.get(PREFERENCES_KEY);
        if (map == null) {
            map = new HashMap();
            session.put(PREFERENCES_KEY, map);
        }
        return map;
    
public java.util.EnumerationgetNames()

        return new Vector(getMap().keySet()).elements();
    
public java.lang.StringgetValue(java.lang.String key, java.lang.String def)

        String val = (String) getMap().get(key);
        if (val == null) {
            val = def;
        }
        return val;
    
public java.lang.String[]getValues(java.lang.String key, java.lang.String[] def)

        String[] val = (String[]) getMap().get(key);
        if (val == null) {
            val = def;
        }
        return val;
    
public booleanisReadOnly(java.lang.String arg0)

        return false;
    
public voidreset(java.lang.String arg0)

        session.put(PREFERENCES_KEY, new HashMap());
    
public voidsetValue(java.lang.String key, java.lang.String value)

        getMap().put(key, value);
    
public voidsetValues(java.lang.String key, java.lang.String[] value)

        getMap().put(key, value);
    
public voidstore()