Class FieldAccess


  • public class FieldAccess
    extends JavaExpression
    A FieldAccess represents a field access. It does not represent a class literal such as SomeClass.class or int[].class.
    • Field Detail

      • receiver

        protected final JavaExpression receiver
        The receiver of the field access.
      • field

        protected final javax.lang.model.element.VariableElement field
        The field being accessed.
    • Constructor Detail

      • FieldAccess

        public FieldAccess​(JavaExpression receiver,
                           FieldAccessNode node)
        Create a FieldAccess.
        Parameters:
        receiver - receiver of the field access
        node - the FieldAccessNode
      • FieldAccess

        public FieldAccess​(JavaExpression receiver,
                           javax.lang.model.element.VariableElement fieldElement)
        Create a FieldAccess.
        Parameters:
        receiver - receiver of the field access
        fieldElement - element of the field
      • FieldAccess

        public FieldAccess​(JavaExpression receiver,
                           javax.lang.model.type.TypeMirror type,
                           javax.lang.model.element.VariableElement fieldElement)
        Create a FieldAccess.
        Parameters:
        receiver - receiver of the field access
        type - type of the field
        fieldElement - element of the field
    • Method Detail

      • getReceiver

        public JavaExpression getReceiver()
        Returns the receiver.
        Returns:
        the receiver
      • getField

        public javax.lang.model.element.VariableElement getField()
        Returns the field.
        Returns:
        the field
      • isFinal

        public boolean isFinal()
      • isStatic

        public boolean isStatic()
      • equals

        public boolean equals​(@Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • containsSyntacticEqualJavaExpression

        public boolean containsSyntacticEqualJavaExpression​(JavaExpression other)
        Description copied from class: JavaExpression
        Returns true if and only if this contains a JavaExpression that is syntactically equal to other.
        Specified by:
        containsSyntacticEqualJavaExpression in class JavaExpression
        Parameters:
        other - the JavaExpression to search for
        Returns:
        true if and only if this contains a JavaExpression that is syntactically equal to other
      • containsModifiableAliasOf

        public boolean containsModifiableAliasOf​(Store<?> store,
                                                 JavaExpression other)
        Description copied from class: JavaExpression
        Returns true if and only if other appears anywhere in this or an expression appears in this such that other might alias this expression, and that expression is modifiable.

        This is always true, except for cases where the Java type information prevents aliasing and none of the subexpressions can alias 'other'.

        Overrides:
        containsModifiableAliasOf in class JavaExpression
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringDebug

        public java.lang.String toStringDebug()
        Description copied from class: JavaExpression
        Format this verbosely, for debugging.
        Overrides:
        toStringDebug in class JavaExpression
        Returns:
        a verbose string representation of this
      • isDeterministic

        public boolean isDeterministic​(AnnotationProvider provider)
        Description copied from class: JavaExpression
        Returns true if the expression is deterministic.
        Specified by:
        isDeterministic in class JavaExpression
        Parameters:
        provider - an annotation provider (a type factory)
        Returns:
        true if this expression is deterministic
      • accept

        public <R,​P> R accept​(JavaExpressionVisitor<R,​P> visitor,
                                    P p)
        Description copied from class: JavaExpression
        Accept method of the visitor pattern.
        Specified by:
        accept in class JavaExpression
        Type Parameters:
        R - result type of the operation
        P - parameter type
        Parameters:
        visitor - the visitor to be applied to this JavaExpression
        p - the parameter for this operation
        Returns:
        the result of visiting this