Package proguard.io

Class ClassReader

  • All Implemented Interfaces:
    DataEntryReader

    public class ClassReader
    extends java.lang.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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.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 Detail

      • 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 Detail

      • read

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

        public static void main​(java.lang.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).