- java.lang.Object
-
- javax.faces.event.MethodExpressionActionListener
-
- All Implemented Interfaces:
- EventListener, StateHolder, ActionListener, FacesListener
public class MethodExpressionActionListener extends Object implements ActionListener, StateHolder
MethodExpressionActionListener is an
ActionListener
that wraps aMethodExpression
. When it receives aActionEvent
, it executes a method on an object identified by theMethodExpression
.
-
-
Field Summary
-
Fields inherited from interface javax.faces.event.ActionListener
TO_FLOW_DOCUMENT_ID_ATTR_NAME
-
-
Constructor Summary
Constructors Constructor and Description MethodExpressionActionListener()
MethodExpressionActionListener(MethodExpression methodExpressionOneArg)
Construct aValueChangeListener
that contains aMethodExpression
.MethodExpressionActionListener(MethodExpression methodExpressionOneArg, MethodExpression methodExpressionZeroArg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
isTransient()
If true, the Object implementing this interface must not participate in state saving or restoring.void
processAction(ActionEvent actionEvent)
Call through to theMethodExpression
passed in our constructor.void
restoreState(FacesContext context, Object state)
Both
MethodExpression
instances described in the constructor must be restored.Object
saveState(FacesContext context)
Both
MethodExpression
instances described in the constructor must be saved.void
setTransient(boolean newTransientValue)
Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
-
-
-
Constructor Detail
-
MethodExpressionActionListener
public MethodExpressionActionListener()
-
MethodExpressionActionListener
public MethodExpressionActionListener(MethodExpression methodExpressionOneArg)
Construct a
ValueChangeListener
that contains aMethodExpression
. To accomodate method expression targets that take no arguments instead of taking anActionEvent
argument, the implementation of this class must take the argumentmethodExpressionOneArg
, extract its expression string, and create anotherMethodExpression
whose expected param types match those of a zero argument method. The usage requirements for both of theseMethodExpression
instances are described inprocessAction(javax.faces.event.ActionEvent)
.- Parameters:
methodExpressionOneArg
- aMethodExpression
that points to a method that returnsvoid
and takes a single argument of typeActionEvent
.
-
MethodExpressionActionListener
public MethodExpressionActionListener(MethodExpression methodExpressionOneArg, MethodExpression methodExpressionZeroArg)
-
-
Method Detail
-
processAction
public void processAction(ActionEvent actionEvent) throws AbortProcessingException
Call through to the
MethodExpression
passed in our constructor. First, try to invoke theMethodExpression
passed to the constructor of this instance, passing the argumentActionEvent
as the argument. If aMethodNotFoundException
is thrown, call to the zero argumentMethodExpression
derived from theMethodExpression
passed to the constructor of this instance.If that fails for any reason, throw anAbortProcessingException
, including the cause of the failure.- Specified by:
processAction
in interfaceActionListener
- Parameters:
actionEvent
- TheActionEvent
that has occurred- Throws:
NullPointerException
AbortProcessingException
- Signal the JavaServer Faces implementation that no further processing on the current event should be performed
-
saveState
public Object saveState(FacesContext context)
Both
MethodExpression
instances described in the constructor must be saved.- Specified by:
saveState
in interfaceStateHolder
-
restoreState
public void restoreState(FacesContext context, Object state)
Both
MethodExpression
instances described in the constructor must be restored.- Specified by:
restoreState
in interfaceStateHolder
-
isTransient
public boolean isTransient()
Description copied from interface:StateHolder
If true, the Object implementing this interface must not participate in state saving or restoring.
- Specified by:
isTransient
in interfaceStateHolder
-
setTransient
public void setTransient(boolean newTransientValue)
Description copied from interface:StateHolder
Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.
- Specified by:
setTransient
in interfaceStateHolder
- Parameters:
newTransientValue
- boolean passtrue
if this Object will not participate in state saving or restoring, otherwise passfalse
.
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/faces/event/MethodExpressionActionListener.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.