Class J.FieldAccess

java.lang.Object
org.openrewrite.java.tree.J.FieldAccess
All Implemented Interfaces:
Expression, J, NameTree, Statement, TypedTree, TypeTree, org.openrewrite.Tree
Enclosing interface:
J

public static final class J.FieldAccess extends Object implements J, TypeTree, Expression, Statement
  • Constructor Details

    • FieldAccess

      public FieldAccess()
  • Method Details

    • getName

      public J.Identifier getName()
    • withName

      public J.FieldAccess withName(J.Identifier name)
    • acceptJava

      public <P> J acceptJava(JavaVisitor<P> v, P p)
      Specified by:
      acceptJava in interface J
    • getSimpleName

      public String getSimpleName()
    • getSideEffects

      public List<J> getSideEffects()
      Specified by:
      getSideEffects in interface Expression
      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.
    • asClassReference

      @Nullable public @Nullable NameTree asClassReference()
      Returns:
      For expressions like String.class, this casts target expression to a NameTree. If the field access is not a reference to a class type, returns null.
    • isFullyQualifiedClassReference

      public boolean isFullyQualifiedClassReference(String className)
    • getPadding

      public J.FieldAccess.Padding getPadding()
    • getCoordinates

      public CoordinateBuilder.Statement getCoordinates()
      Specified by:
      getCoordinates in interface Expression
      Specified by:
      getCoordinates in interface Statement
    • toString

      public String toString()
      Overrides:
      toString in class Object