Class ClassData

java.lang.Object
org.openjdk.asmtools.jdec.ClassData

class ClassData extends Object
Class data of the Java Decoder
  • 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

      private static final String INDENT_STRING
      See Also:
    • INDENT_LENGTH

      private static final int INDENT_LENGTH
    • arrayInputStream

      private final NestedByteArrayInputStream arrayInputStream
    • inputStream

      private final DataInputStream inputStream
    • environment

      protected JdecEnvironment environment
    • types

      private byte[] types
    • cpool

      private Object[] cpool
    • CPlen

      private int CPlen
    • cpe_pos

      private int[] cpe_pos
    • entityType

      private String entityType
    • entityName

      private String entityName
    • indent

      private int indent
  • Constructor Details

  • Method Details

    • toHex

      private String toHex(long val, int width)
    • toHex

      private String toHex(long val)
    • 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 printing
      len - number of bytes
      printSeparately - 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

      private void printUtf8String(DataInputStream in, int len) throws IOException
      Throws:
      IOException
    • printRestOfBytes

      private void printRestOfBytes()
    • printBytes

      private void printBytes(byte[] buf)
    • printUtf8InfoIndex

      private void printUtf8InfoIndex(int index, String indexName)
    • out_begin

      private void out_begin(String s)
    • out_print

      private void out_print(String s)
    • out_println

      private void out_println(String s)
    • getOutString

      private String getOutString(String s)
    • out_end

      private void out_end(String s)
    • startArray

      private String startArray(int length)
    • startArrayCmt

      private void startArrayCmt(int length, String comment)
    • startArrayCmtB

      private void startArrayCmtB(int length, String comment)
    • readCP

      private void readCP(byte[] alreadyRead, DataInputStream in) throws IOException
      Throws:
      IOException
    • printCP

      private void printCP()
    • getModuleName

      private String getModuleName()
      CONSTANT_Module_info { u1 tag; // == CONSTANT_MODULE(19) u2 name_index; }
      Returns:
      Constant Pool module name by name_index
    • getStringPos

      private String getStringPos()
    • getCommentPosCond

      private String getCommentPosCond()
    • decodeCPXAttr

      private void decodeCPXAttr(DataInputStream in, int len, String attrname) throws IOException
      Throws:
      IOException
    • decodeCPXAttrM

      private void decodeCPXAttrM(DataInputStream in, int len, String attrName, int expectedIndices) throws IOException
      Throws:
      IOException
    • getUnsetFields

      private String getUnsetFields(DataInputStream in) throws IOException
      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

      private String getStackMap(DataInputStream in, int elementsNum) throws IOException
      Throws:
      IOException
    • decodeTargetTypeAndRefInfo

      private void decodeTargetTypeAndRefInfo(DataInputStream in) throws IOException
      Processes 4.7.20 The RuntimeVisibleTypeAnnotations Attribute, 4.7.21 The RuntimeInvisibleTypeAnnotations Attribute type_annotation structure.
      Throws:
      IOException
    • decodeElementValue

      private void decodeElementValue(DataInputStream in, ToolOutput out) throws IOException
      Throws:
      IOException
    • decodeAnnotation

      private void decodeAnnotation(DataInputStream in, ToolOutput out) throws IOException
      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

      private void decodeTypeAnnotation(DataInputStream in, ToolOutput out) throws IOException
      Throws:
      IOException
    • decodeBootstrapMethod

      private void decodeBootstrapMethod(DataInputStream in) throws IOException
      Throws:
      IOException
    • decodeAttr

      private void decodeAttr(DataInputStream in, ToolOutput out) throws IOException
      Throws:
      IOException
    • decodeModuleStatement

      private void decodeModuleStatement(String statementName, DataInputStream in) throws IOException
      Throws:
      IOException
    • decodeModule

      private void decodeModule(DataInputStream in) throws IOException
      Throws:
      IOException
    • decodeAttrs

      private void decodeAttrs(DataInputStream in, ToolOutput out) throws IOException
      Throws:
      IOException
    • decodeMembers

      private void decodeMembers(DataInputStream in, ToolOutput out, String groupName, String elementName) throws IOException
      Throws:
      IOException
    • getInnerClassComment

      String getInnerClassComment(int inner_class_access_flags)
    • decodeClass

      void decodeClass() throws IOException
      Throws:
      IOException
    • checkWrapping

      private int checkWrapping(int wrappingLevel)
    • decodeTypes

      private void decodeTypes(DataInputStream in, int count, String typeName) throws IOException
      Throws:
      IOException
    • getStringByIndex

      private String getStringByIndex(int idx)
    • formatComments

      private String formatComments(String str, int shift)