Class ClassData

All Implemented Interfaces:
Printable

public class ClassData extends MemberData<ClassData>
Central class data for of the Java Disassembler
  • Field Details

    • alreadyPrinted

      private boolean alreadyPrinted
    • canBePrinted

      private boolean canBePrinted
    • cfVersion

      protected CFVersion cfVersion
    • this_cpx

      protected int this_cpx
    • super_cpx

      protected int super_cpx
    • className

      protected String className
    • packageName

      protected String packageName
    • classShortName

      protected String classShortName
    • interfaces

      protected int[] interfaces
    • fields

      protected Container<FieldData, ClassData> fields
    • methods

      protected Container<MethodData, ClassData> methods
    • totalAttributes

      private int totalAttributes
      Attributes: SourceFile 45.3 InnerClasses 45.3 EnclosingMethod 49.0 SourceDebugExtension 49.0 BootstrapMethods 51.0 Module, ModulePackages, ModuleMainClass 53.0 NestHost, NestMembers 55.0 Record 60.0 PermittedSubclasses 61.0 ------------------------------------------------- Synthetic 45.3 Deprecated 45.3 Signature 49.0 RuntimeVisibleAnnotations 49.0 RuntimeInvisibleAnnotations 49.0 RuntimeVisibleTypeAnnotations 52.0 RuntimeInvisibleTypeAnnotations 52.0
    • sourceFileData

      protected SourceFileData sourceFileData
    • innerClasses

      protected Container<InnerClassData, ClassData> innerClasses
    • enclosingMethodData

      protected EnclosingMethodData enclosingMethodData
    • recordData

      protected RecordData recordData
    • bootstrapMethods

      protected Container<BootstrapMethodData, ClassData> bootstrapMethods
    • moduleData

      protected ModuleData moduleData
    • nestHost

      protected NestHostData nestHost
    • nestMembers

      protected NestMembersData nestMembers
    • permittedSubclassesData

      protected PermittedSubclassesData permittedSubclassesData
    • sourceDebugExtensionData

      protected SourceDebugExtensionData sourceDebugExtensionData
    • loadableDescriptorsData

      protected LoadableDescriptorsData loadableDescriptorsData
    • sourceLines

      private TextLines sourceLines
    • classFile

      private Path classFile
  • Constructor Details

  • Method Details

    • isDetailedOutput

      public boolean isDetailedOutput()
    • readFields

      protected void readFields(DataInputStream in) throws IOException
      Read and resolve the field data
      Throws:
      IOException
    • readMethods

      protected void readMethods(DataInputStream in) throws IOException
      Read and resolve the method data
      Throws:
      IOException
    • readInterfaces

      protected void readInterfaces(DataInputStream in) throws IOException
      Read and resolve the interface data
      Throws:
      IOException
    • handleAttributes

      protected boolean handleAttributes(DataInputStream in, EAttribute attributeTag, int attributeLength) throws IOException
      Read and resolve the attribute data
      Overrides:
      handleAttributes in class MemberData<ClassData>
      Throws:
      IOException
    • read

      public void read(DataInputStream in, Path src) throws IOException
      Read and resolve the class data
      Throws:
      IOException
    • initClassNames

      private void initClassNames(int this_cpx)
      Initializes class, package names needed for printing asm file
      Parameters:
      this_cpx - The constant_pool entry at that index is a CONSTANT_Class_info structure (ยง4.4.1) representing the class or interface defined by this class file or this_class is module-info in the case of a module.
    • hasPackage

      public boolean hasPackage()
      Determines if this Class has a package
      Returns:
      true if the package exists for this class
    • getClassName

      public String getClassName()
    • getSrcLine

      public String getSrcLine(int lineNum)
      Read and resolve the attribute data
    • printAnnotations

      protected <T extends AnnotationData> void printAnnotations(List<T>... annotationLists) throws IOException
      Description copied from class: MemberData
      Print member's (ClassData, MethodData, FieldData and RecordData) annotations
      Overrides:
      printAnnotations in class MemberData<ClassData>
      Throws:
      IOException - signals that an exception to some sort has occurred
    • postPrint

      public void postPrint()
      Prints the JASM file as much as it was read if exceptions occur during reading.
    • print

      public void print() throws IOException
      Print jasm file in simple/table format.
      Specified by:
      print in interface Printable
      Overrides:
      print in class Indenter
      Throws:
      IOException
    • printClassIntroduction

      protected void printClassIntroduction() throws IOException
      Throws:
      IOException
    • printSysInfo

      protected void printSysInfo()
      Description copied from class: MemberData
      Prints system comments if the option -sysinfo is used.
      Overrides:
      printSysInfo in class MemberData<ClassData>
    • printJasmClassDeclaration

      protected void printJasmClassDeclaration()
    • getListOfPrintableAttributes

      private <P extends Printable> List<P> getListOfPrintableAttributes(P... attributes)
    • isPrintable

      private <P extends Printable> boolean isPrintable(P... attributes)
    • printAttributes

      private <P extends Printable> void printAttributes(List<P> attributeList, int commentOffset) throws IOException
      Throws:
      IOException
    • printMemberDataList

      private boolean printMemberDataList(Container<? extends MemberData<ClassData>, ClassData> list, int commentOffset) throws IOException
      Throws:
      IOException