src/jdk.compiler/share/classes/com/sun/source/tree/MemberReferenceTree.java
author rkennke
Fri, 12 Oct 2018 16:25:24 +0200
changeset 52107 0c1e44da019c
parent 47216 71c04702a3d5
permissions -rw-r--r--
8212053: A few more missing object equals barriers Reviewed-by: shade, zgu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     1
/*
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
     2
 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     4
 *
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    10
 *
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    15
 * accompanied this code).
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    16
 *
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    20
 *
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    23
 * questions.
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    24
 */
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    25
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    26
package com.sun.source.tree;
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    27
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    28
import java.util.List;
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    29
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    30
import javax.lang.model.element.Name;
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    31
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    32
/**
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    33
 * A tree node for a member reference expression.
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    34
 *
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    35
 * For example:
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    36
 * <pre>
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    37
 *   <em>expression</em> # <em>[ identifier | new ]</em>
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    38
 * </pre>
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    39
 *
12015
0c9d42e88feb 7144951: fix minor javadoc issues
jjg
parents: 11142
diff changeset
    40
 * @since 1.8
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    41
 */
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    42
public interface MemberReferenceTree extends ExpressionTree {
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    43
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    44
    /**
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    45
     * There are two kinds of member references: (i) method references and
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    46
     * (ii) constructor references
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    47
     */
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    48
    public enum ReferenceMode {
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    49
        /** enum constant for method references. */
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    50
        INVOKE,
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    51
        /** enum constant for constructor references. */
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    52
        NEW
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    53
    }
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    54
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    55
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    56
     * Returns the mode of the reference.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    57
     * @return the mode
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    58
     */
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    59
    ReferenceMode getMode();
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    60
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    61
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    62
     * Returns the qualifier expression for the reference.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    63
     * @return the qualifier expression
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    64
     */
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    65
    ExpressionTree getQualifierExpression();
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    66
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    67
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    68
     * Returns the name of the reference.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    69
     * @return the name
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    70
     */
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    71
    Name getName();
25287
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    72
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    73
    /**
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    74
     * Returns the type arguments for the reference.
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    75
     * @return the type arguments
d2440361b323 8046614: Fill in missing doc comments
jjg
parents: 20612
diff changeset
    76
     */
11142
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    77
    List<? extends ExpressionTree> getTypeArguments();
45d0ec1e7463 7115049: Add AST node for method references
mcimadamore
parents:
diff changeset
    78
}