Class Expression

All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>, NodeMetaDataHandler
Direct Known Subclasses:
AbstractGinqExpression, ArrayExpression, BinaryExpression, BitwiseNegationExpression, BooleanExpression, BytecodeExpression, CastExpression, ClassExpression, ClosureExpression, ConstantExpression, ConstructorCallExpression, EmptyExpression, FieldExpression, GStringExpression, ListExpression, ListOfExpressionsExpression, MapEntryExpression, MapExpression, MethodCallExpression, MethodPointerExpression, PostfixExpression, PrefixExpression, PropertyExpression, RangeExpression, SpreadExpression, SpreadMapExpression, StaticMethodCallExpression, TemporaryVariableExpression, TernaryExpression, TupleExpression, UnaryMinusExpression, UnaryPlusExpression, VariableExpression

public abstract class Expression extends AnnotatedNode
Base class for any expression.
  • Field Details

    • EMPTY_ARRAY

      public static final Expression[] EMPTY_ARRAY
  • Constructor Details

    • Expression

      public Expression()
  • Method Details

    • getType

      public ClassNode getType()
    • setType

      public void setType(ClassNode type)
    • transformExpression

      public abstract Expression transformExpression(ExpressionTransformer transformer)
      Transforms this expression and any nested expressions.
    • transformExpressions

      protected List<Expression> transformExpressions(List<? extends Expression> expressions, ExpressionTransformer transformer)
      Transforms list of expressions.
      Returns:
      a new list of transformed expressions
    • transformExpressions

      protected <T extends Expression> List<T> transformExpressions(List<? extends Expression> expressions, ExpressionTransformer transformer, Class<T> targetType)
      Transforms list of expressions and checks that all transformed expressions have the given type.
      Returns:
      a new type-safe list of transformed expressions