20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jshell;
27
28 import java.util.Collection;
29 import jdk.jshell.Key.MethodKey;
30
31 /**
32 * Snippet for a method definition.
33 * The Kind is {@link jdk.jshell.Snippet.Kind#METHOD}.
34 * <p>
35 * <code>MethodSnippet</code> is immutable: an access to
36 * any of its methods will always return the same result.
37 * and thus is thread-safe.
38 *
39 * @since 9
40 * @jls 8.4: MethodDeclaration.
41 */
42 public class MethodSnippet extends DeclarationSnippet {
43
44 final String signature;
45 private String qualifiedParameterTypes;
46
47 MethodSnippet(MethodKey key, String userSource, Wrap guts,
48 String name, String signature, Wrap corralled,
49 Collection<String> declareReferences, Collection<String> bodyReferences,
50 DiagList syntheticDiags) {
51 super(key, userSource, guts, name, SubKind.METHOD_SUBKIND, corralled,
52 declareReferences, bodyReferences, syntheticDiags);
53 this.signature = signature;
54 }
55
56 /**
57 * A String representation of the parameter types of the method.
58 * @return a comma separated list of user entered parameter types for the
59 * method.
60 */
|
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package jdk.jshell;
27
28 import java.util.Collection;
29 import jdk.jshell.Key.MethodKey;
30
31 /**
32 * Snippet for a method definition.
33 * The Kind is {@link jdk.jshell.Snippet.Kind#METHOD}.
34 * <p>
35 * <code>MethodSnippet</code> is immutable: an access to
36 * any of its methods will always return the same result.
37 * and thus is thread-safe.
38 *
39 * @since 9
40 * @jls 8.4 Method Declarations
41 */
42 public class MethodSnippet extends DeclarationSnippet {
43
44 final String signature;
45 private String qualifiedParameterTypes;
46
47 MethodSnippet(MethodKey key, String userSource, Wrap guts,
48 String name, String signature, Wrap corralled,
49 Collection<String> declareReferences, Collection<String> bodyReferences,
50 DiagList syntheticDiags) {
51 super(key, userSource, guts, name, SubKind.METHOD_SUBKIND, corralled,
52 declareReferences, bodyReferences, syntheticDiags);
53 this.signature = signature;
54 }
55
56 /**
57 * A String representation of the parameter types of the method.
58 * @return a comma separated list of user entered parameter types for the
59 * method.
60 */
|