Class InvokeDynamicExpr

  • All Implemented Interfaces:
    ASTNode, Expression

    public final class InvokeDynamicExpr
    extends Object
    implements Expression
    An invokedynamic call whose bootstrap method was not a recognized pattern, preserving the bootstrap information and call arguments for display.
    • Constructor Detail

      • InvokeDynamicExpr

        public InvokeDynamicExpr​(String name,
                                 String descriptor,
                                 List<Expression> arguments,
                                 String bootstrapOwner,
                                 String bootstrapName,
                                 SourceType type)
        Creates an invokedynamic expression with full bootstrap information; null arguments fall back to placeholders.
        Parameters:
        name - the invoked method name
        descriptor - the method descriptor
        arguments - the call arguments, or null for none
        bootstrapOwner - the bootstrap method owner class
        bootstrapName - the bootstrap method name
        type - the inferred return type, or null for Object
      • InvokeDynamicExpr

        public InvokeDynamicExpr​(String name,
                                 String descriptor,
                                 List<Expression> arguments,
                                 SourceType type)
        Creates an invokedynamic expression with unknown bootstrap owner and name.
        Parameters:
        name - the invoked method name
        descriptor - the method descriptor
        arguments - the call arguments, or null for none
        type - the inferred return type, or null for Object
    • Method Detail

      • getName

        public String getName()
        Returns:
        the name
      • getDescriptor

        public String getDescriptor()
        Returns:
        the descriptor
      • getArguments

        public List<Expression> getArguments()
        Returns:
        the arguments
      • getBootstrapOwner

        public String getBootstrapOwner()
        Returns:
        the bootstrap owner
      • getBootstrapName

        public String getBootstrapName()
        Returns:
        the bootstrap name
      • getType

        public SourceType getType()
        Description copied from interface: Expression
        Gets the inferred type of this expression.
        Specified by:
        getType in interface Expression
        Returns:
        the type
      • setType

        public void setType​(SourceType type)
        Parameters:
        type - the new inferred return type
      • getLocation

        public SourceLocation getLocation()
        Description copied from interface: ASTNode
        Gets the source location of this node.
        Specified by:
        getLocation in interface ASTNode
        Returns:
        the location
      • getParent

        public ASTNode getParent()
        Description copied from interface: ASTNode
        Gets the parent node in the AST tree.
        Specified by:
        getParent in interface ASTNode
        Returns:
        the parent
      • setParent

        public void setParent​(ASTNode parent)
        Description copied from interface: ASTNode
        Sets the parent node in the AST tree.
        Specified by:
        setParent in interface ASTNode
        Parameters:
        parent - the enclosing AST node
      • getBootstrapClassArgs

        public List<String> getBootstrapClassArgs()
        Returns:
        the bootstrap class args
      • setBootstrapClassArgs

        public void setBootstrapClassArgs​(List<String> bootstrapClassArgs)
        Parameters:
        bootstrapClassArgs - the internal names of the typeSwitch case-type bootstrap arguments
      • accept

        public <T> T accept​(SourceVisitor<T> visitor)
        Description copied from interface: ASTNode
        Accepts a visitor for this node.
        Specified by:
        accept in interface ASTNode
        Type Parameters:
        T - the return type of the visitor
        Parameters:
        visitor - the visitor to accept
        Returns:
        the result from the visitor
      • getFormattedBootstrapMethod

        public String getFormattedBootstrapMethod()
        Returns:
        the bootstrap method reference as owner.method with dots for slashes