VariableAccessReplacer (Groovy 5.0.6)
Description: declaration: package: org.codehaus.groovy.transform.tailrec, class: VariableAccessReplacer

Package org.codehaus.groovy.transform.tailrec

# Class VariableAccessReplacer

java.lang.Object
org.codehaus.groovy.transform.tailrec.VariableAccessReplacer

public class VariableAccessReplacer extends Object
Replace all access to variables and args by new variables. The variable names to replace as well as their replacement name and type have to be configured in nameAndTypeMapping before calling replaceIn().

The VariableReplacedListener can be set if clients want to react to variable replacement.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VariableAccessReplacer(Map<String,Map> nameAndTypeMapping)`
  `VariableAccessReplacer(Map<String,Map> nameAndTypeMapping, VariableReplacedListener listener)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `VariableReplacedListener`
  `getListener()`
  `void`
  `replaceIn(ASTNode root)`
  `void`
  `setListener(VariableReplacedListener listener)`
  `void`
  `setNameAndTypeMapping(Map<String,Map> nameAndTypeMapping)`

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

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

- ## Constructor Details

  - ### VariableAccessReplacer

    public VariableAccessReplacer(Map<String,Map> nameAndTypeMapping)

  - ### VariableAccessReplacer

    public VariableAccessReplacer(Map<String,Map> nameAndTypeMapping, VariableReplacedListener listener)

- ## Method Details

  - ### replaceIn

    public void replaceIn(ASTNode root)

  - ### setNameAndTypeMapping

    public void setNameAndTypeMapping(Map<String,Map> nameAndTypeMapping)

  - ### getListener

    public VariableReplacedListener getListener()

  - ### setListener

    public void setListener(VariableReplacedListener listener)