MutableClasspath

Represents a set of classes that are available at runtime.

The full set of runtime classes is likely more than what is represented here, which is why calling get for any unknown classes will return a virtual class definition that can still be modified and references as usual. However, these virtual classes will be ignored when exporting the classpath via toGenericJarArchive.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val classes: Set<MutableClassReference>

The set of all input classes that will be packaged in this JAR.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addClass(className: String, configure: MutableClassReference.() -> Unit = { }): MutableClassReference

Adds and configures a new class entry in this classpath. This class will be packaged in the resulting JAR file.

Link copied to clipboard

Adds an entire set of other classes from another classpath to this one. Any classes you have defined in this classpath will be overwritten if also present in the other one.

Link copied to clipboard
fun asApiJar()

Modifies all class files to remove any information unrelated to a class's public API.

Link copied to clipboard
open operator override fun get(clazz: Class<*>): MutableClassReference

Returns the class definition for the given class, or throws if one does not exist.

open operator override fun get(className: String): MutableClassReference

Returns the class definition for the given class name, or throws if one does not exist.

Link copied to clipboard
Link copied to clipboard
open override fun getOrNull(className: String): MutableClassReference?

Returns the class definition for the given class name, or null if none exists.

Link copied to clipboard
fun removeClass(className: String): Boolean

Removes a class from being packaged in the resulting JAR file.

Link copied to clipboard

Modifies all class files to remove method body bytecode.

Link copied to clipboard

Modifies all class files to strip private members.

Link copied to clipboard

Returns the modified classpath as a JAR representation.