Package proguard.io

Class ClassReader

java.lang.Object
proguard.io.ClassReader
All Implemented Interfaces:
DataEntryReader

public class ClassReader extends Object implements DataEntryReader
This DataEntryReader applies a given ClassVisitor to the class definitions that it reads.

Class files are read as ProgramClass instances or LibraryClass instances, depending on the isLibrary flag.

In case of libraries, only public classes are considered, if the skipNonPublicLibraryClasses flag is set.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ClassReader(boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, boolean includeKotlinMetadata, WarningPrinter warningPrinter, ClassVisitor classVisitor)
    Creates a new ClassReader for reading the specified Clazz objects.
    ClassReader(boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, WarningPrinter warningPrinter, ClassVisitor classVisitor)
    Creates a new ClassReader for reading the specified Clazz objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String[] args)
    This main method illustrates the use of this class.
    void
    read(DataEntry dataEntry)
    Reads the given data entry.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClassReader

      public ClassReader(boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, WarningPrinter warningPrinter, ClassVisitor classVisitor)
      Creates a new ClassReader for reading the specified Clazz objects.
    • ClassReader

      public ClassReader(boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, boolean includeKotlinMetadata, WarningPrinter warningPrinter, ClassVisitor classVisitor)
      Creates a new ClassReader for reading the specified Clazz objects.
  • Method Details

    • read

      public void read(DataEntry dataEntry) throws IOException
      Description copied from interface: DataEntryReader
      Reads the given data entry.
      Specified by:
      read in interface DataEntryReader
      Throws:
      IOException
    • main

      public static void main(String[] args)
      This main method illustrates the use of this class.

      It writes out the structure of the specified classes (packaged in jar, zip, or class files).