public class IOUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ClassPool |
read(ClassPath classPath,
java.lang.String classNameFilter,
boolean android,
boolean isLibrary,
boolean skipNonPublicLibraryClasses,
boolean skipNonPublicLibraryClassMembers,
boolean ignoreStackMapAttributes,
java.util.function.BiFunction<DataEntryReader,ClassVisitor,DataEntryReader> extraDataEntryReader)
Reads the classes from the specified jar file and returns them as a class pool.
|
static ClassPool |
read(ClassPath classPath,
java.lang.String classNameFilter,
boolean android,
boolean isLibrary,
boolean initializeKotlinMetadata,
boolean skipNonPublicLibraryClasses,
boolean skipNonPublicLibraryClassMembers,
boolean ignoreStackMapAttributes,
java.util.function.BiFunction<DataEntryReader,ClassVisitor,DataEntryReader> extraDataEntryReader) |
static ClassPool |
read(java.io.File file,
boolean isLibrary)
Reads the classes from the specified jar file and returns them as a class pool.
|
static ClassPool |
read(java.io.File file,
boolean isLibrary,
boolean initializeKotlinMetadata)
Reads the classes from the specified jar file and returns them as a class pool.
|
static ClassPool |
read(java.io.File file,
boolean isLibrary,
boolean initializeKotlinMetadata,
java.util.function.BiFunction<DataEntryReader,ClassVisitor,DataEntryReader> extraDataEntryReader)
Reads the classes from the specified jar file and returns them as a class pool.
|
static ClassPool |
read(java.lang.String fileName,
boolean isLibrary)
Reads the classes from the specified jar file and returns them as a class pool.
|
static ClassPool |
read(java.lang.String fileName,
boolean isLibrary,
boolean initializeKotlinMetadata)
Reads the classes from the specified jar file and returns them as a class pool.
|
static void |
writeJar(ClassPool programClassPool,
java.lang.String outputJarFileName)
Writes the classes from the given class pool to a specified jar.
|
static void |
writeJar(ClassPool programClassPool,
java.lang.String outputJarFileName,
java.lang.String mainClassName)
Writes the classes from the given class pool to a specified jar.
|
public static ClassPool read(java.lang.String fileName, boolean isLibrary) throws java.io.IOException
fileName
- the file name.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).java.io.IOException
public static ClassPool read(java.lang.String fileName, boolean isLibrary, boolean initializeKotlinMetadata) throws java.io.IOException
fileName
- the file name.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).initializeKotlinMetadata
- specifies to initialize the Kotlin metadata model.java.io.IOException
public static ClassPool read(java.io.File file, boolean isLibrary) throws java.io.IOException
file
- the file.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).java.io.IOException
public static ClassPool read(java.io.File file, boolean isLibrary, boolean initializeKotlinMetadata) throws java.io.IOException
file
- the file.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).initializeKotlinMetadata
- specifies to initialize the Kotlin metadata model.java.io.IOException
public static ClassPool read(java.io.File file, boolean isLibrary, boolean initializeKotlinMetadata, java.util.function.BiFunction<DataEntryReader,ClassVisitor,DataEntryReader> extraDataEntryReader) throws java.io.IOException
file
- the name of the file.isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).initializeKotlinMetadata
- specifies to initialize the Kotlin metadata model.extraDataEntryReader
- Optionally provide a function that wraps the reader in another
reader.java.io.IOException
public static ClassPool read(ClassPath classPath, java.lang.String classNameFilter, boolean android, boolean isLibrary, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, java.util.function.BiFunction<DataEntryReader,ClassVisitor,DataEntryReader> extraDataEntryReader) throws java.io.IOException
isLibrary
- specifies whether classes should be represented as ProgramClass instances (for
processing) or LibraryClass instances (more compact).extraDataEntryReader
- Optionally provide a function that wraps the reader in another
reader.java.io.IOException
public static ClassPool read(ClassPath classPath, java.lang.String classNameFilter, boolean android, boolean isLibrary, boolean initializeKotlinMetadata, boolean skipNonPublicLibraryClasses, boolean skipNonPublicLibraryClassMembers, boolean ignoreStackMapAttributes, java.util.function.BiFunction<DataEntryReader,ClassVisitor,DataEntryReader> extraDataEntryReader) throws java.io.IOException
java.io.IOException
public static void writeJar(ClassPool programClassPool, java.lang.String outputJarFileName) throws java.io.IOException
programClassPool
- the classes to write.outputJarFileName
- the name of the output jar file.java.io.IOException
public static void writeJar(ClassPool programClassPool, java.lang.String outputJarFileName, java.lang.String mainClassName) throws java.io.IOException
programClassPool
- the classes to write.outputJarFileName
- the name of the output jar file.java.io.IOException