Class RequestPreferences

  • All Implemented Interfaces:
    javax.portlet.PortletPreferences, IPreferences

    public class RequestPreferences
    extends java.lang.Object
    implements IPreferences
    The preferences object returned by the ServiceContainerRequest.
    Since:
    4.0.7
    Version:
    $Revision: 20212 $ $Date: 2017-06-05 18:16:13 -0300 (Mon, 05 Jun 2017) $
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getLocalValue​(java.lang.String key, java.lang.String def)
      Returns the first String value associated with the specified key of this preference.
      java.lang.String[] getLocalValues​(java.lang.String key, java.lang.String[] def)
      Returns the String array value associated with the specified key in this preference.
      java.util.Map getMap()  
      java.util.Enumeration getNames()  
      java.lang.String getValue​(java.lang.String key, java.lang.String def)  
      java.lang.String[] getValues​(java.lang.String key, java.lang.String[] def)  
      boolean isReadOnly​(java.lang.String key)  
      void reset​(java.lang.String key)  
      void setValue​(java.lang.String key, java.lang.String value)  
      void setValues​(java.lang.String key, java.lang.String[] values)  
      void store()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMap

        public java.util.Map getMap()
        Specified by:
        getMap in interface javax.portlet.PortletPreferences
      • getNames

        public java.util.Enumeration getNames()
        Specified by:
        getNames in interface javax.portlet.PortletPreferences
      • getValue

        public java.lang.String getValue​(java.lang.String key,
                                         java.lang.String def)
        Specified by:
        getValue in interface javax.portlet.PortletPreferences
      • getValues

        public java.lang.String[] getValues​(java.lang.String key,
                                            java.lang.String[] def)
        Specified by:
        getValues in interface javax.portlet.PortletPreferences
      • isReadOnly

        public boolean isReadOnly​(java.lang.String key)
        Specified by:
        isReadOnly in interface javax.portlet.PortletPreferences
      • reset

        public void reset​(java.lang.String key)
                   throws javax.portlet.ReadOnlyException
        Specified by:
        reset in interface javax.portlet.PortletPreferences
        Throws:
        javax.portlet.ReadOnlyException
      • setValue

        public void setValue​(java.lang.String key,
                             java.lang.String value)
                      throws javax.portlet.ReadOnlyException
        Specified by:
        setValue in interface javax.portlet.PortletPreferences
        Throws:
        javax.portlet.ReadOnlyException
      • setValues

        public void setValues​(java.lang.String key,
                              java.lang.String[] values)
                       throws javax.portlet.ReadOnlyException
        Specified by:
        setValues in interface javax.portlet.PortletPreferences
        Throws:
        javax.portlet.ReadOnlyException
      • store

        public void store()
                   throws java.io.IOException,
                          javax.portlet.ValidatorException
        Specified by:
        store in interface javax.portlet.PortletPreferences
        Throws:
        java.io.IOException
        javax.portlet.ValidatorException
      • getLocalValue

        public java.lang.String getLocalValue​(java.lang.String key,
                                              java.lang.String def)
        Description copied from interface: IPreferences
        Returns the first String value associated with the specified key of this preference. This preference is read locally in the current preference level. If there is one or more preference values associated with the given key it returns the first local associated value. If there are no preference values associated with the given key, or the backing preference database is unavailable, it returns the given default value. A null value is treated as a non-existent value.
        Specified by:
        getLocalValue in interface IPreferences
        Parameters:
        key - key for which the associated value is to be returned
        def - the value to be returned in the event that there is no value available associated with this key.
        Returns:
        the local value associated with key, or def if no value is associated with key, or the backing store is inaccessible. The value is read locally in the current preferences level.
        See Also:
        PortletPreferences.getValues(String, String[])
      • getLocalValues

        public java.lang.String[] getLocalValues​(java.lang.String key,
                                                 java.lang.String[] def)
        Description copied from interface: IPreferences
        Returns the String array value associated with the specified key in this preference. This preference is read locally in the current preferences level.

        Returns the specified default if there is no value associated with the key, or if the backing store is inaccessible. A null value is treated as a non-existent value.

        If the implementation supports stored defaults and such a default exists and is accessible, it is used in favor of the specified default.

        Specified by:
        getLocalValues in interface IPreferences
        Parameters:
        key - key for which associated value is to be returned.
        def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a String array, or the backing store is inaccessible.
        Returns:
        the String array value associated with key, or def if the associated value does not exist. The value is read locally in the current preferences level.
        See Also:
        PortletPreferences.getValue(String,String)