Class MethodBindingMethodExpressionAdapter
- All Implemented Interfaces:
StateHolder,Serializable
public class MethodBindingMethodExpressionAdapter extends MethodBinding implements StateHolder, Serializable
Wrap a MethodExpression instance and expose it as a MethodBinding
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description MethodBindingMethodExpressionAdapter()MethodBindingMethodExpressionAdapter(jakarta.el.MethodExpression methodExpression) -
Method Summary
Modifier and Type Method Description booleanequals(Object other)StringgetExpressionString()Return the (possiblynull) expression String, with leading and trailing delimiters, from which thisMethodBindingwas built.Class<?>getType(FacesContext context)Return the Java class representing the return type from the method identified by this method binding expression.jakarta.el.MethodExpressiongetWrapped()inthashCode()Objectinvoke(FacesContext context, Object[] params)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 specifiedFacesContext.booleanisTransient()If true, the Object implementing this interface must not participate in state saving or restoring.voidrestoreState(FacesContext context, Object state)Perform any processing required to restore the state from the entries in the state Object.ObjectsaveState(FacesContext context)Gets the state of the instance as aSerializableObject.voidsetTransient(boolean tranzient)Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
-
Constructor Details
-
MethodBindingMethodExpressionAdapter
public MethodBindingMethodExpressionAdapter() -
MethodBindingMethodExpressionAdapter
public MethodBindingMethodExpressionAdapter(jakarta.el.MethodExpression methodExpression)
-
-
Method Details
-
invoke
public Object invoke(FacesContext context, Object[] params) throws EvaluationException, MethodNotFoundExceptionDescription copied from class:MethodBindingReturn 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.- Specified by:
invokein classMethodBinding- Parameters:
context-FacesContextfor the current requestparams- Array of parameters to be passed to the called method, ornullfor no parameters- Returns:
- the result of the invocation
- Throws:
EvaluationException- if an exception is thrown by the called method (the thrown exception must be included as thecauseproperty of this exception)MethodNotFoundException- if no suitable method can be found
-
getType
Description copied from class:MethodBindingReturn the Java class representing the return type from the method identified by this method binding expression.
- Specified by:
getTypein classMethodBinding- Parameters:
context-FacesContextfor the current request- Returns:
- the type of the return value
- Throws:
MethodNotFoundException- if no suitable method can be found
-
getExpressionString
Description copied from class:MethodBindingReturn the (possibly
null) expression String, with leading and trailing delimiters, from which thisMethodBindingwas built. The default implementation returnsnull.- Overrides:
getExpressionStringin classMethodBinding- Returns:
- the expression string
-
equals
-
hashCode
public int hashCode() -
isTransient
public boolean isTransient()Description copied from interface:StateHolderIf true, the Object implementing this interface must not participate in state saving or restoring.
- Specified by:
isTransientin interfaceStateHolder- Returns:
trueif transient,falseotherwise.
-
setTransient
public void setTransient(boolean tranzient)Description copied from interface:StateHolderDenotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
- Specified by:
setTransientin interfaceStateHolder- Parameters:
tranzient- boolean passtrueif this Object will not participate in state saving or restoring, otherwise passfalse.
-
saveState
Description copied from interface:StateHolderGets the state of the instance as a
SerializableObject.If the class that implements this interface has references to instances that implement StateHolder (such as a
UIComponentwith event handlers, validators, etc.) this method must call theStateHolder.saveState(jakarta.faces.context.FacesContext)method on all those instances as well. This method must not save the state of children and facets. That is done via theStateManagerThis method must not alter the state of the implementing object. In other words, after executing this code:
Object state = component.saveState(facesContext);componentshould be the same as before executing it.The return from this method must be
Serializable- Specified by:
saveStatein interfaceStateHolder- Parameters:
context- the Faces context.- Returns:
- the saved state.
-
restoreState
Description copied from interface:StateHolderPerform 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
UIComponentwith event handlers, validators, etc.) this method must call theStateHolder.restoreState(jakarta.faces.context.FacesContext, java.lang.Object)method on all those instances as well.If the
stateargument isnull, take no action and return.- Specified by:
restoreStatein interfaceStateHolder- Parameters:
context- the Faces context.state- the state.
-
getWrapped
public jakarta.el.MethodExpression getWrapped()
-