Package de.geolykt.starloader.transformers

# Class ReversibleAccessSetterTransformer

java.lang.Object
de.geolykt.starloader.transformers.ASMTransformer
de.geolykt.starloader.transformers.ReversibleAccessSetterTransformer

All Implemented Interfaces:
  `Comparable<ASMTransformer>`

public class ReversibleAccessSetterTransformer extends ASMTransformer
An `ASMTransformer` that implements the transformation of class files via reversible access setters (RAS).

Since:
  4.0.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReversibleAccessSetterTransformer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `accept(@NotNull org.objectweb.asm.tree.ClassNode node)`
  Transforms the provided `ClassNode` to the transformer's liking.
  `@NotNull de.geolykt.starloader.ras.ReversibleAccessSetterContext`
  `getMainContext()`
  `int`
  `getPriority()`
  Obtains the priority of this transformer.
  `@NotNull de.geolykt.starloader.ras.ReversibleAccessSetterContext`
  `getReverseContext()`
  `boolean`
  `isValidTarget(@NotNull String internalName)`
  Checks whether the given class denoted by the internal name would be a valid potential transformation target.

  ### Methods inherited from class de.geolykt.starloader.transformers.ASMTransformer

  `compareTo, isValid`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReversibleAccessSetterTransformer

    public ReversibleAccessSetterTransformer()

- ## Method Details

  - ### accept

    public boolean accept(@NotNull @NotNull org.objectweb.asm.tree.ClassNode node)
    Description copied from class: `ASMTransformer`
    Transforms the provided `ClassNode` to the transformer's liking. Must return true if the class node has been modified, should it not returns false, then the transformation MAY be discarded, however it could also not be discarded. It is best to assume that both are equally possible events.
    Specified by:
      `accept` in class `ASMTransformer`
    Parameters:
      `node` - The node to transform
    Returns:
      True if the node has been modified.

  - ### getMainContext

    @NotNull public @NotNull de.geolykt.starloader.ras.ReversibleAccessSetterContext getMainContext()

  - ### getPriority

    public int getPriority()
    Description copied from class: `ASMTransformer`
    Obtains the priority of this transformer. The priority is used to note when a transformer should be applied in relation to other transformers. Should two transformers have the same priority, the order will be arbitrary.

    Transformers with a lower numeric priority value are run first. That is, the higher the priority of a transformer, the more "final" it's descision is.

    Important transform priorities are:

    - -10_010: `ReversibleAccessSetterTransformer`
    - -10_010: `StarplaneAnnotationsInlineTransformer`
    - -10_000: `ASMMixinTransformer`
    - -9_900: Most SLAPI transformers
    - 100: SLAPI GL transformer (intercepts GL11#glScissor calls)
    Overrides:
      `getPriority` in class `ASMTransformer`
    Returns:
      The priority of the transformer

  - ### getReverseContext

    @NotNull public @NotNull de.geolykt.starloader.ras.ReversibleAccessSetterContext getReverseContext()

  - ### isValidTarget

    public boolean isValidTarget(@NotNull @NotNull String internalName)
    Description copied from class: `ASMTransformer`
    Checks whether the given class denoted by the internal name would be a valid potential transformation target. If this method returns false, then `ASMTransformer.accept(ClassNode)` should NOT be called, however if it returns true, then it may get called. `ASMTransformer.accept(ClassNode)` will not always return true when this method does, however that method should never return true when this method returns false.
    Specified by:
      `isValidTarget` in class `ASMTransformer`
    Parameters:
      `internalName` - The internal name of the class
    Returns:
      Whether it is a potential target
    See Also:
      - `Type.getInternalName()`