/** {@inheritDoc} */ public int placeValue(int offset) { return offset + EncodedValueUtils.getRequiredBytesForUnsignedIntegralValue(value.getIndex()) + 1; }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(4, typeDescriptor.getConciseIdentity()); } out.writeInt(typeDescriptor.getIndex()); }
/** {@inheritDoc} */ public int placeValue(int offset) { offset = offset + Leb128Utils.unsignedLeb128Size(annotationType.getIndex()); offset = offset + Leb128Utils.unsignedLeb128Size(names.length); for (int i=0; i<names.length; i++) { offset = offset + Leb128Utils.unsignedLeb128Size(names[i].getIndex()); offset = values[i].placeValue(offset); } return offset; }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(2, "class_type: " + classType.getTypeDescriptor()); out.annotate(2, "method_prototype: " + methodPrototype.getPrototypeString()); out.annotate(4, "method_name: " + methodName.getStringValue()); } int classIndex = classType.getIndex(); if (classIndex > 0xffff) { throw new RuntimeException(String.format("Error writing method_id_item for %s. The type index of " + "defining class %s is too large", getMethodString(), classType.getTypeDescriptor())); } out.writeShort(classIndex); int prototypeIndex = methodPrototype.getIndex(); if (prototypeIndex > 0xffff) { throw new RuntimeException(String.format("Error writing method_id_item for %0. The prototype index of " + "method prototype %s is too large", getMethodString(), methodPrototype.getPrototypeString())); } out.writeShort(prototypeIndex); out.writeInt(methodName.getIndex()); }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(2, "class_type: " + classType.getTypeDescriptor()); out.annotate(2, "field_type: " + fieldType.getTypeDescriptor()); out.annotate(4, "field_name: " + fieldName.getStringValue()); } int classIndex = classType.getIndex(); if (classIndex > 0xffff) { throw new RuntimeException(String.format("Error writing field_id_item for %s. The type index of " + "defining class %s is too large", getFieldString(), classType.getTypeDescriptor())); } out.writeShort(classIndex); int typeIndex = fieldType.getIndex(); if (typeIndex > 0xffff) { throw new RuntimeException(String.format("Error writing field_id_item for %s. The type index of field " + "type %s is too large", getFieldString(), fieldType.getTypeDescriptor())); } out.writeShort(typeIndex); out.writeInt(fieldName.getIndex()); }
/** {@inheritDoc} */ public void writeValue(AnnotatedOutput out) { byte[] bytes = EncodedValueUtils.encodeUnsignedIntegralValue(value.getIndex()); if (out.annotates()) { out.annotate(1, "value_type=" + ValueType.VALUE_STRING.name() + ",value_arg=" + (bytes.length - 1)); out.annotate(bytes.length, "value: \"" + Utf8Utils.escapeString(value.getStringValue()) + "\""); } out.writeByte(ValueType.VALUE_STRING.value | ((bytes.length - 1) << 5)); out.write(bytes); }
indexp1 = 0; } else { indexp1 = parameterName.getIndex() + 1;
indexp1 = 0; } else { indexp1 = parameterName.getIndex() + 1;
/** {@inheritDoc} */ public void writeValue(AnnotatedOutput out) { out.annotate("annotation_type: " + annotationType.getTypeDescriptor()); out.writeUnsignedLeb128(annotationType.getIndex()); out.annotate("element_count: 0x" + Integer.toHexString(names.length) + " (" + names.length + ")"); out.writeUnsignedLeb128(names.length); for (int i=0; i<names.length; i++) { out.annotate(0, "[" + i + "] annotation_element"); out.indent(); out.annotate("element_name: " + names[i].getStringValue()); out.writeUnsignedLeb128(names[i].getIndex()); out.annotate(0, "element_value:"); out.indent(); values[i].writeValue(out); out.deindent(); out.deindent(); } }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(4, "shorty_descriptor: " + shortyDescriptor.getStringValue()); out.annotate(4, "return_type: " + returnType.getTypeDescriptor()); if (parameters == null) { out.annotate(4, "parameters:"); } else { out.annotate(4, "parameters: " + parameters.getTypeListString("")); } } out.writeInt(shortyDescriptor.getIndex()); out.writeInt(returnType.getIndex()); out.writeInt(parameters == null?0:parameters.getOffset()); }
} else { out.annotate("[" + index++ +"] parameterName: " + parameterName.getStringValue()); indexp1 = parameterName.getIndex() + 1;
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(4, "class_type: " + classType.getTypeDescriptor()); out.annotate(4, "access_flags: " + AccessFlags.formatAccessFlagsForClass(accessFlags)); out.annotate(4, "superclass_type: " + (superType==null?"":superType.getTypeDescriptor())); out.annotate(4, "interfaces: " + (implementedInterfaces==null?"":implementedInterfaces.getTypeListString(" "))); out.annotate(4, "source_file: " + (sourceFile==null?"":sourceFile.getStringValue())); out.annotate(4, "annotations_off: " + (annotations==null?"":"0x"+Integer.toHexString(annotations.getOffset()))); out.annotate(4, "class_data_off:" + (classData==null?"":"0x"+Integer.toHexString(classData.getOffset()))); out.annotate(4, "static_values_off: " + (staticFieldInitializers==null?"":"0x"+Integer.toHexString(staticFieldInitializers.getOffset()))); } out.writeInt(classType.getIndex()); out.writeInt(accessFlags); out.writeInt(superType==null?-1:superType.getIndex()); out.writeInt(implementedInterfaces==null?0:implementedInterfaces.getOffset()); out.writeInt(sourceFile==null?-1:sourceFile.getIndex()); out.writeInt(annotations==null?0:annotations.getOffset()); out.writeInt(classData==null?0:classData.getOffset()); out.writeInt(staticFieldInitializers==null?0:staticFieldInitializers.getOffset()); }
/** {@inheritDoc} */ public int placeValue(int offset) { return offset + EncodedValueUtils.getRequiredBytesForUnsignedIntegralValue(value.getIndex()) + 1; }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(4, typeDescriptor.getConciseIdentity()); } out.writeInt(typeDescriptor.getIndex()); }
/** {@inheritDoc} */ public int placeValue(int offset) { offset = offset + Leb128Utils.unsignedLeb128Size(annotationType.getIndex()); offset = offset + Leb128Utils.unsignedLeb128Size(names.length); for (int i=0; i<names.length; i++) { offset = offset + Leb128Utils.unsignedLeb128Size(names[i].getIndex()); offset = values[i].placeValue(offset); } return offset; }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(2, "class_type: " + classType.getTypeDescriptor()); out.annotate(2, "field_type: " + fieldType.getTypeDescriptor()); out.annotate(4, "field_name: " + fieldName.getStringValue()); } int classIndex = classType.getIndex(); if (classIndex > 0xffff) { throw new RuntimeException(String.format("Error writing field_id_item for %s. The type index of " + "defining class %s is too large", getFieldString(), classType.getTypeDescriptor())); } out.writeShort(classIndex); int typeIndex = fieldType.getIndex(); if (typeIndex > 0xffff) { throw new RuntimeException(String.format("Error writing field_id_item for %s. The type index of field " + "type %s is too large", getFieldString(), fieldType.getTypeDescriptor())); } out.writeShort(typeIndex); out.writeInt(fieldName.getIndex()); }
/** {@inheritDoc} */ public void writeValue(AnnotatedOutput out) { byte[] bytes = EncodedValueUtils.encodeUnsignedIntegralValue(value.getIndex()); if (out.annotates()) { out.annotate(1, "value_type=" + ValueType.VALUE_STRING.name() + ",value_arg=" + (bytes.length - 1)); out.annotate(bytes.length, "value: \"" + Utf8Utils.escapeString(value.getStringValue()) + "\""); } out.writeByte(ValueType.VALUE_STRING.value | ((bytes.length - 1) << 5)); out.write(bytes); }
/** {@inheritDoc} */ public void writeValue(AnnotatedOutput out) { out.annotate("annotation_type: " + annotationType.getTypeDescriptor()); out.writeUnsignedLeb128(annotationType.getIndex()); out.annotate("element_count: 0x" + Integer.toHexString(names.length) + " (" + names.length + ")"); out.writeUnsignedLeb128(names.length); for (int i=0; i<names.length; i++) { out.annotate(0, "[" + i + "] annotation_element"); out.indent(); out.annotate("element_name: " + names[i].getStringValue()); out.writeUnsignedLeb128(names[i].getIndex()); out.annotate(0, "element_value:"); out.indent(); values[i].writeValue(out); out.deindent(); out.deindent(); } }
/** {@inheritDoc} */ protected void writeItem(AnnotatedOutput out) { if (out.annotates()) { out.annotate(4, "shorty_descriptor: " + shortyDescriptor.getStringValue()); out.annotate(4, "return_type: " + returnType.getTypeDescriptor()); if (parameters == null) { out.annotate(4, "parameters:"); } else { out.annotate(4, "parameters: " + parameters.getTypeListString("")); } } out.writeInt(shortyDescriptor.getIndex()); out.writeInt(returnType.getIndex()); out.writeInt(parameters == null?0:parameters.getOffset()); }