Interface InvocationNode

All Superinterfaces:
net.sourceforge.pmd.lang.ast.impl.GenericNode<JavaNode>, JavaNode, net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode<JavaNode>, MethodUsage, net.sourceforge.pmd.lang.ast.Node, net.sourceforge.pmd.reporting.Reportable, net.sourceforge.pmd.lang.ast.TextAvailableNode, TypeNode
All Known Implementing Classes:
ASTConstructorCall, ASTEnumConstant, ASTExplicitConstructorInvocation, ASTMethodCall

public interface InvocationNode extends TypeNode, MethodUsage
Groups method and constructor call, together, as well as explicit constructor invocation statements, and enum constant declarations. Those last two are included, because they are special syntax to call a constructor.

The arguments of the invocation are said to be in an "invocation context", which influences what conversions they are subject to. It also means the type of the arguments may depend on the resolution of the compile-time declaration of this node.

  • Field Summary

    Fields inherited from interface net.sourceforge.pmd.lang.ast.Node

    COORDS_COMPARATOR
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable ASTArgumentList
    Returns the node representing the list of arguments passed to the invocation.
    Returns the explicit type arguments if they exist.
    default JMethodSig
    Gets the type of the method or constructor that is called by this node.

    Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode

    ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSibling

    Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode

    getEnclosingType, getRoot, getSymbolTable, getTypeSystem

    Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode

    getFirstToken, getLastToken, tokens

    Methods inherited from interface net.sourceforge.pmd.lang.java.ast.MethodUsage

    getMethodName, getOverloadSelectionInfo

    Methods inherited from interface net.sourceforge.pmd.lang.ast.Node

    acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getIndexInParent, getLanguageVersion, getNumChildren, getReportLocation, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundary

    Methods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode

    getOriginalText, getText, getTextRegion

    Methods inherited from interface net.sourceforge.pmd.lang.java.ast.TypeNode

    getTypeMirror, getTypeMirror
  • Method Details

    • getArguments

      @Nullable ASTArgumentList getArguments()
      Returns the node representing the list of arguments passed to the invocation. Can be null if this is an ASTEnumConstant.
    • getExplicitTypeArguments

      @Nullable ASTTypeArguments getExplicitTypeArguments()
      Returns the explicit type arguments if they exist.
    • getMethodType

      default JMethodSig getMethodType()
      Gets the type of the method or constructor that is called by this node. See OverloadSelectionResult.getMethodType().