expressionfactory.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 501 行 · 第 1/2 页
HTML
501 行
<P><DD><DL></DL></DD></DL><HR><A NAME="newInstance(java.util.Properties)"><!-- --></A><H3>newInstance</H3><PRE>public static <A HREF="../../javax/el/ExpressionFactory.html" title="class in javax.el">ExpressionFactory</A> <B>newInstance</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Properties.html" title="class or interface in java.util">Properties</A> properties)</PRE><DL><DD><p>Create a new instance of a <code>ExpressionFactory</code>, with optional properties. This method uses the same lookup procedure as the one used in <code>newInstance()</code>. </p> <p> If the argument <code>properties</code> is not null, and if the implementation contains a constructor with a single parameter of type <code>java.util.Properties</code>, then the constructor is used to create the instance. </p> <p> Properties are optional and can be ignored by an implementation. </p> <p>The name of a property should start with "javax.el."</p> <p> The following are some suggested names for properties. <ul> <li>javax.el.cacheSize</li> </ul></p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>properties</CODE> - Properties passed to the implementation. If null, then no properties.</DL></DD></DL><HR><A NAME="createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)"><!-- --></A><H3>createValueExpression</H3><PRE>public abstract <A HREF="../../javax/el/ValueExpression.html" title="class in javax.el">ValueExpression</A> <B>createValueExpression</B>(<A HREF="../../javax/el/ELContext.html" title="class in javax.el">ELContext</A> context, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> expression, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?> expectedType)</PRE><DL><DD>Parses an expression into a <A HREF="../../javax/el/ValueExpression.html" title="class in javax.el"><CODE>ValueExpression</CODE></A> for later evaluation. Use this method for expressions that refer to values. <p>This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an <code>ELException</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The EL context used to parse the expression. The <code>FunctionMapper</code> and <code>VariableMapper</code> stored in the ELContext are used to resolve functions and variables found in the expression. They can be <code>null</code>, in which case functions or variables are not supported for this expression. The object returned must invoke the same functions and access the same variable mappings regardless of whether the mappings in the provided <code>FunctionMapper</code> and <code>VariableMapper</code> instances change between calling <code>ExpressionFactory.createValueExpression()</code> and any method on <code>ValueExpression</code>. <p> Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.</p><DD><CODE>expression</CODE> - The expression to parse<DD><CODE>expectedType</CODE> - The type the result of the expression will be coerced to after evaluation.<DT><B>Returns:</B><DD>The parsed expression<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> - Thrown if expectedType is null.<DD><CODE><A HREF="../../javax/el/ELException.html" title="class in javax.el">ELException</A></CODE> - Thrown if there are syntactical errors in the provided expression.</DL></DD></DL><HR><A NAME="createValueExpression(java.lang.Object, java.lang.Class)"><!-- --></A><H3>createValueExpression</H3><PRE>public abstract <A HREF="../../javax/el/ValueExpression.html" title="class in javax.el">ValueExpression</A> <B>createValueExpression</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> instance, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?> expectedType)</PRE><DL><DD>Creates a ValueExpression that wraps an object instance. This method can be used to pass any object as a ValueExpression. The wrapper ValueExpression is read only, and returns the wrapped object via its <code>getValue()</code> method, optionally coerced.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>instance</CODE> - The object instance to be wrapped.<DD><CODE>expectedType</CODE> - The type the result of the expression will be coerced to after evaluation. There will be no coercion if it is Object.class,<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> - Thrown if expectedType is null.</DL></DD></DL><HR><A NAME="createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[])"><!-- --></A><H3>createMethodExpression</H3><PRE>public abstract <A HREF="../../javax/el/MethodExpression.html" title="class in javax.el">MethodExpression</A> <B>createMethodExpression</B>(<A HREF="../../javax/el/ELContext.html" title="class in javax.el">ELContext</A> context, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> expression, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?> expectedReturnType, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?>[] expectedParamTypes)</PRE><DL><DD>Parses an expression into a <A HREF="../../javax/el/MethodExpression.html" title="class in javax.el"><CODE>MethodExpression</CODE></A> for later evaluation. Use this method for expressions that refer to methods. <p> If the expression is a String literal, a <code>MethodExpression </code> is created, which when invoked, returns the String literal, coerced to expectedReturnType. An ELException is thrown if expectedReturnType is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.16 Type Conversion"). </p> <p>This method should perform syntactic validation of the expression. If in doing so it detects errors, it should raise an <code>ELException</code>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>context</CODE> - The EL context used to parse the expression. The <code>FunctionMapper</code> and <code>VariableMapper</code> stored in the ELContext are used to resolve functions and variables found in the expression. They can be <code>null</code>, in which case functions or variables are not supported for this expression. The object returned must invoke the same functions and access the same variable mappings regardless of whether the mappings in the provided <code>FunctionMapper</code> and <code>VariableMapper</code> instances change between calling <code>ExpressionFactory.createMethodExpression()</code> and any method on <code>MethodExpression</code>. <p> Note that within the EL, the ${} and #{} syntaxes are treated identically. This includes the use of VariableMapper and FunctionMapper at expression creation time. Each is invoked if not null, independent of whether the #{} or ${} syntax is used for the expression.</p><DD><CODE>expression</CODE> - The expression to parse<DD><CODE>expectedReturnType</CODE> - The expected return type for the method to be found. After evaluating the expression, the <code>MethodExpression</code> must check that the return type of the actual method matches this type. Passing in a value of <code>null</code> indicates the caller does not care what the return type is, and the check is disabled.<DD><CODE>expectedParamTypes</CODE> - The expected parameter types for the method to be found. Must be an array with no elements if there are no parameters expected. It is illegal to pass <code>null</code>.<DT><B>Returns:</B><DD>The parsed expression<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/el/ELException.html" title="class in javax.el">ELException</A></CODE> - Thrown if there are syntactical errors in the provided expression.<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 paramTypes is <code>null</code>.</DL></DD></DL><HR><A NAME="coerceToType(java.lang.Object, java.lang.Class)"><!-- --></A><H3>coerceToType</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>coerceToType</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> obj, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A><?> targetType)</PRE><DL><DD>Coerces an object to a specific type according to the EL type conversion rules. <p>An <code>ELException</code> is thrown if an error results from applying the conversion rules. </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - The object to coerce.<DD><CODE>targetType</CODE> - The target type for the coercion.<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/el/ELException.html" title="class in javax.el">ELException</A></CODE> - thrown if an error results from applying the conversion rules.</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> </TD> <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></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/el/Expression.html" title="class in javax.el"><B>PREV CLASS</B></A> <A HREF="../../javax/el/FunctionMapper.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/ExpressionFactory.html" target="_top"><B>FRAMES</B></A> <A HREF="ExpressionFactory.html" target="_top"><B>NO FRAMES</B></A> <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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 + -
显示快捷键?