public abstract class MethodExpressionEventListener extends Object implements javax.faces.event.FacesListener, javax.faces.component.StateHolder
MethodExpressionEventListener is a FacesListener
that
wraps a MethodExpression
. When it receives a FacesEvent
, it executes a method on an object identified by the
MethodExpression
.
Modifier | Constructor and Description |
---|---|
protected |
MethodExpressionEventListener() |
protected |
MethodExpressionEventListener(javax.el.MethodExpression methodExpressionOneArg)
Construct a
FacesListener that contains a MethodExpression
.To accomodate method expression targets that take no arguments instead of taking a
FacesEvent argument, the implementation of this class must take the argument
methodExpressionOneArg , extract its expression string, and create another MethodExpression
whose expected param types match those of a zero argument method. |
protected |
MethodExpressionEventListener(javax.el.MethodExpression methodExprOneArg,
javax.el.MethodExpression methodExprZeroArg)
Construct a
FacesListener that contains a MethodExpression . |
Modifier and Type | Method and Description |
---|---|
boolean |
isTransient() |
void |
processEvent(javax.faces.event.FacesEvent event)
Call through to the
MethodExpression passed in our constructor. |
void |
restoreState(javax.faces.context.FacesContext context,
Object state)
Both |
Object |
saveState(javax.faces.context.FacesContext context)
Both |
void |
setTransient(boolean newTransientValue) |
protected MethodExpressionEventListener()
protected MethodExpressionEventListener(javax.el.MethodExpression methodExpressionOneArg)
Construct a FacesListener
that contains a MethodExpression
.To accomodate method expression targets that take no arguments instead of taking a
FacesEvent
argument, the implementation of this class must take the argument
methodExpressionOneArg
, extract its expression string, and create another MethodExpression
whose expected param types match those of a zero argument method. The usage requirements for both of these
MethodExpression
instances are described in processEvent(javax.faces.event.FacesEvent)
.
methodExpressionOneArg
- a MethodExpression
that points to a method that returns void
and
takes a single argument of type FacesEvent
.protected MethodExpressionEventListener(javax.el.MethodExpression methodExprOneArg, javax.el.MethodExpression methodExprZeroArg)
Construct a FacesListener
that contains a MethodExpression
.
methodExprOneArg
- methodExprZeroArg
- public void processEvent(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
Call through to the MethodExpression
passed in our constructor. First, try to invoke the MethodExpression
passed to the constructor of this
instance, passing the argument FacesEvent
as the argument. If a MethodNotFoundException
is thrown, call
to the zero argument MethodExpression
derived from the MethodExpression
passed to the
constructor of this instance. If that fails for any reason, throw an AbortProcessingException
, including the
cause of the failure.
NullPointerException
javax.faces.event.AbortProcessingException
public Object saveState(javax.faces.context.FacesContext context)
Both MethodExpression
instances described in the constructor must be saved.
saveState
in interface javax.faces.component.StateHolder
public void restoreState(javax.faces.context.FacesContext context, Object state)
Both MethodExpression
instances described in the constructor must be restored.
restoreState
in interface javax.faces.component.StateHolder
public boolean isTransient()
isTransient
in interface javax.faces.component.StateHolder
public void setTransient(boolean newTransientValue)
setTransient
in interface javax.faces.component.StateHolder
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.