Class InsnListEx

    • Field Detail

      • target

        protected final Target target
        The target method
    • Constructor Detail

      • InsnListEx

        public InsnListEx​(Target target)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getTargetName

        public java.lang.String getTargetName()
        Description copied from interface: IInsnListEx
        Get the name of the target method
        Specified by:
        getTargetName in interface IInsnListEx
      • getTargetDesc

        public java.lang.String getTargetDesc()
        Description copied from interface: IInsnListEx
        Get the descriptor of the target method
        Specified by:
        getTargetDesc in interface IInsnListEx
      • getTargetSignature

        public java.lang.String getTargetSignature()
        Description copied from interface: IInsnListEx
        Get the signature of the target method
        Specified by:
        getTargetSignature in interface IInsnListEx
      • getTargetAccess

        public int getTargetAccess()
        Description copied from interface: IInsnListEx
        Get the access flags from the target method
        Specified by:
        getTargetAccess in interface IInsnListEx
      • isTargetStatic

        public boolean isTargetStatic()
        Description copied from interface: IInsnListEx
        Get whether the target method is static
        Specified by:
        isTargetStatic in interface IInsnListEx
      • isTargetConstructor

        public boolean isTargetConstructor()
        Description copied from interface: IInsnListEx
        Get whether the target method is a constructor
        Specified by:
        isTargetConstructor in interface IInsnListEx
      • isTargetStaticInitialiser

        public boolean isTargetStaticInitialiser()
        Description copied from interface: IInsnListEx
        Get whether the target method is a static initialiser
        Specified by:
        isTargetStaticInitialiser in interface IInsnListEx
      • getSpecialNode

        public org.objectweb.asm.tree.AbstractInsnNode getSpecialNode​(IInsnListEx.SpecialNodeType type)
        Description copied from interface: IInsnListEx
        Get - if available - the specified special node from the target. The returned node is not guaranteed to be non-null.
        Specified by:
        getSpecialNode in interface IInsnListEx
        Parameters:
        type - type of special node to fetch
        Returns:
        the special node or null if not available
      • decorate

        public <V> InsnListEx decorate​(java.lang.String key,
                                       V value)
        Decorate this insn list with arbitrary metadata for use by context-specific injection points
        Type Parameters:
        V - value type
        Parameters:
        key - meta key
        value - meta value
        Returns:
        fluent
      • undecorate

        public InsnListEx undecorate​(java.lang.String key)
        Strip a specific decoration from this list if the decoration exists
        Parameters:
        key - meta key
        Returns:
        fluent
      • undecorate

        public InsnListEx undecorate()
        Strip all decorations from this list
        Returns:
        fluent
      • hasDecoration

        public boolean hasDecoration​(java.lang.String key)
        Get whether this list is decorated with the specified key
        Specified by:
        hasDecoration in interface IInsnListEx
        Parameters:
        key - meta key
        Returns:
        true if the specified decoration exists
      • getDecoration

        public <V> V getDecoration​(java.lang.String key)
        Get the specified decoration
        Specified by:
        getDecoration in interface IInsnListEx
        Type Parameters:
        V - value type
        Parameters:
        key - meta key
        Returns:
        decoration value or null if absent
      • getDecoration

        public <V> V getDecoration​(java.lang.String key,
                                   V defaultValue)
        Get the specified decoration or default value
        Specified by:
        getDecoration in interface IInsnListEx
        Type Parameters:
        V - value type
        Parameters:
        key - meta key
        defaultValue - default value to return
        Returns:
        decoration value or null if absent