|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Preference
The Preference
interface allows one to access each
PortletPreferences
as a discrete object. This allows one to more
easily access a preference via EL. Operations made on a Preference
object are immediately reflected in the underlying PortletPreferences
.
As usual, changes aren't committed until PortletPreferences.store
is called.
Method Summary | |
---|---|
java.lang.String |
getName()
Returns the name of this preference. |
java.lang.String |
getValue()
Returns the first String value associated with this preference. |
java.util.List |
getValues()
Returns a List of values associated with this preference. |
boolean |
isReadOnly()
Returns true, if the value of this preference cannot be modified by the user. |
void |
reset()
Resets or removes the value(s) of this preference. |
void |
setName(java.lang.String name)
Sets the name of this preference. |
void |
setValue(java.lang.String value)
Associates the specified String value with this preference. |
void |
setValues(java.lang.String[] values)
Associates the specified String array value with this preference. |
Method Detail |
---|
void setName(java.lang.String name)
name
- the new name for this preference.java.lang.String getName()
java.lang.String getValue()
null
if there isn't an associated value or the backing
store is inaccessible.getValues()
java.util.List getValues()
List
of values associated with this preference.
Returns the null
if there aren't any values,
or if the backing store is inaccessible.
If the implementation supports stored defaults and such a default exists and is accessible, they are returned in a situation where null otherwise would have been returned.
null
if the
associated value does not exist.getValue()
boolean isReadOnly()
Modifiable preferences can be changed by the
portlet in any standard portlet mode (EDIT, HELP, VIEW
).
Per default every preference is modifiable.
Read-only preferences cannot be changed by the
portlet in any standard portlet mode, but inside of custom modes
it may be allowed changing them.
Preferences are read-only, if they are defined in the
deployment descriptor with read-only
set to true
,
or if the portlet container restricts write access.
void reset() throws ReadOnlyException
If this implementation supports stored defaults, and there is such a default for the specified preference, the preference will be reset to the stored default.
If there is no default available the preference will be removed from the underyling system.
ReadOnlyException
- if this preference cannot be modified for this requestvoid setValue(java.lang.String value) throws ReadOnlyException
null
values
for the value parameter are allowed.
value
- value to be associated with the specified key.
ReadOnlyException
- if this preference cannot be modified for this requestsetValues(String[])
void setValues(java.lang.String[] values) throws ReadOnlyException
null
values
in the values parameter are allowed.
values
- values to be associated with key
ReadOnlyException
- if this preference cannot be modified for this requestsetValue(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |