当前位置: 首页>>代码示例>>Java>>正文


Java ReferenceMode.INVOKE属性代码示例

本文整理汇总了Java中com.sun.source.tree.MemberReferenceTree.ReferenceMode.INVOKE属性的典型用法代码示例。如果您正苦于以下问题:Java ReferenceMode.INVOKE属性的具体用法?Java ReferenceMode.INVOKE怎么用?Java ReferenceMode.INVOKE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.source.tree.MemberReferenceTree.ReferenceMode的用法示例。


在下文中一共展示了ReferenceMode.INVOKE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: memberReferenceSuffix

JCExpression memberReferenceSuffix(int pos1, JCExpression t) {
    checkMethodReferences();
    mode = EXPR;
    List<JCExpression> typeArgs = null;
    if (token.kind == LT) {
        typeArgs = typeArguments(false);
    }
    Name refName;
    ReferenceMode refMode;
    if (token.kind == NEW) {
        refMode = ReferenceMode.NEW;
        refName = names.init;
        nextToken();
    } else {
        refMode = ReferenceMode.INVOKE;
        refName = ident();
    }
    return toP(F.at(t.getStartPosition()).Reference(refMode, refName, t, typeArgs));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:JavacParser.java

示例2: lambda

JCLambda lambda() {
    int prevPos = make.pos;
    try {
        make.at(tree);

        //body generation - this can be either a method call or a
        //new instance creation expression, depending on the member reference kind
        VarSymbol rcvr = addParametersReturnReceiver();
        JCExpression expr = (tree.getMode() == ReferenceMode.INVOKE)
                ? expressionInvoke(rcvr)
                : expressionNew();

        JCLambda slam = make.Lambda(params.toList(), expr);
        slam.targets = tree.targets;
        slam.type = tree.type;
        slam.pos = tree.pos;
        return slam;
    } finally {
        make.at(prevPos);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:LambdaToMethod.java

示例3: visitReference

@Override
public void visitReference(JCMemberReference tree) {
    printExpr(tree.expr);
    print(cs.spaceAroundMethodReferenceDoubleColon() ? " :: " : "::");
    if (tree.typeargs != null && !tree.typeargs.isEmpty()) {
        print("<");
        printExprs(tree.typeargs);
        print(">");
    }
    if (tree.getMode() == ReferenceMode.INVOKE) print(tree.name);
    else print("new");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:VeryPretty.java

示例4: memberReferenceQualifierResult

ResultInfo memberReferenceQualifierResult(JCMemberReference tree) {
    //if this is a constructor reference, the expected kind must be a type
    return new ResultInfo(tree.getMode() == ReferenceMode.INVOKE ? VAL | TYP : TYP, Type.noType);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:Attr.java

示例5: memberReferenceQualifierResult

ResultInfo memberReferenceQualifierResult(JCMemberReference tree) {
    //if this is a constructor reference, the expected kind must be a type
    return new ResultInfo(tree.getMode() == ReferenceMode.INVOKE ?
                          KindSelector.VAL_TYP : KindSelector.TYP,
                          Type.noType);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:6,代码来源:Attr.java


注:本文中的com.sun.source.tree.MemberReferenceTree.ReferenceMode.INVOKE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。