Class InjectionPointData

java.lang.Object
org.spongepowered.asm.mixin.injection.struct.InjectionPointData

public class InjectionPointData extends Object
Data read from an At annotation and passed into an InjectionPoint ctor
  • Constructor Details

  • Method Details

    • getMessageSink

      public IMessageSink getMessageSink()
      Get the message sink for this injection point
    • getAt

      public String getAt()
      Get the at value on the injector
    • getType

      public String getType()
      Get the parsed constructor type for this injector
    • getSpecifier

      public InjectionPoint.Specifier getSpecifier()
      Get the specifier value parsed from the injector
    • getTargetRestriction

      public InjectionPoint.RestrictTargetLevel getTargetRestriction()
      Get the target restriction specified in the annotation
    • getContext

      public IInjectionPointContext getContext()
      Get the injection point context
    • getMixin

      public IMixinContext getMixin()
      Get the mixin context
    • getMethod

      public org.objectweb.asm.tree.MethodNode getMethod()
      Get the annotated method
    • getMethodReturnType

      public org.objectweb.asm.Type getMethodReturnType()
      Get the return type of the annotated method
    • getParent

      public org.objectweb.asm.tree.AnnotationNode getParent()
      Get the root annotation (eg. Inject)
    • getSlice

      public String getSlice()
      Get the slice id specified on the injector
    • getLocalVariableDiscriminator

      public LocalVariableDiscriminator getLocalVariableDiscriminator()
    • get

      public String get(String key, String defaultValue)
      Get the supplied value from the named args, return defaultValue if the arg is not set
      Parameters:
      key - argument name
      defaultValue - value to return if the arg is not set
      Returns:
      argument value or default if not set
    • get

      public int get(String key, int defaultValue)
      Get the supplied value from the named args, return defaultValue if the arg is not set
      Parameters:
      key - argument name
      defaultValue - value to return if the arg is not set
      Returns:
      argument value or default if not set
    • get

      public boolean get(String key, boolean defaultValue)
      Get the supplied value from the named args, return defaultValue if the arg is not set
      Parameters:
      key - argument name
      defaultValue - value to return if the arg is not set
      Returns:
      argument value or default if not set
    • get

      public <T extends Enum<T>> T get(String key, T defaultValue)
      Get the supplied value from the named args, return defaultValue if the arg is not set
      Type Parameters:
      T - enum type
      Parameters:
      key - argument name
      defaultValue - value to return if the arg is not set
      Returns:
      argument value or default if not set
    • get

      public ITargetSelector get(String key)
      Get the supplied value from the named args as a target selector, throws an exception if the argument cannot be parsed as a target selector
      Parameters:
      key - argument name
      Returns:
      argument value as a target selector
    • getTarget

      public ITargetSelector getTarget()
      Get the target value specified on the injector
    • getDescription

      public String getDescription()
      Get a description of this injector for use in error messages
    • getOrdinal

      public int getOrdinal()
      Get the ordinal specified on the injection point
    • getOpcode

      public int getOpcode()
      Get the opcode specified on the injection point
    • getOpcode

      public int getOpcode(int defaultOpcode)
      Get the opcode specified on the injection point or return the default if no opcode was specified
      Parameters:
      defaultOpcode - opcode to return if none specified
      Returns:
      opcode or default
    • getOpcode

      public int getOpcode(int defaultOpcode, int... validOpcodes)
      Get the opcode specified on the injection point or return the default if no opcode was specified or if the specified opcode does not appear in the supplied list of valid opcodes
      Parameters:
      defaultOpcode - opcode to return if none specified
      validOpcodes - valid opcodes
      Returns:
      opcode or default
    • getOpcodeList

      public int[] getOpcodeList(String key, int[] defaultValue)
      Get a list of opcodes specified in the injection point arguments. The opcodes can be specified as raw integer values or as their corresponding constant name from the
      invalid reference
      Opcodes
      interface. All the values should be separated by spaces or commas. The returned array is sorted in order to make it suitable for use with the
      invalid reference
      Arrays#binarySearch
      method.
      Parameters:
      key - argument name
      defaultValue - value to return if the key is not specified
      Returns:
      parsed opcodes as array or default value if the key is not specified in the args
    • getId

      public String getId()
      Get the id specified on the injection point (or null if not specified)
    • isUnsafe

      public boolean isUnsafe()
      Get whether the unsafe option is set on the injection point
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parseType

      public static String parseType(String at)
      Parse a constructor type from the supplied at string
      Parameters:
      at - at to parse
      Returns:
      parsed constructor type