Class FieldExpression

All Implemented Interfaces:
Cloneable, Constants, RuntimeConstants

public class FieldExpression extends UnaryExpression
WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
  • Constructor Details

  • Method Details

    • getImplementation

      public Expression getImplementation()
      Description copied from class: Expression
      Type checking may assign a more complex implementation to an innocuous-looking expression (like an identifier). Return that implementation, or the original expression itself if there is no special implementation.

      This appears at present to be dead code, and is not called from within javac. Access to the implementation generally occurs within the same class, and thus uses the underlying field directly.

      Overrides:
      getImplementation in class Expression
    • toIdentifier

      public static Identifier toIdentifier(Expression e)
      Convert an '.' expression to a qualified identifier
    • checkAmbigName

      public Vset checkAmbigName(Environment env, Context ctx, Vset vset, Hashtable<Object,Object> exp, UnaryExpression loc)
      Check if the present name is part of a scoping prefix.
      Overrides:
      checkAmbigName in class Expression
    • checkValue

      public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable<Object,Object> exp)
      Check the expression
      Overrides:
      checkValue in class UnaryExpression
    • getAssigner

      public org.glassfish.rmic.tools.tree.FieldUpdater getAssigner(Environment env, Context ctx)
      Return a FieldUpdater object to be used in updating the value of the location denoted by this, which must be an expression suitable for the left-hand side of an assignment. This is used for implementing assignments to private fields for which an access method is required. Returns null if no access method is needed, in which case the assignment is handled in the usual way, by direct access. Only simple assignment expressions are handled here Assignment operators and pre/post increment/decrement operators are are handled by 'getUpdater' below.

      Must be called after 'checkValue', else 'right' will be invalid.

      Overrides:
      getAssigner in class Expression
    • getUpdater

      public org.glassfish.rmic.tools.tree.FieldUpdater getUpdater(Environment env, Context ctx)
      Return a FieldUpdater object to be used in updating the value of the location denoted by this, which must be an expression suitable for the left-hand side of an assignment. This is used for implementing the assignment operators and the increment and decrement operators on private fields that are accessed from another class, e.g, uplevel from an inner class. Returns null if no access method is needed.

      Must be called after 'checkValue', else 'right' will be invalid.

      Overrides:
      getUpdater in class Expression
    • checkLHS

      public Vset checkLHS(Environment env, Context ctx, Vset vset, Hashtable<Object,Object> exp)
      Check the expression if it appears on the LHS of an assignment
      Overrides:
      checkLHS in class Expression
    • checkAssignOp

      public Vset checkAssignOp(Environment env, Context ctx, Vset vset, Hashtable<Object,Object> exp, Expression outside)
      Check the expression if it appears on the LHS of an op= expression
      Overrides:
      checkAssignOp in class Expression
    • checkFinalAssign

      public static Vset checkFinalAssign(Environment env, Context ctx, Vset vset, long where, MemberDefinition field)
      There is a simple assignment being made to the given final field. The field was named either by a simple name or by an almost-simple expression of the form "this.v". Check if this is a legal assignment.

      Blank final variables can be set in initializers or constructor bodies. In all cases there must be definite single assignment. (All instance and instance variable initializers and each constructor body are treated as if concatenated for the purposes of this check. Assignment to "this.x" is treated as a definite assignment to the simple name "x" which names the instance variable.)

    • isConstant

      public boolean isConstant()
      Check if constant: Will it inline away?
      Overrides:
      isConstant in class UnaryExpression
    • inline

      public Expression inline(Environment env, Context ctx)
      Inline
      Overrides:
      inline in class UnaryExpression
    • inlineValue

      public Expression inlineValue(Environment env, Context ctx)
      Overrides:
      inlineValue in class UnaryExpression
    • inlineLHS

      public Expression inlineLHS(Environment env, Context ctx)
      Overrides:
      inlineLHS in class Expression
    • copyInline

      public Expression copyInline(Context ctx)
      Description copied from class: UnaryExpression
      Create a copy of the expression for method inlining
      Overrides:
      copyInline in class UnaryExpression
    • costInline

      public int costInline(int thresh, Environment env, Context ctx)
      The cost of inlining this expression
      Overrides:
      costInline in class UnaryExpression
    • codeValue

      public void codeValue(Environment env, Context ctx, Assembler asm)
      Overrides:
      codeValue in class Expression
    • print

      public void print(PrintStream out)
      Print
      Overrides:
      print in class UnaryExpression