mapelresolver.html

来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 623 行 · 第 1/3 页

HTML
623
字号
<DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The map to be modified. Only bases of type <code>Map</code>     are handled by this resolver.<DD><CODE>property</CODE> - The key with which the specified value is to be     associated.<DD><CODE>val</CODE> - The value to be associated with the specified key.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang">ClassCastException</A></CODE> - if the class of the specified key or      value prevents it from being stored in this map.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if context is <code>null</code>, or if      this map does not permit <code>null</code> keys or values, and     the specified key or value is <code>null</code>.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if some aspect of this key or      value prevents it from being stored in this map.<DD><CODE><A HREF="../../javax/el/ELException.html" title="class in javax.el">ELException</A></CODE> - if an exception was thrown while performing     the property or variable resolution. The thrown exception     must be included as the cause property of this exception, if     available.<DD><CODE><A HREF="../../javax/el/PropertyNotWritableException.html" title="class in javax.el">PropertyNotWritableException</A></CODE> - if this resolver was constructed     in read-only mode, or if the put operation is not supported by      the underlying map.</DL></DD></DL><HR><A NAME="isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)"><!-- --></A><H3>isReadOnly</H3><PRE>public boolean <B>isReadOnly</B>(<A HREF="../../javax/el/ELContext.html" title="class in javax.el">ELContext</A>&nbsp;context,                          <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;base,                          <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;property)</PRE><DL><DD>If the base object is a map, returns whether a call to  <A HREF="../../javax/el/MapELResolver.html#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)"><CODE>setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)</CODE></A> will always fail. <p>If the base is a <code>Map</code>, the <code>propertyResolved</code> property of the <code>ELContext</code> object must be set to <code>true</code> by this resolver, before returning. If this property is not <code>true</code> after this method is called, the caller  should ignore the return value.</p> <p>If this resolver was constructed in read-only mode, this method will always return <code>true</code>.</p> <p>If a <code>Map</code> was created using  <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Collections.html#unmodifiableMap(java.util.Map)" title="class or interface in java.util"><CODE>Collections.unmodifiableMap(java.util.Map<? extends K, ? extends V>)</CODE></A>, this method must return <code>true</code>. Unfortunately, there is no Collections API method to detect this. However, an implementation can create a prototype unmodifiable <code>Map</code> and query its runtime type to see if it matches the runtime type of the base object as a  workaround.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/el/ELResolver.html#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)">isReadOnly</A></CODE> in class <CODE><A HREF="../../javax/el/ELResolver.html" title="class in javax.el">ELResolver</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The map to analyze. Only bases of type <code>Map</code>     are handled by this resolver.<DD><CODE>property</CODE> - The key to return the read-only status for.     Ignored by this resolver.<DT><B>Returns:</B><DD>If the <code>propertyResolved</code> property of      <code>ELContext</code> was set to <code>true</code>, then     <code>true</code> if calling the <code>setValue</code> method     will always fail or <code>false</code> if it is possible that     such a call may succeed; otherwise undefined.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if context is <code>null</code><DD><CODE><A HREF="../../javax/el/ELException.html" title="class in javax.el">ELException</A></CODE> - if an exception was thrown while performing     the property or variable resolution. The thrown exception     must be included as the cause property of this exception, if     available.</DL></DD></DL><HR><A NAME="getFeatureDescriptors(javax.el.ELContext, java.lang.Object)"><!-- --></A><H3>getFeatureDescriptors</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A>&lt;<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/beans/FeatureDescriptor.html" title="class or interface in java.beans">FeatureDescriptor</A>&gt; <B>getFeatureDescriptors</B>(<A HREF="../../javax/el/ELContext.html" title="class in javax.el">ELContext</A>&nbsp;context,                                                         <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;base)</PRE><DL><DD>If the base object is a map, returns an <code>Iterator</code> containing the set of keys available in the <code>Map</code>.  Otherwise, returns <code>null</code>. <p>The <code>Iterator</code> returned must contain zero or more  instances of <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/beans/FeatureDescriptor.html" title="class or interface in java.beans"><CODE>FeatureDescriptor</CODE></A>. Each info object  contains information about a key in the Map, and is initialized as  follows: <dl>     <li>displayName - The return value of calling the          <code>toString</code> method on this key, or          <code>"null"</code> if the key is <code>null</code>.</li>     <li>name - Same as displayName property.</li>     <li>shortDescription - Empty string</li>     <li>expert - <code>false</code></li>     <li>hidden - <code>false</code></li>     <li>preferred - <code>true</code></li> </dl> In addition, the following named attributes must be set in the returned <code>FeatureDescriptor</code>s: <dl>     <li><A HREF="../../javax/el/ELResolver.html#TYPE"><CODE>ELResolver.TYPE</CODE></A> - The return value of calling the <code>getClass()</code>         method on this key, or <code>null</code> if the key is         <code>null</code>.</li>     <li><A HREF="../../javax/el/ELResolver.html#RESOLVABLE_AT_DESIGN_TIME"><CODE>ELResolver.RESOLVABLE_AT_DESIGN_TIME</CODE></A> - <code>true</code></li> </dl> </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/el/ELResolver.html#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)">getFeatureDescriptors</A></CODE> in class <CODE><A HREF="../../javax/el/ELResolver.html" title="class in javax.el">ELResolver</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The map whose keys are to be iterated over. Only bases      of type <code>Map</code> are handled by this resolver.<DT><B>Returns:</B><DD>An <code>Iterator</code> containing zero or more (possibly     infinitely more) <code>FeatureDescriptor</code> objects, each     representing a key in this map, or <code>null</code> if      the base object is not a map.<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/beans/FeatureDescriptor.html" title="class or interface in java.beans"><CODE>FeatureDescriptor</CODE></A></DL></DD></DL><HR><A NAME="getCommonPropertyType(javax.el.ELContext, java.lang.Object)"><!-- --></A><H3>getCommonPropertyType</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A>&lt;?&gt; <B>getCommonPropertyType</B>(<A HREF="../../javax/el/ELContext.html" title="class in javax.el">ELContext</A>&nbsp;context,                                      <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;base)</PRE><DL><DD>If the base object is a map, returns the most general type that  this resolver accepts for the <code>property</code> argument. Otherwise, returns <code>null</code>. <p>Assuming the base is a <code>Map</code>, this method will always return <code>Object.class</code>. This is because <code>Map</code>s accept any object as a key.</p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/el/ELResolver.html#getCommonPropertyType(javax.el.ELContext, java.lang.Object)">getCommonPropertyType</A></CODE> in class <CODE><A HREF="../../javax/el/ELResolver.html" title="class in javax.el">ELResolver</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The map to analyze. Only bases of type <code>Map</code>     are handled by this resolver.<DT><B>Returns:</B><DD><code>null</code> if base is not a <code>Map</code>; otherwise     <code>Object.class</code>.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../javax/el/ListELResolver.html" title="class in javax.el"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javax/el/MethodExpression.html" title="class in javax.el"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?javax/el/MapELResolver.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="MapELResolver.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_javax.el.ELResolver">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?