本文整理汇总了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));
}
示例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);
}
}
示例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");
}
示例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);
}
示例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);
}