Class MethodDelegationBinder.ParameterBinding.Unique<T>

    • Field Detail

      • identificationToken

        private final T identificationToken
        The token that identifies this parameter binding as unique.
      • delegate

        private final StackManipulation delegate
        The stack manipulation that represents the loading of the parameter binding onto the stack.
    • Constructor Detail

      • Unique

        public Unique​(StackManipulation delegate,
                      T identificationToken)
        Creates a new unique parameter binding representant.
        Parameters:
        delegate - The stack manipulation that loads the argument for this parameter onto the operand stack.
        identificationToken - The token used for identifying this parameter binding.
    • Method Detail

      • of

        public static <S> MethodDelegationBinder.ParameterBinding.Unique<S> of​(StackManipulation delegate,
                                                                               S identificationToken)
        A factory method for creating a unique binding that infers the tokens type.
        Type Parameters:
        S - The type of the identification token.
        Parameters:
        delegate - The stack manipulation delegate.
        identificationToken - The identification token.
        Returns:
        A new instance representing this unique binding.
      • isValid

        public boolean isValid()
        Determines if this stack manipulation is valid.
        Specified by:
        isValid in interface StackManipulation
        Returns:
        If false, this manipulation cannot be applied and should throw an exception.
      • apply

        public StackManipulation.Size apply​(org.objectweb.asm.MethodVisitor methodVisitor,
                                            Implementation.Context implementationContext)
        Applies the stack manipulation that is described by this instance.
        Specified by:
        apply in interface StackManipulation
        Parameters:
        methodVisitor - The method visitor used to write the method implementation to.
        implementationContext - The context of the current implementation.
        Returns:
        The changes to the size of the operand stack that are implied by this stack manipulation.