public void visitSourceDirAttribute(Clazz clazz, SourceDirAttribute sourceDirAttribute) { // Create a copy of the attribute. SourceDirAttribute newSourceDirAttribute = new SourceDirAttribute(constantAdder.addConstant(clazz, sourceDirAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, sourceDirAttribute.u2sourceDirIndex)); // Add it to the target class. attributesEditor.addAttribute(newSourceDirAttribute); }
public void visitParameterInfo(Clazz clazz, Method method, int parameterIndex, ParameterInfo parameterInfo) { // Create a new parameter. int newNameIndex = parameterInfo.u2nameIndex == 0 ? 0 : constantAdder.addConstant(clazz, parameterInfo.u2nameIndex); ParameterInfo newParameterInfo = new ParameterInfo(newNameIndex, parameterInfo.u2accessFlags); // Add it to the target. targetMethodParametersAttribute.parameters[parameterIndex] = newParameterInfo; } }
public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) { // Create a copy of the attribute. SourceFileAttribute newSourceFileAttribute = new SourceFileAttribute(constantAdder.addConstant(clazz, sourceFileAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, sourceFileAttribute.u2sourceFileIndex)); // Add it to the target class. attributesEditor.addAttribute(newSourceFileAttribute); }
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute) { // Create a copy of the attribute. SignatureAttribute newSignatureAttribute = new SignatureAttribute(constantAdder.addConstant(clazz, signatureAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, signatureAttribute.u2signatureIndex)); newSignatureAttribute.referencedClasses = signatureAttribute.referencedClasses; // Add it to the target. attributesEditor.addAttribute(newSignatureAttribute); }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { interfacesEditor.addInterface(constantAdder.addConstant(clazz, classConstant)); } }
public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) { // Create a copy of the attribute. SourceFileAttribute newSourceFileAttribute = new SourceFileAttribute(constantAdder.addConstant(clazz, sourceFileAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, sourceFileAttribute.u2sourceFileIndex)); // Add it to the target class. attributesEditor.addAttribute(newSourceFileAttribute); }
public void visitSourceDirAttribute(Clazz clazz, SourceDirAttribute sourceDirAttribute) { // Create a copy of the attribute. SourceDirAttribute newSourceDirAttribute = new SourceDirAttribute(constantAdder.addConstant(clazz, sourceDirAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, sourceDirAttribute.u2sourceDirIndex)); // Add it to the target class. attributesEditor.addAttribute(newSourceDirAttribute); }
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute) { // Create a copy of the attribute. SignatureAttribute newSignatureAttribute = new SignatureAttribute(constantAdder.addConstant(clazz, signatureAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, signatureAttribute.u2signatureIndex)); newSignatureAttribute.referencedClasses = signatureAttribute.referencedClasses; // Add it to the target. attributesEditor.addAttribute(newSignatureAttribute); }
public void visitConstantValueAttribute(Clazz clazz, Field field, ConstantValueAttribute constantValueAttribute) { // Create a copy of the attribute. ConstantValueAttribute newConstantValueAttribute = new ConstantValueAttribute(constantAdder.addConstant(clazz, constantValueAttribute.u2attributeNameIndex), constantAdder.addConstant(clazz, constantValueAttribute.u2constantValueIndex)); // Add it to the target field. attributesEditor.addAttribute(newConstantValueAttribute); }
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { // Create a copy of the instruction. Instruction newConstantInstruction = new ConstantInstruction(constantInstruction.opcode, constantAdder.addConstant(clazz, constantInstruction.constantIndex), constantInstruction.constant); // Add the instruction. codeAttributeComposer.appendInstruction(offset, newConstantInstruction); } }
public void visitSyntheticAttribute(Clazz clazz, SyntheticAttribute syntheticAttribute) { // Create a copy of the attribute. SyntheticAttribute newSyntheticAttribute = new SyntheticAttribute(constantAdder.addConstant(clazz, syntheticAttribute.u2attributeNameIndex)); // Add it to the target. attributesEditor.addAttribute(newSyntheticAttribute); }
public void visitDeprecatedAttribute(Clazz clazz, DeprecatedAttribute deprecatedAttribute) { // Create a copy of the attribute. DeprecatedAttribute newDeprecatedAttribute = new DeprecatedAttribute(constantAdder.addConstant(clazz, deprecatedAttribute.u2attributeNameIndex)); // Add it to the target. attributesEditor.addAttribute(newDeprecatedAttribute); }
public void visitSyntheticAttribute(Clazz clazz, SyntheticAttribute syntheticAttribute) { // Create a copy of the attribute. SyntheticAttribute newSyntheticAttribute = new SyntheticAttribute(constantAdder.addConstant(clazz, syntheticAttribute.u2attributeNameIndex)); // Add it to the target. attributesEditor.addAttribute(newSyntheticAttribute); }
public void visitUnknownAttribute(Clazz clazz, UnknownAttribute unknownAttribute) { // Create a copy of the attribute. UnknownAttribute newUnknownAttribute = new UnknownAttribute(constantAdder.addConstant(clazz, unknownAttribute.u2attributeNameIndex), unknownAttribute.u4attributeLength, unknownAttribute.info); // Add it to the target class. attributesEditor.addAttribute(newUnknownAttribute); }
public void visitUnknownAttribute(Clazz clazz, UnknownAttribute unknownAttribute) { // Create a copy of the attribute. UnknownAttribute newUnknownAttribute = new UnknownAttribute(constantAdder.addConstant(clazz, unknownAttribute.u2attributeNameIndex), unknownAttribute.u4attributeLength, unknownAttribute.info); // Add it to the target class. attributesEditor.addAttribute(newUnknownAttribute); }
public void visitDeprecatedAttribute(Clazz clazz, DeprecatedAttribute deprecatedAttribute) { // Create a copy of the attribute. DeprecatedAttribute newDeprecatedAttribute = new DeprecatedAttribute(constantAdder.addConstant(clazz, deprecatedAttribute.u2attributeNameIndex)); // Add it to the target. attributesEditor.addAttribute(newDeprecatedAttribute); }
public void visitSyntheticAttribute(Clazz clazz, SyntheticAttribute syntheticAttribute) { // Create a copy of the attribute. SyntheticAttribute newSyntheticAttribute = new SyntheticAttribute(constantAdder.addConstant(clazz, syntheticAttribute.u2attributeNameIndex)); // Add it to the target. attributesEditor.addAttribute(newSyntheticAttribute); }
public void visitUnknownAttribute(Clazz clazz, UnknownAttribute unknownAttribute) { // Create a copy of the attribute. UnknownAttribute newUnknownAttribute = new UnknownAttribute(constantAdder.addConstant(clazz, unknownAttribute.u2attributeNameIndex), unknownAttribute.u4attributeLength, unknownAttribute.info); // Add it to the target class. attributesEditor.addAttribute(newUnknownAttribute); }
public void visitDeprecatedAttribute(Clazz clazz, DeprecatedAttribute deprecatedAttribute) { // Create a copy of the attribute. DeprecatedAttribute newDeprecatedAttribute = new DeprecatedAttribute(constantAdder.addConstant(clazz, deprecatedAttribute.u2attributeNameIndex)); // Add it to the target. attributesEditor.addAttribute(newDeprecatedAttribute); }
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction) { // Create a copy of the instruction. Instruction newConstantInstruction = new ConstantInstruction(constantInstruction.opcode, constantAdder.addConstant(clazz, constantInstruction.constantIndex), constantInstruction.constant).shrink(); // Add the instruction. codeAttributeComposer.appendInstruction(offset, newConstantInstruction); } }