📄 portletpreferences.html.svn-base
字号:
<DT><B>Returns:</B><DD>false, if the value of this key can be changed, or if the key is not known<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>key</code> is <code>null</code>.</DL></DD></DL><HR><A NAME="getValue(java.lang.String, java.lang.String)"><!-- --></A><H3>getValue</H3><PRE>public java.lang.String <B>getValue</B>(java.lang.String key, java.lang.String def)</PRE><DL><DD>Returns the first String value associated with the specified key of this preference. If there is one or more preference values associated with the given key it returns the first 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.<DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key for which the associated value is to be returned<DD><CODE>def</CODE> - the value to be returned in the event that there is no value available associated with this <code>key</code>.<DT><B>Returns:</B><DD>the value associated with <code>key</code>, or <code>def</code> if no value is associated with <code>key</code>, or the backing store is inaccessible.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>key</code> is <code>null</code>. (A <code>null</code> value for <code>def</code> <i>is</i> permitted.)<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/PortletPreferences.html#getValues(java.lang.String, java.lang.String[])"><CODE>getValues(String, String[])</CODE></A></DL></DD></DL><HR><A NAME="getValues(java.lang.String, java.lang.String[])"><!-- --></A><H3>getValues</H3><PRE>public java.lang.String[] <B>getValues</B>(java.lang.String key, java.lang.String[] def)</PRE><DL><DD>Returns the String array value associated with the specified key in this preference. <p>Returns the specified default if there is no value associated with the key, or if the backing store is inaccessible. <p>If the implementation supports <i>stored defaults</i> and such a default exists and is accessible, it is used in favor of the specified default.<DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key for which associated value is to be returned.<DD><CODE>def</CODE> - the value to be returned in the event that this preference node has no value associated with <code>key</code> or the associated value cannot be interpreted as a String array, or the backing store is inaccessible.<DT><B>Returns:</B><DD>the String array value associated with <code>key</code>, or <code>def</code> if the associated value does not exist.<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if <code>key</code> is <code>null</code>. (A <code>null</code> value for <code>def</code> <i>is</i> permitted.)<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/PortletPreferences.html#getValue(java.lang.String, java.lang.String)"><CODE>getValue(String,String)</CODE></A></DL></DD></DL><HR><A NAME="setValue(java.lang.String, java.lang.String)"><!-- --></A><H3>setValue</H3><PRE>public void <B>setValue</B>(java.lang.String key, java.lang.String value) throws <A HREF="../../javax/portlet/ReadOnlyException.html">ReadOnlyException</A></PRE><DL><DD>Associates the specified String value with the specified key in this preference. <p> The key cannot be <code>null</code>, but <code>null</code> values for the value parameter are allowed.<DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key with which the specified value is to be associated.<DD><CODE>value</CODE> - value to be associated with the specified key.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/portlet/ReadOnlyException.html">ReadOnlyException</A></CODE> - if this preference cannot be modified for this request<DD><CODE>java.lang.IllegalArgumentException</CODE> - if key is <code>null</code>, or <code>key.length()</code> or <code>value.length</code> are to long. The maximum length for key and value are implementation specific.<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/PortletPreferences.html#setValues(java.lang.String, java.lang.String[])"><CODE>setValues(String, String[])</CODE></A></DL></DD></DL><HR><A NAME="setValues(java.lang.String, java.lang.String[])"><!-- --></A><H3>setValues</H3><PRE>public void <B>setValues</B>(java.lang.String key, java.lang.String[] values) throws <A HREF="../../javax/portlet/ReadOnlyException.html">ReadOnlyException</A></PRE><DL><DD>Associates the specified String array value with the specified key in this preference. <p> The key cannot be <code>null</code>, but <code>null</code> values in the values parameter are allowed.<DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - key with which the value is to be associated<DD><CODE>values</CODE> - values to be associated with key<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if key is <code>null</code>, or <code>key.length()</code> is to long or <code>value.size</code> is to large. The maximum length for key and maximum size for value are implementation specific.<DD><CODE><A HREF="../../javax/portlet/ReadOnlyException.html">ReadOnlyException</A></CODE> - if this preference cannot be modified for this request<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/PortletPreferences.html#setValue(java.lang.String, java.lang.String)"><CODE>setValue(String,String)</CODE></A></DL></DD></DL><HR><A NAME="getNames()"><!-- --></A><H3>getNames</H3><PRE>public java.util.Enumeration <B>getNames</B>()</PRE><DL><DD>Returns all of the keys that have an associated value, or an empty <code>Enumeration</code> if no keys are available.<DD><DL><DT><B>Returns:</B><DD>an Enumeration of the keys that have an associated value, or an empty <code>Enumeration</code> if no keys are available.</DL></DD></DL><HR><A NAME="getMap()"><!-- --></A><H3>getMap</H3><PRE>public java.util.Map <B>getMap</B>()</PRE><DL><DD>Returns a <code>Map</code> of the preferences. <p> The values in the returned <code>Map</code> are from type String array (<code>String[]</code>). <p> If no preferences exist this method returns an empty <code>Map</code>.<DD><DL><DT><B>Returns:</B><DD>an immutable <code>Map</code> containing preference names as keys and preference values as map values, or an empty <code>Map</code> if no preference exist. The keys in the preference map are of type String. The values in the preference map are of type String array (<code>String[]</code>).</DL></DD></DL><HR><A NAME="reset(java.lang.String)"><!-- --></A><H3>reset</H3><PRE>public void <B>reset</B>(java.lang.String key) throws <A HREF="../../javax/portlet/ReadOnlyException.html">ReadOnlyException</A></PRE><DL><DD>Resets or removes the value associated with the specified key. <p> If this implementation supports stored defaults, and there is such a default for the specified preference, the given key will be reset to the stored default. <p> If there is no default available the key will be removed.<DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - to reset<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if key is <code>null</code>.<DD><CODE><A HREF="../../javax/portlet/ReadOnlyException.html">ReadOnlyException</A></CODE> - if this preference cannot be modified for this request</DL></DD></DL><HR><A NAME="store()"><!-- --></A><H3>store</H3><PRE>public void <B>store</B>() throws java.io.IOException, <A HREF="../../javax/portlet/ValidatorException.html">ValidatorException</A></PRE><DL><DD>Commits all changes made to the preferences via the <code>set</code> methods in the persistent store. <P> If this call returns succesfull, all changes are made persistent. If this call fails, no changes are made in the persistent store. This call is an atomic operation regardless of how many preference attributes have been modified. <P> All changes made to preferences not followed by a call to the <code>store</code> method are discarded when the portlet finishes the <code>processAction</code> method. <P> If a validator is defined for this preferences in the deployment descriptor, this validator is called before the actual store is performed to check wether the given preferences are vaild. If this check fails a <code>ValidatorException</code> is thrown.<DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if changes cannot be written into the backend store<DD><CODE><A HREF="../../javax/portlet/ValidatorException.html">ValidatorException</A></CODE> - if the validation performed by the associated validator fails<DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called inside a render call<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/PreferencesValidator.html"><CODE>PreferencesValidator</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>Portlet API (V1.0) </EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/portlet/PortletContext.html"><B>PREV CLASS</B></A> <A HREF="../../javax/portlet/PortletRequest.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="PortletPreferences.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><a href=license.txt >Copyright</a> © 2003 IBM Corporation and Sun Microsystems, Inc. All rights reserved</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -