mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-24 00:14:48 +01:00
feat: added set-via-descriptor-string for methods and fields
This commit is contained in:
parent
113d234bbf
commit
f2d1394bc4
1 changed files with 13 additions and 0 deletions
|
@ -171,6 +171,19 @@ public class MethodProxy extends AbstractProxy {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Builds a {@link MethodProxy} of the given kind.
|
||||||
* @return the built {@link MethodProxy}
|
* @return the built {@link MethodProxy}
|
||||||
|
|
Loading…
Reference in a new issue