Package org.spongepowered.asm.mixin.injection.code

## Class InjectorTarget

- java.lang.Object
- - org.spongepowered.asm.mixin.injection.code.InjectorTarget

-     public class InjectorTarget
      extends java.lang.Object

  Couples `method slices` to a `Target` for injection purposes.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InjectorTarget​(ISliceContext context, Target target, TargetSelectors.SelectedMethod selectedMethod)` | ctor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `InjectionNodes.InjectionNode` | `addInjectionNode​(org.objectweb.asm.tree.AbstractInsnNode node)` | Add an injection node to this target if it does not already exist, returns the existing node if it exists
    `void` | `dispose()` | Dispose all cached instruction lists
    `java.lang.String` | `getDesc()` | Get the target method descriptor
    `InjectionNodes.InjectionNode` | `getInjectionNode​(org.objectweb.asm.tree.AbstractInsnNode node)` | Get an injection node from this collection if it already exists, returns null if the node is not tracked
    `java.lang.String` | `getMergedBy()` | Get the name of the mixin which merged this method, returns null for non- mixin methods
    `int` | `getMergedPriority()` | Get the priority of the mixin which merged this method, or default priority for non-mixin methods
    `org.objectweb.asm.tree.MethodNode` | `getMethod()` | Get the target method
    `java.lang.String` | `getName()` | Get the target method name
    `TargetSelectors.SelectedMethod` | `getSelectedMethod()` | Get the selector which selected this target
    `java.lang.String` | `getSignature()` | Get the target method signature
    `org.objectweb.asm.tree.InsnList` | `getSlice​(java.lang.String id)` | Get the slice instructions for the specified slice id
    `org.objectweb.asm.tree.InsnList` | `getSlice​(InjectionPoint injectionPoint)` | Get the slice instructions for the specified injection point
    `Target` | `getTarget()` | Get the target reference
    `boolean` | `isMerged()` | Get whether this target method was merged by another mixin
    `java.lang.String` | `toString()` |

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

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

- - ### Constructor Detail

    - #### InjectorTarget

          public InjectorTarget​(ISliceContext context,
                                Target target,
                                TargetSelectors.SelectedMethod selectedMethod)

      ctor
      Parameters:
        `context` - owner
        `target` - target

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### addInjectionNode

          public InjectionNodes.InjectionNode addInjectionNode​(org.objectweb.asm.tree.AbstractInsnNode node)

      Add an injection node to this target if it does not already exist, returns the existing node if it exists
      Parameters:
        `node` - Instruction node to add
      Returns:
        wrapper for the specified node

    - #### getInjectionNode

          public InjectionNodes.InjectionNode getInjectionNode​(org.objectweb.asm.tree.AbstractInsnNode node)

      Get an injection node from this collection if it already exists, returns null if the node is not tracked
      Parameters:
        `node` - instruction node
      Returns:
        wrapper node or null if not tracked

    - #### getName

          public java.lang.String getName()

      Get the target method name

    - #### getDesc

          public java.lang.String getDesc()

      Get the target method descriptor

    - #### getSignature

          public java.lang.String getSignature()

      Get the target method signature

    - #### getTarget

          public Target getTarget()

      Get the target reference

    - #### getMethod

          public org.objectweb.asm.tree.MethodNode getMethod()

      Get the target method

    - #### getSelectedMethod

          public TargetSelectors.SelectedMethod getSelectedMethod()

      Get the selector which selected this target

    - #### isMerged

          public boolean isMerged()

      Get whether this target method was merged by another mixin

    - #### getMergedBy

          public java.lang.String getMergedBy()

      Get the name of the mixin which merged this method, returns null for non- mixin methods

    - #### getMergedPriority

          public int getMergedPriority()

      Get the priority of the mixin which merged this method, or default priority for non-mixin methods

    - #### getSlice

          public org.objectweb.asm.tree.InsnList getSlice​(java.lang.String id)

      Get the slice instructions for the specified slice id
      Parameters:
        `id` - slice id
      Returns:
        insn slice

    - #### getSlice

          public org.objectweb.asm.tree.InsnList getSlice​(InjectionPoint injectionPoint)

      Get the slice instructions for the specified injection point
      Parameters:
        `injectionPoint` - injection point to fetch slice for
      Returns:
        slice

    - #### dispose

          public void dispose()

      Dispose all cached instruction lists