Package org.spongepowered.asm.mixin.transformer

## Interface IMixinTransformer

    public interface IMixinTransformer

Transformation engine

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `audit​(MixinEnvironment environment)` Force-load all classes targetted by mixins but not yet applied
`boolean` `computeFramesForClass​(MixinEnvironment environment, java.lang.String name, org.objectweb.asm.tree.ClassNode classNode)` Called when the transformation reason is computing_frames.
`boolean` `couldTransformClass​(MixinEnvironment environment, java.lang.String name)` Determines whether mixin could transform the provided class, without actually running the transformation
`byte[]` `generateClass​(MixinEnvironment environment, java.lang.String name)` Generate the specified mixin-synthetic class
`boolean` `generateClass​(MixinEnvironment environment, java.lang.String name, org.objectweb.asm.tree.ClassNode classNode)`
`IExtensionRegistry` `getExtensions()` Get the transformer extensions
`java.util.List<java.lang.String>` `reload​(java.lang.String mixinClass, org.objectweb.asm.tree.ClassNode classNode)` Update a mixin class with new bytecode.
`byte[]` `transformClass​(MixinEnvironment environment, java.lang.String name, byte[] classBytes)` Apply mixins and postprocessors to the supplied class
`boolean` `transformClass​(MixinEnvironment environment, java.lang.String name, org.objectweb.asm.tree.ClassNode classNode)` Apply mixins and postprocessors to the supplied class
`byte[]` `transformClassBytes​(java.lang.String name, java.lang.String transformedName, byte[] basicClass)` Callback from the hotswap agent and LaunchWrapper Proxy, transform class bytecode.

### Method Detail

#### audit

    void audit​(MixinEnvironment environment)

Force-load all classes targetted by mixins but not yet applied

Parameters:
  `environment` - current environment

#### reload

    java.util.List<java.lang.String> reload​(java.lang.String mixinClass,
                                            org.objectweb.asm.tree.ClassNode classNode)

Update a mixin class with new bytecode.

Parameters:
  `mixinClass` - Name of the mixin
  `classNode` - New bytecode
Returns:
  List of classes that need to be updated

#### computeFramesForClass

    boolean computeFramesForClass​(MixinEnvironment environment,
                                  java.lang.String name,
                                  org.objectweb.asm.tree.ClassNode classNode)

Called when the transformation reason is computing_frames. The only operation we care about here is adding interfaces to target classes but at the moment we don't have sufficient scaffolding to determine that without triggering re-entrance. Currently just a no-op in order to not cause a re-entrance crash under ModLauncher 7.0+.

Parameters:
  `environment` - Current environment
  `name` - Class transformed name
  `classNode` - Class tree
Returns:
  true if the class was transformed

#### transformClassBytes

    byte[] transformClassBytes​(java.lang.String name,
                               java.lang.String transformedName,
                               byte[] basicClass)

Callback from the hotswap agent and LaunchWrapper Proxy, transform class bytecode. This method delegates to class generation or class transformation based on whether the supplied byte array is `null` and is therefore suitable for hosts which follow the LaunchWrapper contract.

Parameters:
  `name` - Class name
  `transformedName` - Transformed class name
  `basicClass` - class bytecode
Returns:
  transformed class bytecode
See Also:
  `ILegacyClassTransformer.transformClassBytes(String, String, byte[])`

#### transformClass

    byte[] transformClass​(MixinEnvironment environment,
                          java.lang.String name,
                          byte[] classBytes)

Apply mixins and postprocessors to the supplied class

Parameters:
  `environment` - Current environment
  `name` - Class transformed name
  `classBytes` - Class bytecode
Returns:
  Transformed bytecode

#### transformClass

    boolean transformClass​(MixinEnvironment environment,
                           java.lang.String name,
                           org.objectweb.asm.tree.ClassNode classNode)

Apply mixins and postprocessors to the supplied class

Parameters:
  `environment` - Current environment
  `name` - Class transformed name
  `classNode` - Class tree
Returns:
  true if the class was transformed

#### couldTransformClass

    boolean couldTransformClass​(MixinEnvironment environment,
                                java.lang.String name)

Determines whether mixin could transform the provided class, without actually running the transformation

Parameters:
  `environment` - Current environment
  `name` - Class transformed name
Returns:
  true if the class could be transformed

#### generateClass

    byte[] generateClass​(MixinEnvironment environment,
                         java.lang.String name)

Generate the specified mixin-synthetic class

Parameters:
  `environment` - Current environment
  `name` - Class name to generate
Returns:
  Generated bytecode or `null` if no class was generated

#### generateClass

    boolean generateClass​(MixinEnvironment environment,
                          java.lang.String name,
                          org.objectweb.asm.tree.ClassNode classNode)

Parameters:
  `environment` - Current environment
  `name` - Class transformed name
  `classNode` - Empty classnode to populate
Returns:
  True if the class was generated successfully

#### getExtensions

    IExtensionRegistry getExtensions()

Get the transformer extensions