MutableClassReference

Represents a class definition.

This representation is mutable, to allow changing properties of the class.

Properties

Link copied to clipboard
open override var annotations: List<AnnotationInstance>

The set of annotations applied to this class definition.

Link copied to clipboard
open override var classMajorVersion: Int

The major version of bytecode that this class definition targets.

Link copied to clipboard
open override var classMinorVersion: Int

The minor version of bytecode that this class definition targets, or 0 if not set.

Link copied to clipboard

The set of constructors explicitly declared by this class.

Link copied to clipboard
open override var fields: List<MutableFieldReference>

The set of fields explicitly declared by this class.

Link copied to clipboard

If this is a class, these are the set of interface types implemented by this class. If this is an interface, these are the interfaces extended by this interface.

Link copied to clipboard
open override var methods: List<MutableMethodReference>

The set of methods explicitly declared by this class.

Link copied to clipboard
open override var modifiers: Set<Modifier>

The set of modifiers applied to the class definition.

Link copied to clipboard
open override var packageName: String

The name of the package this class is defined in.

Link copied to clipboard
open override var qualifiedName: String

This class's fully-qualified class name, including its package name and simple class name.

Link copied to clipboard
open override var simpleName: String

The declared name of this specific class.

Link copied to clipboard
open override var superclass: MutableClassReference?

The supertype of this class, or null if none defined.

Functions

Link copied to clipboard

Adds a new constructor explicitly declared by this class.

Link copied to clipboard

Adds a new field explicitly declared by this class.

Link copied to clipboard

Adds a new method explicitly declared by this class.

Link copied to clipboard

Creates a new annotation usage instance for use only in this class.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getField(name: String): MutableFieldReference?

Returns the declared field identified by this name, or null if none exists.

Link copied to clipboard
open override fun getMethod(name: String): MutableMethodReference?

Returns the declared method identified by this name, or null if none exists.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toBytecode(): ByteArray

Returns the bytecode associated with this class definition.

Link copied to clipboard
open override fun toString(): String