Top Description Fields Constructors Methods
com.sun.faces.application

public Class MethodExpressionMethodBindingAdapter

extends MethodExpression
implements Serializable, StateHolder
Class Inheritance
All Implemented Interfaces
javax.faces.component.StateHolder, java.io.Serializable
Static Imports
com.sun.faces.util.Util.isAnyNull, .Util.loadClass2, .Util.newInstance

Wrap a MethodBinding instance and expose it as a MethodExpression.

Field Summary

Modifier and TypeField and Description
private MethodBinding
binding

Deprecated as a consequence of MethodBinding being deprecated.
private transient MethodInfo
private static final long
private boolean

Constructor Summary

AccessConstructor and Description
public
public
MethodExpressionMethodBindingAdapter(MethodBinding binding)

Deprecated as a consequence of MethodBinding being deprecated.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the Object to test for equality.
other
)

Implements abstract javax.el.Expression.equals.

Determines whether the specified object is equal to this Expression.
public String
public String
getExpressionString()

Implements abstract javax.el.Expression.getExpressionString.

Returns the original String used to create this Expression, unmodified.
public MethodInfo
getMethodInfo(ELContext
The context of this evaluation
context
)

Implements abstract javax.el.MethodExpression.getMethodInfo.

Evaluates the expression relative to the provided context, and returns information about the actual referenced method.
public MethodBinding
getWrapped()

Deprecated as a consequence of MethodBinding being deprecated.
public int
hashCode()

Implements abstract javax.el.Expression.hashCode.

Returns the hash code for this Expression.
public Object
invoke(ELContext
The context of this evaluation.
context
,
Object[]
The parameters to pass to the method, or null if no parameters.
params
)

Implements abstract javax.el.MethodExpression.invoke.

If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature.
public boolean
isLiteralText()

Implements abstract javax.el.Expression.isLiteralText.

Returns whether this expression was created from only literal text.
public boolean
isTransient()

Implements javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

public void
restoreState(FacesContext
the Faces context.
context
,
Object
the state.
state
)

Implements javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

public Object
saveState(FacesContext
the Faces context.
context
)

Implements javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

public void
setTransient(boolean
boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.
newTransientMethod
)

Implements javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Inherited from javax.el.MethodExpression:
isParametersProvidedisParmetersProvided

Field Detail

bindingback to summary
private MethodBinding binding

Deprecated

as a consequence of MethodBinding being deprecated. See corresponding docs for further information.

infoback to summary
private transient MethodInfo info
serialVersionUIDback to summary
private static final long serialVersionUID
tranzientback to summary
private boolean tranzient

Constructor Detail

MethodExpressionMethodBindingAdapterback to summary
public MethodExpressionMethodBindingAdapter()
MethodExpressionMethodBindingAdapterback to summary
public MethodExpressionMethodBindingAdapter(MethodBinding binding)

Deprecated

as a consequence of MethodBinding being deprecated. See corresponding docs for further information.

Method Detail

equalsback to summary
public boolean equals(Object other)

Implements abstract javax.el.Expression.equals.

Doc from javax.el.Expression.equals.

Determines whether the specified object is equal to this Expression.

The result is true if and only if the argument is not null, is an Expression object that is the of the same type (ValueExpression or MethodExpression), and has an identical parsed representation.

Note that two expressions can be equal if their expression Strings are different. For example, ${fn1:foo()} and ${fn2:foo()} are equal if their corresponding FunctionMappers mapped fn1:foo and fn2:foo to the same method.

Parameters
other:Object

the Object to test for equality.

Returns:boolean

true if obj equals this Expression; false otherwise.

getDelimiterSyntaxback to summary
public String getDelimiterSyntax()
getExpressionStringback to summary
public String getExpressionString()

Implements abstract javax.el.Expression.getExpressionString.

Doc from javax.el.Expression.getExpressionString.

Returns the original String used to create this Expression, unmodified.

This is used for debugging purposes but also for the purposes of comparison (e.g. to ensure the expression in a configuration file has not changed).

