96 * |
96 * |
97 * @author Attila Szegedi |
97 * @author Attila Szegedi |
98 */ |
98 */ |
99 class SimpleDynamicMethod extends SingleDynamicMethod { |
99 class SimpleDynamicMethod extends SingleDynamicMethod { |
100 private final MethodHandle target; |
100 private final MethodHandle target; |
|
101 private final boolean constructor; |
101 |
102 |
102 /** |
103 /** |
103 * Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle |
104 * Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle |
104 * signature. |
105 * signature. |
105 * |
106 * |
106 * @param target the target method handle |
107 * @param target the target method handle |
107 * @param clazz the class declaring the method |
108 * @param clazz the class declaring the method |
108 * @param name the simple name of the method |
109 * @param name the simple name of the method |
109 */ |
110 */ |
110 SimpleDynamicMethod(final MethodHandle target, final Class<?> clazz, final String name) { |
111 SimpleDynamicMethod(final MethodHandle target, final Class<?> clazz, final String name) { |
|
112 this(target, clazz, name, false); |
|
113 } |
|
114 |
|
115 /** |
|
116 * Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle |
|
117 * signature. |
|
118 * |
|
119 * @param target the target method handle |
|
120 * @param clazz the class declaring the method |
|
121 * @param name the simple name of the method |
|
122 * @param constructor does this represent a constructor? |
|
123 */ |
|
124 SimpleDynamicMethod(final MethodHandle target, final Class<?> clazz, final String name, final boolean constructor) { |
111 super(getName(target, clazz, name)); |
125 super(getName(target, clazz, name)); |
112 this.target = target; |
126 this.target = target; |
|
127 this.constructor = constructor; |
113 } |
128 } |
114 |
129 |
115 private static String getName(final MethodHandle target, final Class<?> clazz, final String name) { |
130 private static String getName(final MethodHandle target, final Class<?> clazz, final String name) { |
116 return getMethodNameWithSignature(target.type(), getClassAndMethodName(clazz, name)); |
131 return getMethodNameWithSignature(target.type(), getClassAndMethodName(clazz, name)); |
117 } |
132 } |