use of dyvilx.tools.asm.AnnotatableVisitor in project Dyvil by Dyvil.
the class IParameter method writeParameter.
default void writeParameter(MethodWriter writer) {
final AttributeList annotations = this.getAttributes();
final IType type = this.getInternalType();
final long flags = ModifierUtil.getFlags(this);
final int index = this.getIndex();
final int localIndex = writer.localCount();
this.setLocalIndex(localIndex);
// Add the ACC_VARARGS modifier if necessary
final int javaModifiers = ModifierUtil.getJavaModifiers(flags) | (this.isVarargs() ? Modifiers.ACC_VARARGS : 0);
writer.visitParameter(localIndex, this.getQualifiedLabel(), type, javaModifiers);
// Annotations
final AnnotatableVisitor visitor = (desc, visible) -> writer.visitParameterAnnotation(index, desc, visible);
if (annotations != null) {
annotations.write(visitor);
}
ModifierUtil.writeModifiers(visitor, flags);
IType.writeAnnotations(type, writer, TypeReference.newFormalParameterReference(index), "");
}
Aggregations