javax.faces.component.ActionSource2 Maven / Gradle / Ivy
Show all versions of jakarta.faces-api Show documentation
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package javax.faces.component;
import javax.el.MethodExpression;
import javax.faces.event.ActionListener;
/**
*
* ActionSource2 extends {@link ActionSource} and provides a JavaBeans property
* analogous to the "action
" property on ActionSource
. The difference is
* the type of this property is a {@link MethodExpression} rather than a MethodBinding
.
* This allows the ActionSource
concept to leverage the new Unified EL API.
*
*
* @since 1.2
*/
public interface ActionSource2 extends ActionSource {
// -------------------------------------------------------------- Properties
/**
*
* Return the {@link MethodExpression} pointing at the application action to be invoked, if this
* {@link UIComponent} is activated by the user, during the Apply Request Values or
* Invoke Application phase of the request processing lifecycle, depending on the value
* of the immediate
property.
*
*
*
* Note that it's possible that the returned MethodExpression
is just a wrapper
* around a MethodBinding
instance whith was set by a call to
* {@link ActionSource#setAction}. This makes it possible for the default {@link ActionListener}
* to continue to work properly with older components.
*
*
* @return the action expression.
*/
public MethodExpression getActionExpression();
/**
*
* Set the {@link MethodExpression} pointing at the appication action to be invoked, if this
* {@link UIComponent} is activated by the user, during the Apply Request Values or
* Invoke Application phase of the request processing lifecycle, depending on the value
* of the immediate
property.
*
*
*
* Any method referenced by such an expression must be public, with a return type of
* String
, and accept no parameters.
*
*
* @param action The new method expression
*/
public void setActionExpression(MethodExpression action);
}