本文整理汇总了Java中com.sun.source.tree.MemberReferenceTree.ReferenceMode.NEW属性的典型用法代码示例。如果您正苦于以下问题:Java ReferenceMode.NEW属性的具体用法?Java ReferenceMode.NEW怎么用?Java ReferenceMode.NEW使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.source.tree.MemberReferenceTree.ReferenceMode
的用法示例。
在下文中一共展示了ReferenceMode.NEW属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: needsConversionToLambda
/**
* Does this reference need to be converted to a lambda
* (i.e. var args need to be expanded or "super" is used)
*/
final boolean needsConversionToLambda() {
return interfaceParameterIsIntersectionType() ||
isSuper ||
needsVarArgsConversion() ||
isArrayOp() ||
isPrivateInOtherClass() ||
!receiverAccessible() ||
(tree.getMode() == ReferenceMode.NEW &&
tree.kind != ReferenceKind.ARRAY_CTOR &&
(tree.sym.owner.isLocal() || tree.sym.owner.isInner()));
}
示例3: needsConversionToLambda
/**
* Does this reference need to be converted to a lambda
* (i.e. var args need to be expanded or "super" is used)
*/
final boolean needsConversionToLambda() {
return interfaceParameterIsIntersectionType() ||
isSuper ||
needsVarArgsConversion() ||
isArrayOp() ||
isPrivateInOtherClass() ||
isProtectedInSuperClassOfEnclosingClassInOtherPackage() ||
!receiverAccessible() ||
(tree.getMode() == ReferenceMode.NEW &&
tree.kind != ReferenceKind.ARRAY_CTOR &&
(tree.sym.owner.isLocal() || tree.sym.owner.isInner()));
}
示例4: visitReference
@Override
public void visitReference(JCMemberReference tree) {
super.visitReference(tree);
if (tree.getMode() != ReferenceMode.NEW) {
return;
}
if (memberOfEnclosing(owner, state, tree.expr.type.tsym)) {
referencesOuter = true;
}
}