Class ClassData
java.lang.Object
org.openjdk.asmtools.jdec.ClassData
Class data of the Java Decoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NestedByteArrayInputStreamprivate static final intprivate static final intprivate static final intprivate int[]private intprivate Object[]private Stringprivate Stringprotected JdecEnvironmentprivate intprivate static final intprivate static final Stringprivate final DataInputStreamprivate byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intcheckWrapping(int wrappingLevel) private voiddecodeAnnotation(DataInputStream in, ToolOutput out) private voiddecodeAttr(DataInputStream in, ToolOutput out) private voiddecodeAttrs(DataInputStream in, ToolOutput out) private void(package private) voidprivate voiddecodeCPXAttr(DataInputStream in, int len, String attrname) private voiddecodeCPXAttrM(DataInputStream in, int len, String attrName, int expectedIndices) private voiddecodeElementValue(DataInputStream in, ToolOutput out) private voiddecodeElementValuePairs(int count, DataInputStream in, ToolOutput out) private voiddecodeInfo(DataInputStream in, ToolOutput out, String elementName, boolean hasAccessFlag) component_info { JEP 359 Record(Preview): class file 58.65535 u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; }private voiddecodeMembers(DataInputStream in, ToolOutput out, String groupName, String elementName) private voidprivate voiddecodeModuleStatement(String statementName, DataInputStream in) private voidProcesses 4.7.20 The RuntimeVisibleTypeAnnotations Attribute, 4.7.21 The RuntimeInvisibleTypeAnnotations Attributetype_annotationstructure.private voidprivate voiddecodeTypes(DataInputStream in, int count, String typeName) private StringformatComments(String str, int shift) private String(package private) StringgetInnerClassComment(int inner_class_access_flags) private StringCONSTANT_Module_info { u1 tag; // == CONSTANT_MODULE(19) u2 name_index; }private Stringprivate StringgetStackMap(DataInputStream in, int elementsNum) private StringgetStringByIndex(int idx) private Stringprivate StringReads from early_larval_frame { u1 frame_type = EARLY_LARVAL; // 246 u2 number_of_unset_fields; u2 unset_fields[number_of_unset_fields]; base_frame base; } the structure unset_fields[number_of_unset_fields] and returns its string presentationprivate voidprivate voidprivate voidprivate voidprivate voidprintByteHex(int b) private voidprintBytes(byte[] buf) private voidprintBytes(DataInputStream in, int len, boolean printSeparately, boolean ignoreException) private voidprintCP()private voidprivate voidprintUtf8InfoIndex(int index, String indexName) private voidprintUtf8String(DataInputStream in, int len) private voidreadCP(byte[] alreadyRead, DataInputStream in) private StringstartArray(int length) private voidstartArrayCmt(int length, String comment) private voidstartArrayCmtB(int length, String comment) private StringtoHex(long val) private StringtoHex(long val, int width)
-
Field Details
-
COMMENT_OFFSET
private static final int COMMENT_OFFSET- See Also:
-
BYTES_IN_LINE_SPACED_OUT
private static final int BYTES_IN_LINE_SPACED_OUT- See Also:
-
BYTES_IN_LINE_CONDENSED
private static final int BYTES_IN_LINE_CONDENSED- See Also:
-
INDENT_STRING
- See Also:
-
INDENT_LENGTH
private static final int INDENT_LENGTH -
arrayInputStream
-
inputStream
-
environment
-
types
private byte[] types -
cpool
-
CPlen
private int CPlen -
cpe_pos
private int[] cpe_pos -
entityType
-
entityName
-
indent
private int indent
-
-
Constructor Details
-
ClassData
ClassData(JdecEnvironment environment) throws IOException, URISyntaxException - Throws:
IOExceptionURISyntaxException
-
-
Method Details
-
toHex
-
toHex
-
printByteHex
private void printByteHex(int b) -
printBytes
private void printBytes(DataInputStream in, int len, boolean printSeparately, boolean ignoreException) throws IOException - Parameters:
in- input stream to get bytes for printinglen- number of bytesprintSeparately- defines a format of printed lines which will be either 0x04 0x3C 0x04 0x3D; or 0x043C043D043E1B1C;ignoreException- Whether to propagate the exception or ignore it- Throws:
IOException- exception might happen while reading DataInputStream
-
printUtf8String
- Throws:
IOException
-
printRestOfBytes
private void printRestOfBytes() -
printBytes
private void printBytes(byte[] buf) -
printUtf8InfoIndex
-
out_begin
-
out_print
-
out_println
-
getOutString
-
out_end
-
startArray
-
startArrayCmt
-
startArrayCmtB
-
readCP
- Throws:
IOException
-
printCP
private void printCP() -
getModuleName
CONSTANT_Module_info { u1 tag; // == CONSTANT_MODULE(19) u2 name_index; }- Returns:
- Constant Pool module name by name_index
-
getStringPos
-
getCommentPosCond
-
decodeCPXAttr
- Throws:
IOException
-
decodeCPXAttrM
private void decodeCPXAttrM(DataInputStream in, int len, String attrName, int expectedIndices) throws IOException - Throws:
IOException
-
getUnsetFields
Reads from early_larval_frame { u1 frame_type = EARLY_LARVAL; // 246 u2 number_of_unset_fields; u2 unset_fields[number_of_unset_fields]; base_frame base; } the structure unset_fields[number_of_unset_fields] and returns its string presentation- Parameters:
in- input stream- Returns:
- String presentation of the aggregation of [number_of_unset_fields] {unset_fields }
- Throws:
IOException- if IO exception occurs
-
getStackMap
- Throws:
IOException
-
decodeTargetTypeAndRefInfo
Processes 4.7.20 The RuntimeVisibleTypeAnnotations Attribute, 4.7.21 The RuntimeInvisibleTypeAnnotations Attributetype_annotationstructure.- Throws:
IOException
-
decodeElementValue
- Throws:
IOException
-
decodeAnnotation
- Throws:
IOException
-
decodeElementValuePairs
private void decodeElementValuePairs(int count, DataInputStream in, ToolOutput out) throws IOException - Throws:
IOException
-
decodeInfo
private void decodeInfo(DataInputStream in, ToolOutput out, String elementName, boolean hasAccessFlag) throws IOException component_info { JEP 359 Record(Preview): class file 58.65535 u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; }or field_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; } or method_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; }
- Throws:
IOException
-
decodeTypeAnnotation
- Throws:
IOException
-
decodeBootstrapMethod
- Throws:
IOException
-
decodeAttr
- Throws:
IOException
-
decodeModuleStatement
- Throws:
IOException
-
decodeModule
- Throws:
IOException
-
decodeAttrs
- Throws:
IOException
-
decodeMembers
private void decodeMembers(DataInputStream in, ToolOutput out, String groupName, String elementName) throws IOException - Throws:
IOException
-
getInnerClassComment
-
decodeClass
- Throws:
IOException
-
checkWrapping
private int checkWrapping(int wrappingLevel) -
decodeTypes
- Throws:
IOException
-
getStringByIndex
-
formatComments
-