< prev index next >

## src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java

Print this page

      24  */
      25
      26 package jdk.nashorn.api.tree;
      27
      28 import java.util.List;
      29
      30 /**
      31  * A tree node for <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-function-defining-expressions">function expressions</a> including <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions">arrow functions</a>.
      32  *
      33  * For example:
      34  * <pre>
      35  *   <em>var</em> func = <em>function</em>
      36  *      ( <em>parameters</em> )
      37  *      <em>body</em>
      38  * </pre>
      39  *
      40  * <pre>
      41  *   <em>var</em> func = <em>(x) =&gt; x+1</em>
      42  * </pre>
      43  *

      44  * @since 9
      45  */

      46 public interface FunctionExpressionTree extends ExpressionTree {
      47     /**
      48      * Returns the name of the function being declared.
      49      *
      50      * @return name the function declared
      51      */
      52     IdentifierTree getName();
      53
      54     /**
      55      * Returns the parameters of this function.
      56      *
      57      * @return the list of parameters
      58      */
      59     List<? extends ExpressionTree> getParameters();
      60
      61     /**
      62      * Returns the body of this function. This may be a {@link BlockTree} when this
      63      * function has a block body. This is an {@link ExpressionTree} when the function body
      64      * is a concise expression as in an expression arrow, or in an expression closure.
      65      *
      24  */
      25
      26 package jdk.nashorn.api.tree;
      27
      28 import java.util.List;
      29
      30 /**
      31  * A tree node for <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-function-defining-expressions">function expressions</a> including <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions">arrow functions</a>.
      32  *
      33  * For example:
      34  * <pre>
      35  *   <em>var</em> func = <em>function</em>
      36  *      ( <em>parameters</em> )
      37  *      <em>body</em>
      38  * </pre>
      39  *
      40  * <pre>
      41  *   <em>var</em> func = <em>(x) =&gt; x+1</em>
      42  * </pre>
      43  *
      44  * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool
      45  * are deprecated with the intent to remove them in a future release.
      46  *
      47  * @since 9
      48  */
      49 @Deprecated(since="11", forRemoval=true)
      50 public interface FunctionExpressionTree extends ExpressionTree {
      51     /**
      52      * Returns the name of the function being declared.
      53      *
      54      * @return name the function declared
      55      */
      56     IdentifierTree getName();
      57
      58     /**
      59      * Returns the parameters of this function.
      60      *
      61      * @return the list of parameters
      62      */
      63     List<? extends ExpressionTree> getParameters();
      64
      65     /**
      66      * Returns the body of this function. This may be a {@link BlockTree} when this
      67      * function has a block body. This is an {@link ExpressionTree} when the function body
      68      * is a concise expression as in an expression arrow, or in an expression closure.
      69      *

< prev index next >