diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/proxies')
-rw-r--r-- | src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java index 3710d36..a1306f7 100644 --- a/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java +++ b/src/main/java/ftbsc/lll/proxies/impl/MethodProxy.java @@ -172,6 +172,19 @@ public class MethodProxy extends AbstractProxy { } /** + * Sets the type of the method to the given descriptor, + * and extracts return and parameter types from it. + * @param descr the descriptor + * @return the builder's state after the change + */ + public Builder setDescriptor(String descr) { + super.setDescriptor(descr); + this.parameters.addAll(Arrays.asList(Type.getArgumentTypes(descr))); + this.returnType = Type.getReturnType(descr); + return this; + } + + /** * Builds a {@link MethodProxy} of the given kind. * @return the built {@link MethodProxy} */ |