Class LocalVariableReferenceFunction

java.lang.Object
spoon.reflect.visitor.filter.LocalVariableReferenceFunction
All Implemented Interfaces:
CtConsumableFunction<CtElement>
Direct Known Subclasses:
CatchVariableReferenceFunction, ParameterReferenceFunction

public class LocalVariableReferenceFunction extends Object implements CtConsumableFunction<CtElement>
This mapping function expects a CtLocalVariable as input and returns all CtLocalVariableReferences, which refers this input.
Usage:
 
 CtLocalVariable var = ...;
 var
   .map(new LocalVariableReferenceFunction())
   .forEach((CtLocalVariableReference ref)->...process references...);
 
 
  • Constructor Details

    • LocalVariableReferenceFunction

      public LocalVariableReferenceFunction()
    • LocalVariableReferenceFunction

      public LocalVariableReferenceFunction(CtLocalVariable<?> localVariable)
      This constructor allows to define input local variable - the one for which this function will search for. In such case the input of mapping function represents the scope where this local variable is searched for.
      Parameters:
      localVariable - - the local variable declaration which is searched in scope of input element of this mapping function.
  • Method Details