Klasse FieldReference

Alle implementierten Schnittstellen:
InvocationSite, TypeConstants, TypeIds
Bekannte direkte Unterklassen:
CodeSnippetFieldReference, CompletionOnMemberAccess, JavadocFieldReference, SelectionOnFieldReference

public class FieldReference extends Reference implements InvocationSite
AspectJ Extension - support for FieldBinding.alwaysNeedsAccessMethod
  • Felddetails

  • Konstruktordetails

    • FieldReference

      public FieldReference(char[] source, long pos)
  • Methodendetails

    • analyseAssignment

      public FlowInfo analyseAssignment(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, Assignment assignment, boolean isCompound)
      Angegeben von:
      analyseAssignment in Klasse Reference
    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
      Setzt außer Kraft:
      analyseCode in Klasse Reference
    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, boolean valueRequired)
      Beschreibung aus Klasse kopiert: Expression
      More sophisticated for of the flow analysis used for analyzing expressions, and be able to optimize out portions of expressions where no actual value is required.
      Setzt außer Kraft:
      analyseCode in Klasse Expression
      Parameter:
      currentScope -
      flowContext -
      flowInfo -
      valueRequired -
      Gibt zurück:
      The state of initialization after the analysis of the current expression
    • checkNPE

      public boolean checkNPE(BlockScope scope, FlowContext flowContext, FlowInfo flowInfo, int ttlForFieldCheck)
      Beschreibung aus Klasse kopiert: Expression
      Check this expression against potential NPEs, which may occur:
      • if the expression is the receiver in a field access, qualified allocation, array reference or message send incl. implicit message sends like it happens for the collection in a foreach statement.
      • if the expression is subject to unboxing
      • if the expression is the exception in a throw statement
      If a risk of NPE is detected report it to the context. If the expression denotes a local variable, mark it as checked, which affects the flow info.
      Setzt außer Kraft:
      checkNPE in Klasse Reference
      Parameter:
      scope - the scope of the analysis
      flowContext - the current flow context
      flowInfo - the upstream flow info; caveat: may get modified
      ttlForFieldCheck - if this is a reference to a field we will mark that field as nonnull for the specified timeToLive
      Gibt zurück:
      could this expression be checked by the current implementation?
    • computeConversion

      public void computeConversion(Scope scope, TypeBinding runtimeTimeType, TypeBinding compileTimeType)
      Beschreibung aus Klasse kopiert: Expression
      Base types need that the widening is explicitly done by the compiler using some bytecode like i2f. Also check unsafe type operations.
      Setzt außer Kraft:
      computeConversion in Klasse Expression
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.ast.Expression#computeConversion(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding)
    • fieldBinding

      public FieldBinding fieldBinding()
      Setzt außer Kraft:
      fieldBinding in Klasse Reference
    • generateAssignment

      public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired)
      Angegeben von:
      generateAssignment in Klasse Reference
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean valueRequired)
      Field reference code generation
      Setzt außer Kraft:
      generateCode in Klasse Expression
      Parameter:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
      valueRequired - boolean
    • generateCompoundAssignment

      public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired)
      Angegeben von:
      generateCompoundAssignment in Klasse Reference
    • generatePostIncrement

      public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream, CompoundAssignment postIncrement, boolean valueRequired)
      Angegeben von:
      generatePostIncrement in Klasse Reference
    • genericTypeArguments

      public TypeBinding[] genericTypeArguments()
      Angegeben von:
      genericTypeArguments in Schnittstelle InvocationSite
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments()
    • freshInferenceContext

      public InferenceContext18 freshInferenceContext(Scope scope)
      Beschreibung aus Schnittstelle kopiert: InvocationSite
      When inference for this invocationSite starts, get a fresh inference context, initialized from this site.
      Angegeben von:
      freshInferenceContext in Schnittstelle InvocationSite
    • isEquivalent

      public boolean isEquivalent(Reference reference)
      Beschreibung aus Klasse kopiert: Reference
      Is the given reference equivalent to the receiver, meaning that both denote the same path of field reads? Used from FlowContext.isNullcheckedFieldAccess(Reference).
      Setzt außer Kraft:
      isEquivalent in Klasse Reference
    • isSuperAccess

      public boolean isSuperAccess()
      Angegeben von:
      isSuperAccess in Schnittstelle InvocationSite
    • isQualifiedSuper

      public boolean isQualifiedSuper()
      Angegeben von:
      isQualifiedSuper in Schnittstelle InvocationSite
      Setzt außer Kraft:
      isQualifiedSuper in Klasse ASTNode
    • isTypeAccess

      public boolean isTypeAccess()
      Angegeben von:
      isTypeAccess in Schnittstelle InvocationSite
    • lastFieldBinding

      public FieldBinding lastFieldBinding()
      Setzt außer Kraft:
      lastFieldBinding in Klasse Reference
    • manageSyntheticAccessIfNecessary

      public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo, boolean isReadAccess)
    • optimizedBooleanConstant

      public Constant optimizedBooleanConstant()
      Beschreibung aus Klasse kopiert: Expression
      Constant usable for bytecode pattern optimizations, but cannot be inlined since it is not strictly equivalent to the definition of constant expressions. In particular, some side-effects may be required to occur (only the end value is known).
      Setzt außer Kraft:
      optimizedBooleanConstant in Klasse Expression
      Gibt zurück:
      Constant known to be of boolean type
    • postConversionType

      public TypeBinding postConversionType(Scope scope)
      Beschreibung aus Klasse kopiert: Expression
      Returns the type of the expression after required implicit conversions. When expression type gets promoted or inserted a generic cast, the converted type will differ from the resolved type (surface side-effects from #computeConversion(...)).
      Setzt außer Kraft:
      postConversionType in Klasse Expression
      Gibt zurück:
      the type after implicit conversion
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.ast.Expression#postConversionType(Scope)
    • printExpression

      public StringBuffer printExpression(int indent, StringBuffer output)
      Angegeben von:
      printExpression in Klasse Expression
    • resolveType

      public TypeBinding resolveType(BlockScope scope)
      Beschreibung aus Klasse kopiert: Expression
      Resolve the type of this expression in the context of a blockScope
      Setzt außer Kraft:
      resolveType in Klasse Expression
      Parameter:
      scope -
      Gibt zurück:
      Return the actual type of this expression after resolution
    • setActualReceiverType

      public void setActualReceiverType(ReferenceBinding receiverType)
      Angegeben von:
      setActualReceiverType in Schnittstelle InvocationSite
    • setDepth

      public void setDepth(int depth)
      Angegeben von:
      setDepth in Schnittstelle InvocationSite
    • setFieldIndex

      public void setFieldIndex(int index)
      Angegeben von:
      setFieldIndex in Schnittstelle InvocationSite
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope scope)
      Beschreibung aus Klasse kopiert: Expression
      Traverse an expression in the context of a blockScope
      Setzt außer Kraft:
      traverse in Klasse Expression
      Parameter:
      visitor -
      scope -
    • nullAnnotatedVariableBinding

      public VariableBinding nullAnnotatedVariableBinding(boolean supportTypeAnnotations)
      Beschreibung aus Klasse kopiert: Expression
      Used on the lhs of an assignment for detecting null spec violation. If this expression represents a null-annotated variable return the variable binding, otherwise null.
      Setzt außer Kraft:
      nullAnnotatedVariableBinding in Klasse Expression
      Parameter:
      supportTypeAnnotations - if true this causes any variable binding to be used independent of declaration annotations (for in-depth analysis of type annotations)