This method does not provide sufficient information to re-create an expression. Two different expressions can have exactly the same expression string but different function mappings. Serialization should be used to save and restore the state of an Expression.

Returns:String

The original expression String.

getMethodInfoback to summary
public MethodInfo getMethodInfo(ELContext context) throws ELException

Implements abstract javax.el.MethodExpression.getMethodInfo.

Doc from javax.el.MethodExpression.getMethodInfo.

Evaluates the expression relative to the provided context, and returns information about the actual referenced method.

Parameters
context:ELContext

The context of this evaluation

Returns:MethodInfo

an instance of MethodInfo containing information about the method the expression evaluated to.

Exceptions
ELException:
if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
getWrappedback to summary
public MethodBinding getWrapped()

Deprecated

as a consequence of MethodBinding being deprecated. See corresponding docs for further information.

hashCodeback to summary
public int hashCode()

Implements abstract javax.el.Expression.hashCode.

Doc from javax.el.Expression.hashCode.

Returns the hash code for this Expression.

See the note in the equals method on how two expressions can be equal if their expression Strings are different. Recall that if two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result. Implementations must take special note and implement hashCode correctly.

Returns:int

The hash code for this Expression.

invokeback to summary
public Object invoke(ELContext context, Object[] params) throws ELException

Implements abstract javax.el.MethodExpression.invoke.

Doc from javax.el.MethodExpression.invoke.

If a String literal is specified as the expression, returns the String literal coerced to the expected return type of the method signature. 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.18 Type Conversion" of the EL specification). If not a String literal, evaluates the expression relative to the provided context, invokes the method that was found using the supplied parameters, and returns the result of the method invocation. Any parameters passed to this method is ignored if isLiteralText() or isParmetersProvided() is true.

Parameters
context:ELContext

The context of this evaluation.

params:Object[]

The parameters to pass to the method, or null if no parameters.

Returns:Object

the result of the method invocation (null if the method has a void return type).

Exceptions
ELException:
  • if a String literal is specified and expectedReturnType of the MethodExpression is void or if the coercion of the String literal to the expectedReturnType yields an error (see Section "1.18 Type Conversion").
  • if an exception was thrown while performing property or variable resolution. The thrown exception must be included as the cause property of this exception, if available. If the exception thrown is an InvocationTargetException, extract its cause and pass it to the ELException constructor.
isLiteralTextback to summary
public boolean isLiteralText()

Implements abstract javax.el.Expression.isLiteralText.

Doc from javax.el.Expression.isLiteralText.

Returns whether this expression was created from only literal text.

This method must return true if and only if the expression string this expression was created from contained no unescaped EL delimeters (${...} or #{...}).

Returns:boolean

true if this expression was created from only literal text; false otherwise.

isTransientback to summary
public boolean isTransient()

Implements javax.faces.component.StateHolder.isTransient.

Doc from javax.faces.component.StateHolder.isTransient.

If true, the Object implementing this interface must not participate in state saving or restoring.

Returns:boolean

true if transient, false otherwise.

restoreStateback to summary
public void restoreState(FacesContext context, Object state)

Implements javax.faces.component.StateHolder.restoreState.

Doc from javax.faces.component.StateHolder.restoreState.

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the restoreState method on all those instances as well.

If the state argument is null, take no action and return.

Parameters
context:FacesContext

the Faces context.

state:Object

the state.

saveStateback to summary
public Object saveState(FacesContext context)

Implements javax.faces.component.StateHolder.saveState.

Doc from javax.faces.component.StateHolder.saveState.

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the saveState method on all those instances as well. This method must not save the state of children and facets. That is done via the javax.faces.application.StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:


Object state = component.saveState(facesContext);

component should be the same as before executing it.

The return from this method must be Serializable

Parameters
context:FacesContext

the Faces context.

Returns:Object

the saved state.

setTransientback to summary
public void setTransient(boolean newTransientMethod)

Implements javax.faces.component.StateHolder.setTransient.

Doc from javax.faces.component.StateHolder.setTransient.

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Parameters
newTransientMethod:boolean

boolean pass true if this Object will not participate in state saving or restoring, otherwise pass false.