forked from yuhailei1992/Java7SourceCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethodHandleInfo.java
More file actions
71 lines (63 loc) · 1.71 KB
/
MethodHandleInfo.java
File metadata and controls
71 lines (63 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.lang.invoke;
import java.lang.invoke.MethodHandleNatives.Constants;
//Not yet public: public
class MethodHandleInfo {
public static final int
REF_NONE = Constants.REF_NONE,
REF_getField = Constants.REF_getField,
REF_getStatic = Constants.REF_getStatic,
REF_putField = Constants.REF_putField,
REF_putStatic = Constants.REF_putStatic,
REF_invokeVirtual = Constants.REF_invokeVirtual,
REF_invokeStatic = Constants.REF_invokeStatic,
REF_invokeSpecial = Constants.REF_invokeSpecial,
REF_newInvokeSpecial = Constants.REF_newInvokeSpecial,
REF_invokeInterface = Constants.REF_invokeInterface;
private final Class<?> declaringClass;
private final String name;
private final MethodType methodType;
private final int referenceKind;
public MethodHandleInfo(MethodHandle mh) throws ReflectiveOperationException {
MemberName mn = mh.internalMemberName();
this.declaringClass = mn.getDeclaringClass();
this.name = mn.getName();
this.methodType = mn.getMethodType();
this.referenceKind = mn.getReferenceKind();
}
public Class<?> getDeclaringClass() {
return declaringClass;
}
public String getName() {
return name;
}
public MethodType getMethodType() {
return methodType;
}
public int getReferenceKind() {
return referenceKind;
}
}