软件包  jdk.nashorn.api.tree

Interface FunctionExpressionTree

  • All Superinterfaces:
    ExpressionTree

    @Deprecated(since="11",
                forRemoval=true)
    public interface FunctionExpressionTree
    extends ExpressionTree
    Deprecated, for removal: This API element is subject to removal in a future version.
    Nashorn JavaScript script engine and APIs, and the jjs tool are deprecated with the intent to remove them in a future release.
    function expressions的树节点,包括arrow functions 例如:
      var func = function
          ( parameters )
          body 
      var func = (x) => x+1 
    从以下版本开始:
    9
    • 嵌套类汇总

      • Nested classes/interfaces declared in interface jdk.nashorn.api.tree.

        Tree.Kind
    • 方法摘要

      所有方法  实例方法 抽象方法  弃用的方法 
      变量和类型 方法 描述
      getBody()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      返回此函数的主体。
      IdentifierTree getName()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      返回正在声明的函数的名称。
      List<? extends ExpressionTree> getParameters()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      返回此函数的参数。
      boolean isArrow()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      这是箭头功能吗?
      boolean isGenerator()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      这是发电机功能吗?
      boolean isStrict()
      不推荐使用,要删除:此API元素将在以后的版本中删除。
      这是一个严格的功能吗?
    • 方法详细信息

      • getName

        IdentifierTree getName()
        Deprecated, for removal: This API element is subject to removal in a future version.
        返回正在声明的函数的名称。
        结果
        命名声明的函数
      • getParameters

        List<? extends ExpressionTree> getParameters()
        Deprecated, for removal: This API element is subject to removal in a future version.
        返回此函数的参数。
        结果
        参数列表
      • getBody

         getBody()
        Deprecated, for removal: This API element is subject to removal in a future version.
        返回此函数的主体。 当此函数具有块体时,这可能是BlockTree 当函数体是表达式箭头或表达式闭包中的简洁表达式时,这是ExpressionTree
        结果
        这个功能的主体
      • isStrict

        boolean isStrict()
        Deprecated, for removal: This API element is subject to removal in a future version.
        这是一个严格的功能吗?
        结果
        如果此功能严格,则为true
      • isArrow

        boolean isArrow()
        Deprecated, for removal: This API element is subject to removal in a future version.
        这是箭头功能吗?
        结果
        如果这是箭头函数,则为true
      • isGenerator

        boolean isGenerator()
        Deprecated, for removal: This API element is subject to removal in a future version.
        这是发电机功能吗?
        结果
        如果这是生成器函数,则为true