-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathMethodHandle.php
More file actions
211 lines (193 loc) Β· 7.56 KB
/
MethodHandle.php
File metadata and controls
211 lines (193 loc) Β· 7.56 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
declare(strict_types=1);
namespace PHPJava\Packages\java\lang\invoke;
use PHPJava\Core\JavaClassInterface;
use PHPJava\Exceptions\NotImplementedException;
use PHPJava\Kernel\Types\Void_;
use PHPJava\Packages\java\lang\Object_;
// use PHPJava\Packages\java\util\_List;
/**
* The `MethodHandle` class was auto generated.
*
* @parent \PHPJava\Packages\java\lang\Object_
*/
class MethodHandle extends Object_ // implements _List
{
/**
* Makes an array-collecting method handle, which accepts a given number of positional arguments starting at a given position, and collects them into an array argument.
* Makes an array-collecting method handle, which accepts a given number of trailing positional arguments and collects them into an array argument.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#asCollector
* @param null|mixed $a
* @param null|mixed $b
* @param null|mixed $c
* @throws NotImplementedException
*/
public function asCollector($a = null, $b = null, $c = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Makes a fixed arity method handle which is otherwise equivalent to the current method handle.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#asFixedArity
* @param null|mixed $a
* @throws NotImplementedException
*/
public function asFixedArity($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Makes an array-spreading method handle, which accepts an array argument at a given position and spreads its elements as positional arguments in place of the array.
* Makes an array-spreading method handle, which accepts a trailing array argument and spreads its elements as positional arguments.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#asSpreader
* @param null|mixed $a
* @param null|mixed $b
* @param null|mixed $c
* @throws NotImplementedException
*/
public function asSpreader($a = null, $b = null, $c = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Produces an adapter method handle which adapts the type of the current method handle to a new type.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#asType
* @param null|mixed $a
* @throws NotImplementedException
*/
public function asType($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Makes a variable arity adapter which is able to accept any number of trailing positional arguments and collect them into an array argument.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#asVarargsCollector
* @param null|mixed $a
* @throws NotImplementedException
*/
public function asVarargsCollector($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Binds a value x to the first argument of a method handle, without invoking it.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#bindTo
* @param null|mixed $a
* @throws NotImplementedException
*/
public function bindTo($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Invokes the method handle, allowing any caller type descriptor, and optionally performing conversions on arguments and return values.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#invoke
* @param null|mixed $a
* @throws NotImplementedException
*/
public function invoke($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Invokes the method handle, allowing any caller type descriptor, but requiring an exact type match.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#invokeExact
*/
public function invokeExact(...$args)
{
/**
* @var JavaClassInterface $class
* @var JavaClassInterface $refc
* @var string $name
* @var JavaClassInterface $methodType
*/
[$refc, $name, $methodType] = $this->parameters;
$class = $args[0] ?? null;
$result = $class
->getInvoker()
->getDynamic()
->getMethods()
->call(
$name,
...array_slice($args, 1)
);
/**
* @var JavaClassInterface $returnType
*/
$returnType = $methodType
->getInvoker()
->getDynamic()
->getMethods()
->call(
'returnType'
);
if ($returnType instanceof Void_) {
return null;
}
return $result;
}
/**
* Performs a variable arity invocation, passing the arguments in the given array to the method handle, as if via an inexact invoke from a call site which mentions only the type Object, and whose actual argument count is the length of the argument array.
* Performs a variable arity invocation, passing the arguments in the given list to the method handle, as if via an inexact invoke from a call site which mentions only the type Object, and whose actual argument count is the length of the argument list.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#invokeWithArguments
* @param null|mixed $a
* @throws NotImplementedException
*/
public function invokeWithArguments($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Determines if this method handle supports variable arity calls.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#isVarargsCollector
* @param null|mixed $a
* @throws NotImplementedException
*/
public function isVarargsCollector($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Returns a string representation of the method handle, starting with the string "MethodHandle" and ending with the string representation of the method handle's type.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#toString
* @param null|mixed $a
* @throws NotImplementedException
*/
public function toString($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Reports the type of this method handle.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#type
* @param null|mixed $a
* @throws NotImplementedException
*/
public function type($a = null)
{
throw new NotImplementedException(__METHOD__);
}
/**
* Adapts this method handle to be variable arity if the boolean flag is true, else fixed arity.
*
* @see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/invoke/package-summary.html#withVarargs
* @param null|mixed $a
* @throws NotImplementedException
*/
public function withVarargs($a = null)
{
throw new NotImplementedException(__METHOD__);
}
}