MethodBinding (Java EE 5)

Java EE API


javax.faces.el Class MethodBinding

java.lang.Object
  extended by javax.faces.el.MethodBinding

Deprecated. This has been replaced by MethodExpression.


MethodBinding 是一个对象,它可以对通过 ValueBinding 对方法绑定表达式的开头部分求值得到的实例调用任意公共方法。通过调用此 Web 应用程序的 javax.faces.application.Application 实例的 createMethodBinding() 方法,可以获得用于特定方法绑定表达式的不可变 MethodBinding

英文文档:

public abstract class MethodBinding
extends Object

MethodBinding is an object that can be used to call an arbitrary public method, on an instance that is acquired by evaluatng the leading portion of a method binding expression via a ValueBinding. An immutable MethodBinding for a particular method binding expression can be acquired by calling the createMethodBinding() method of the Application instance for this web application.


Constructor Summary
 
Method Summary
 String
abstract  Class
abstract  Object
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public MethodBinding()
英文文档:

MethodBinding

public MethodBinding()
Deprecated. 
Method Detail

abstract public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundException

相对于指定的 FacesContext,返回调用此方法绑定表达式所标识的方法,并传入指定参数所得的返回值(如果有)。

context 当前请求的 FacesContext
params 要传递给所调用方法的参数数组;如果没有参数,则为 null
ThrowsEvaluationException: 如果调用的方法抛出异常(抛出的异常必须作为此异常的 cause 属性包含在内)
ThrowsMethodNotFoundException: 如果没有找到合适的方法
ThrowsNullPointerException: 如果 contextnull
英文文档:

invoke

public abstract Object invoke(FacesContext context,
                              Object[] params)
                       throws EvaluationException,
                              MethodNotFoundException
Deprecated. 

Return the return value (if any) resulting from a call to the method identified by this method binding expression, passing it the specified parameters, relative to the specified FacesContext.

Parameters:
context - FacesContext for the current request
params - Array of parameters to be passed to the called method, or null for no parameters
Throws:
EvaluationException - if an exception is thrown by the called method (the thrown exception must be included as the cause property of this exception)
MethodNotFoundException - if no suitable method can be found
NullPointerException - if context is null

abstract public Class<T> getType(FacesContext context) throws MethodNotFoundException

返回表示此方法绑定表达式所标识方法的返回类型的 Java 类。

context 当前请求的 FacesContext
ThrowsMethodNotFoundException: 如果没有找到合适的方法
ThrowsNullPointerException: 如果 contextnull
英文文档:

getType

public abstract Class getType(FacesContext context)
                       throws MethodNotFoundException
Deprecated. 

Return the Java class representing the return type from the method identified by this method binding expression.

Parameters:
context - FacesContext for the current request
Throws:
MethodNotFoundException - if no suitable method can be found
NullPointerException - if context is null

public String getExpressionString()

返回据以构建此 MethodBinding 的表达式 String(可能为 null),带有前导分界符和尾部分界符。默认实现返回 null

英文文档:

getExpressionString

public String getExpressionString()
Deprecated. 

Return the (possibly null) expression String, with leading and trailing delimiters, from which this MethodBinding was built. The default implementation returns null.



Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!