mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-10 01:29:22 +01:00
chore: added (restored?) setType with fqn and array type
This commit is contained in:
parent
f2303ce943
commit
113d234bbf
1 changed files with 14 additions and 0 deletions
|
@ -7,6 +7,8 @@ import org.objectweb.asm.Type;
|
|||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import static ftbsc.lll.tools.DescriptorBuilder.nameToDescriptor;
|
||||
|
||||
/**
|
||||
* A container for information about class fields to be used
|
||||
* in ASM patching.
|
||||
|
@ -87,6 +89,7 @@ public class FieldProxy extends AbstractProxy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the type of the field to the given {@link Class} object.
|
||||
* @param clazz the {@link Class} corresponding to the element
|
||||
* @return the current state of the builder
|
||||
*/
|
||||
|
@ -95,6 +98,17 @@ public class FieldProxy extends AbstractProxy {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type of the field to the given type.
|
||||
* @param fqn – the fully qualified name of the parameter type
|
||||
* @param arrayLevel the array level
|
||||
* @return the builder's state after the change
|
||||
*/
|
||||
public Builder setType(String fqn, int arrayLevel) {
|
||||
super.setType(Type.getType(nameToDescriptor(fqn, arrayLevel)));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a {@link FieldProxy} of the given kind.
|
||||
* @return the built {@link FieldProxy}
|
||||
|
|
Loading…
Reference in a new issue