elcontext.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 533 行 · 第 1/2 页
HTML
533 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_14) on Mon Jan 28 05:47:05 PST 2008 --><TITLE>ELContext (Java EE 5)</TITLE><META NAME="keywords" CONTENT="javax.el.ELContext class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="ELContext (Java EE 5)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" 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_top_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/CompositeELResolver.html" title="class in javax.el"><B>PREV CLASS</B></A> <A HREF="../../javax/el/ELContextEvent.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/ELContext.html" target="_top"><B>FRAMES</B></A> <A HREF="ELContext.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_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.el</FONT><BR>Class ELContext</H2><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>javax.el.ELContext</B></PRE><HR><DL><DT><PRE>public abstract class <B>ELContext</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL></PRE><P>Context information for expression evaluation. <p>To evaluate an <A HREF="../../javax/el/Expression.html" title="class in javax.el"><CODE>Expression</CODE></A>, an <code>ELContext</code> must be provided. The <code>ELContext</code> holds: <ul> <li>a reference to the base <A HREF="../../javax/el/ELResolver.html" title="class in javax.el"><CODE>ELResolver</CODE></A> that will be consulted to resolve model objects and their properties</li> <li>a reference to <A HREF="../../javax/el/FunctionMapper.html" title="class in javax.el"><CODE>FunctionMapper</CODE></A> that will be used to resolve EL Functions. <li>a reference to <A HREF="../../javax/el/VariableMapper.html" title="class in javax.el"><CODE>VariableMapper</CODE></A> that will be used to resolve EL Variables. <li>a collection of all the relevant context objects for use by <code>ELResolver</code>s</li> <li>state information during the evaluation of an expression, such as whether a property has been resolved yet</li> </ul></p> <p>The collection of context objects is necessary because each <code>ELResolver</code> may need access to a different context object. For example, JSP and Faces resolvers need access to a <A HREF="../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp"><CODE>JspContext</CODE></A> and a <A HREF="../../javax/faces/context/FacesContext.html" title="class in javax.faces.context"><CODE>FacesContext</CODE></A>, respectively.</p> <p>Creation of <code>ELContext</code> objects is controlled through the underlying technology. For example, in JSP the <code>JspContext.getELContext()</code> factory method is used. Some technologies provide the ability to add an <A HREF="../../javax/el/ELContextListener.html" title="interface in javax.el"><CODE>ELContextListener</CODE></A> so that applications and frameworks can ensure their own context objects are attached to any newly created <code>ELContext</code>.</p> <p>Because it stores state during expression evaluation, an <code>ELContext</code> object is not thread-safe. Care should be taken to never share an <code>ELContext</code> instance between two or more threads.</p><P><P><DL><DT><B>Since:</B></DT> <DD>JSP 2.1</DD><DT><B>See Also:</B><DD><A HREF="../../javax/el/ELContextListener.html" title="interface in javax.el"><CODE>ELContextListener</CODE></A>, <A HREF="../../javax/el/ELContextEvent.html" title="class in javax.el"><CODE>ELContextEvent</CODE></A>, <A HREF="../../javax/el/ELResolver.html" title="class in javax.el"><CODE>ELResolver</CODE></A>, <A HREF="../../javax/el/FunctionMapper.html" title="class in javax.el"><CODE>FunctionMapper</CODE></A>, <A HREF="../../javax/el/VariableMapper.html" title="class in javax.el"><CODE>VariableMapper</CODE></A>, <A HREF="../../javax/servlet/jsp/JspContext.html" title="class in javax.servlet.jsp"><CODE>JspContext</CODE></A></DL><HR><P><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../javax/el/ELContext.html#ELContext()">ELContext</A></B>()</CODE><BR> </TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#getContext(java.lang.Class)">getContext</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> key)</CODE><BR> Returns the context object associated with the given key.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../javax/el/ELResolver.html" title="class in javax.el">ELResolver</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#getELResolver()">getELResolver</A></B>()</CODE><BR> Retrieves the <code>ELResolver</code> associated with this context.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../javax/el/FunctionMapper.html" title="class in javax.el">FunctionMapper</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#getFunctionMapper()">getFunctionMapper</A></B>()</CODE><BR> Retrieves the <code>FunctionMapper</code> associated with this <code>ELContext</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#getLocale()">getLocale</A></B>()</CODE><BR> Get the <code>Locale</code> stored by a previous invocation to <A HREF="../../javax/el/ELContext.html#setLocale(java.util.Locale)"><CODE>setLocale(java.util.Locale)</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract <A HREF="../../javax/el/VariableMapper.html" title="class in javax.el">VariableMapper</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#getVariableMapper()">getVariableMapper</A></B>()</CODE><BR> Retrieves the <code>VariableMapper</code> associated with this <code>ELContext</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#isPropertyResolved()">isPropertyResolved</A></B>()</CODE><BR> Returns whether an <A HREF="../../javax/el/ELResolver.html" title="class in javax.el"><CODE>ELResolver</CODE></A> has successfully resolved a given (base, property) pair.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#putContext(java.lang.Class, java.lang.Object)">putContext</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Class.html" title="class or interface in java.lang">Class</A> key, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> contextObject)</CODE><BR> Associates a context object with this <code>ELContext</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#setLocale(java.util.Locale)">setLocale</A></B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Locale.html" title="class or interface in java.util">Locale</A> locale)</CODE><BR> Set the <code>Locale</code> for this instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/el/ELContext.html#setPropertyResolved(boolean)">setPropertyResolved</A></B>(boolean resolved)</CODE><BR> Called to indicate that a <code>ELResolver</code> has successfully resolved a given (base, property) pair.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<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></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?