Package org.apache.sling.scripting.sightly.impl.compiler.optimization

## Class VariableFinder

- java.lang.Object
- - org.apache.sling.scripting.sightly.compiler.expression.SideEffectVisitor
  - - org.apache.sling.scripting.sightly.impl.compiler.optimization.VariableFinder

All Implemented Interfaces:
  `NodeVisitor<Object>`

    public class VariableFinder
    extends SideEffectVisitor

SideEffectVisitor which extracts all the variables from an expression.

### Constructor Summary

Constructors
`VariableFinder​(Set<String> variables)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static Set<String>` `findVariables​(ExpressionNode node)`
`void` `visit​(ArrayLiteral arrayLiteral)`
`void` `visit​(BinaryOperation binaryOperation)`
`void` `visit​(BooleanConstant booleanConstant)`
`void` `visit​(Identifier identifier)`
`void` `visit​(MapLiteral mapLiteral)`
`void` `visit​(NullLiteral nullLiteral)`
`void` `visit​(NumericConstant numericConstant)`
`void` `visit​(PropertyAccess propertyAccess)`
`void` `visit​(RuntimeCall runtimeCall)`
`void` `visit​(StringConstant text)`
`void` `visit​(TernaryOperator ternaryOperator)`
`void` `visit​(UnaryOperation unaryOperation)`

### Methods inherited from class org.apache.sling.scripting.sightly.compiler.expression.SideEffectVisitor

`evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate`

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

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

### Constructor Detail

#### VariableFinder

    public VariableFinder​(Set<String> variables)

### Method Detail

#### findVariables

    public static Set<String> findVariables​(ExpressionNode node)

#### visit

    public void visit​(PropertyAccess propertyAccess)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(Identifier identifier)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(StringConstant text)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(BinaryOperation binaryOperation)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(BooleanConstant booleanConstant)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(NumericConstant numericConstant)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(UnaryOperation unaryOperation)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(TernaryOperator ternaryOperator)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(RuntimeCall runtimeCall)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(MapLiteral mapLiteral)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(ArrayLiteral arrayLiteral)

Specified by:
  `visit` in class `SideEffectVisitor`

#### visit

    public void visit​(NullLiteral nullLiteral)

Specified by:
  `visit` in class `SideEffectVisitor`