Interface Expression

All Superinterfaces:
J, org.openrewrite.Tree
All Known Subinterfaces:
MethodCall
All Known Implementing Classes:
J.AnnotatedType, J.Annotation, J.ArrayAccess, J.ArrayType, J.Assignment, J.AssignmentOperation, J.Binary, J.ControlParentheses, J.Empty, J.FieldAccess, J.Identifier, J.InstanceOf, J.Lambda, J.Literal, J.MemberReference, J.MethodInvocation, J.NewArray, J.NewClass, J.ParameterizedType, J.Parentheses, J.Primitive, J.Ternary, J.TypeCast, J.Unary, J.Wildcard

public interface Expression extends J
  • Method Details

    • getType

      @Nullable @Nullable JavaType getType()
    • withType

      <T extends J> T withType(@Nullable @Nullable JavaType type)
    • getSideEffects

      default List<J> getSideEffects()
      Returns:
      A list of the side effects emitted by the statement, if the statement was decomposed. So for a binary operation, there are up to two potential side effects (the left and right side) and as few as zero if both sides of the expression are something like constants or variable references.
    • unwrap

      default Expression unwrap()
      If this expression is a J.Parentheses return the expression inside the parentheses this. Otherwise, return this. This operation is performed recursively to return the first non-parenthetical expression.
      Returns:
      The expression as if all surround parentheses were removed. Never a J.Parentheses instance.
    • unwrap

      @Nullable static @Nullable Expression unwrap(@Nullable @Nullable Expression expr)
    • getCoordinates