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 NestedByteArrayInputStream
private static final int
private int[]
private int
private Object[]
private String
private String
protected JdecEnvironment
private int
private static final int
private static final String
private final DataInputStream
private byte[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
decodeAnnotation
(DataInputStream in, ToolOutput out) private void
decodeAttr
(DataInputStream in, ToolOutput out) private void
decodeAttrs
(DataInputStream in, ToolOutput out) private void
(package private) void
private void
decodeCPXAttr
(DataInputStream in, int len, String attrname) private void
decodeCPXAttrM
(DataInputStream in, int len, String attrName, int expectedIndices) private void
decodeElementValue
(DataInputStream in, ToolOutput out) private void
decodeElementValuePairs
(int count, DataInputStream in, ToolOutput out) private void
decodeInfo
(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 void
decodeMembers
(DataInputStream in, ToolOutput out, String groupName, String elementName) private void
private void
decodeModuleStatement
(String statementName, DataInputStream in) private void
Processes 4.7.20 The RuntimeVisibleTypeAnnotations Attribute, 4.7.21 The RuntimeInvisibleTypeAnnotations Attributetype_annotation
structure.private void
private void
decodeTypes
(DataInputStream in, int count) private String
formatComments
(String s, int shift) private String
private String
CONSTANT_Module_info { u1 tag; // == CONSTANT_MODULE(19) u2 name_index; }private String
private String
getStackMap
(DataInputStream in, int elementsNum) private String
boolean
isPrintableChar
(char c) private void
private void
private void
private void
private void
printByteHex
(int b) private void
printBytes
(DataInputStream in, int len, boolean printSeparately) private void
printCP()
private void
private void
printUtf8InfoIndex
(int index, String indexName) private void
printUtf8String
(DataInputStream in, int len) private void
private String
startArray
(int length) private void
startArrayCmt
(int length, String comment) private void
startArrayCmtB
(int length, String comment) private String
toHex
(long val) private String
toHex
(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:
IOException
URISyntaxException
-
-
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_annotation
structure.- 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
-