Class ExtensionMethodNode

All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>, NodeMetaDataHandler

public class ExtensionMethodNode extends MethodNode
Represents method nodes which are used by the static type checker to virtually add methods coming from DGM-like methods.
  • Constructor Details

    • ExtensionMethodNode

      public ExtensionMethodNode(MethodNode extensionMethodNode, String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code, boolean isStaticExtension)
      Builds a synthetic method the type checker can select in place of extensionMethodNode. The declaration passed here is what callers see; getExtensionMethodNode() keeps the original.
      Parameters:
      extensionMethodNode - original extension method
      name - name presented to the type checker
      modifiers - access flags of the synthetic method
      returnType - return type presented to the type checker
      parameters - parameters presented to the type checker
      exceptions - exceptions presented to the type checker
      code - method body forwarded to MethodNode
      isStaticExtension - true when the original method is a static extension
    • ExtensionMethodNode

      public ExtensionMethodNode(MethodNode extensionMethodNode, String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code)
      Builds a non-static extension node by passing false as the static-extension flag to the other constructor.
      Parameters:
      extensionMethodNode - original extension method
      name - name presented to the type checker
      modifiers - access flags of the synthetic method
      returnType - return type presented to the type checker
      parameters - parameters presented to the type checker
      exceptions - exceptions presented to the type checker
      code - method body forwarded to MethodNode
  • Method Details

    • getExtensionMethodNode

      public MethodNode getExtensionMethodNode()
      Returns the original extension method represented by this synthetic node.
    • isStaticExtension

      public boolean isStaticExtension()
      Indicates whether this node models a static extension method.