Package org.openjdk.asmtools.jdec
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 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 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) private StringformatComments(String s, int shift) private Stringprivate StringCONSTANT_Module_info { u1 tag; // == CONSTANT_MODULE(19) u2 name_index; }private Stringprivate StringgetStackMap(DataInputStream in, int elementsNum) private StringbooleanisPrintableChar(char c) private voidprivate voidprivate voidprivate voidprivate voidprintByteHex(int b) private voidprintBytes(DataInputStream in, int len, boolean printSeparately) private voidprintCP()private voidprivate voidprintUtf8InfoIndex(int index, String indexName) private voidprintUtf8String(DataInputStream in, int len) private voidprivate 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:
-
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
- 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;- Throws:
IOException- exception might happen while reading DataInputStream
-
printUtf8String
- Throws:
IOException
-
printRestOfBytes
private void printRestOfBytes() -
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
-
getStackMap
- Throws:
IOException
-
decodeTargetTypeAndRefInfo
Processes 4.7.20 The RuntimeVisibleTypeAnnotations Attribute, 4.7.21 The RuntimeInvisibleTypeAnnotations Attributetype_annotationstructure.- Throws:
IOException
-
decodeElementValue
- Throws:
IOException
-
isPrintableChar
public boolean isPrintableChar(char c) -
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
-
decodeClass
- Throws:
IOException
-
decodeTypes
- Throws:
IOException
-
formatComments
-