elresolver.html

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

HTML
687
字号
 object on the given <code>base</code> object. <p>If this resolver handles the given (base, property) pair,  the <code>propertyResolved</code> property of the  <code>ELContext</code> object must be set to <code>true</code> by the resolver, before returning. If this property is not  <code>true</code> after this method is called, the caller can safely assume no value has been set.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The base object whose property value is to be set,     or <code>null</code> to set a top-level variable.<DD><CODE>property</CODE> - The property or variable to be set.<DD><CODE>value</CODE> - The value to set the property or variable to.<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/PropertyNotFoundException.html" title="class in javax.el">PropertyNotFoundException</A></CODE> - if the given (base, property) pair     is handled by this <code>ELResolver</code> but the specified     variable or property does not exist.<DD><CODE><A HREF="../../javax/el/PropertyNotWritableException.html" title="class in javax.el">PropertyNotWritableException</A></CODE> - if the given (base, property)     pair is handled by this <code>ELResolver</code> but the specified     variable or property is not writable.<DD><CODE><A HREF="../../javax/el/ELException.html" title="class in javax.el">ELException</A></CODE> - if an exception was thrown while attempting to     set the property or variable. The thrown exception     must be included as the cause property of this exception, if     available.</DL></DD></DL><HR><A NAME="isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)"><!-- --></A><H3>isReadOnly</H3><PRE>public abstract 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>For a given <code>base</code> and <code>property</code>, attempts to determine whether a call to <A HREF="../../javax/el/ELResolver.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 this resolver handles the given (base, property) pair,  the <code>propertyResolved</code> property of the  <code>ELContext</code> object must be set to <code>true</code> by the 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><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The base object whose property value is to be analyzed,     or <code>null</code> to analyze a top-level variable.<DD><CODE>property</CODE> - The property or variable to return the read-only status     for.<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 the property is read-only or     <code>false</code> if not; 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/PropertyNotFoundException.html" title="class in javax.el">PropertyNotFoundException</A></CODE> - if the given (base, property) pair     is handled by this <code>ELResolver</code> but the specified     variable or property does not exist.<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 abstract <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>Returns information about the set of variables or properties that  can be resolved for the given <code>base</code> object. One use for this method is to assist tools in auto-completion. <p>If the <code>base</code> parameter is <code>null</code>, the  resolver must enumerate the list of top-level variables it can  resolve.</p> <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>, in no guaranteed  order. In the case of primitive types such as <code>int</code>, the  value <code>null</code> must be returned. This is to prevent the  useless iteration through all possible primitive values. A  return value of <code>null</code> indicates that this resolver does  not handle the given <code>base</code> object or that the results  are too complex to represent with this method and the  <A HREF="../../javax/el/ELResolver.html#getCommonPropertyType(javax.el.ELContext, java.lang.Object)"><CODE>getCommonPropertyType(javax.el.ELContext, java.lang.Object)</CODE></A> method should be used instead.</p> <p>Each <code>FeatureDescriptor</code> will contain information about a single variable or property. In addition to the standard properties, the <code>FeatureDescriptor</code> must have two named attributes (as set by the <code>setValue</code> method): <ul>   <li><A HREF="../../javax/el/ELResolver.html#TYPE"><CODE>TYPE</CODE></A> - The value of this named attribute must be        an instance of <code>java.lang.Class</code> and specify the        runtime type of the variable or property.</li>   <li><A HREF="../../javax/el/ELResolver.html#RESOLVABLE_AT_DESIGN_TIME"><CODE>RESOLVABLE_AT_DESIGN_TIME</CODE></A> - The value of this        named attribute must be an instance of        <code>java.lang.Boolean</code> and indicates whether it is safe        to attempt to resolve this property at design-time. For        instance, it may be unsafe to attempt a resolution at design        time if the <code>ELResolver</code> needs access to a resource        that is only available at runtime and no acceptable simulated        value can be provided.</li> </ul></p> <p>The caller should be aware that the <code>Iterator</code>  returned might iterate through a very large or even infinitely large  set of properties. Care should be taken by the caller to not get  stuck in an infinite loop.</p> <p>This is a "best-effort" list.  Not all <code>ELResolver</code>s will return completely accurate results, but all must be callable at both design-time and runtime (i.e. whether or not <code>Beans.isDesignTime()</code> returns <code>true</code>), without causing errors.</p> <p>The <code>propertyResolved</code> property of the  <code>ELContext</code> is not relevant to this method. The results of all <code>ELResolver</code>s are concatenated in the case of composite resolvers.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The base object whose set of valid properties is to     be enumerated, or <code>null</code> to enumerate the set of     top-level variables that this resolver can evaluate.<DT><B>Returns:</B><DD>An <code>Iterator</code> containing zero or more (possibly     infinitely more) <code>FeatureDescriptor</code> objects, or      <code>null</code> if this resolver does not handle the given      <code>base</code> object or that the results are too complex to      represent with this method<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 abstract <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>Returns the most general type that this resolver accepts for the <code>property</code> argument, given a <code>base</code> object. One use for this method is to assist tools in auto-completion. <p>This assists tools in auto-completion and also provides a  way to express that the resolver accepts a primitive value,  such as an integer index into an array. For example, the  <A HREF="../../javax/el/ArrayELResolver.html" title="class in javax.el"><CODE>ArrayELResolver</CODE></A> will accept any <code>int</code> as a  <code>property</code>, so the return value would be  <code>Integer.class</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The context of this evaluation.<DD><CODE>base</CODE> - The base object to return the most general property     type for, or <code>null</code> to enumerate the set of     top-level variables that this resolver can evaluate.<DT><B>Returns:</B><DD><code>null</code> if this <code>ELResolver</code> does not     know how to handle the given <code>base</code> object; otherwise     <code>Object.class</code> if any type of <code>property</code>     is accepted; otherwise the most general <code>property</code>     type accepted for the given <code>base</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/ELException.html" title="class in javax.el"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../javax/el/Expression.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/ELResolver.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="ELResolver.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="#field_summary">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;<A HREF="#field_detail">FIELD</A>&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 + -
显示快捷键?