Package org.codehaus.groovy.macro.runtime

# Class MacroContext

java.lang.Object
org.codehaus.groovy.macro.runtime.MacroContext

public class MacroContext extends Object
Macro method context. Every macro method must be an extension method of it.

Since:
  2.5.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MacroContext(CompilationUnit compilationUnit, SourceUnit sourceUnit, MethodCallExpression call)`
  Creates a macro context for the current macro method invocation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MethodCallExpression`
  `getCall()`
  `CompilationUnit`
  `getCompilationUnit()`
  `SourceUnit`
  `getSourceUnit()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MacroContext

    public MacroContext(CompilationUnit compilationUnit, SourceUnit sourceUnit, MethodCallExpression call)
    Creates a macro context for the current macro method invocation.
    Parameters:
      `compilationUnit` - the current compilation unit
      `sourceUnit` - the current source unit
      `call` - the original macro call expression

- ## Method Details

  - ### getCall

    public MethodCallExpression getCall()
    Returns:
      original method call expression

  - ### getSourceUnit

    public SourceUnit getSourceUnit()
    Returns:
      current source unit

  - ### getCompilationUnit

    public CompilationUnit getCompilationUnit()
    Returns:
      current compilation unit