Klasse SingleNameReference

Alle implementierten Schnittstellen:
OperatorIds, InvocationSite, TypeConstants, TypeIds
Bekannte direkte Unterklassen:
CodeSnippetSingleNameReference, CompletionOnKeyword3, CompletionOnSingleNameReference, JavadocSingleNameReference, SelectionOnSingleNameReference

public class SingleNameReference extends NameReference implements OperatorIds
  • Felddetails

  • Konstruktordetails

    • SingleNameReference

      public SingleNameReference(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
    • checkFieldAccess

      public TypeBinding checkFieldAccess(BlockScope scope)
    • 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)
    • 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)
      Beschreibung aus Klasse kopiert: Expression
      Every expression is responsible for generating its implicit conversion when necessary.
      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
    • generateCompoundAssignment

      public void generateCompoundAssignment(BlockScope currentScope, CodeStream codeStream, MethodBinding writeAccessor, Expression expression, int operator, int assignmentImplicitConversion, boolean valueRequired)
    • generatePostIncrement

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

      public void generateReceiver(CodeStream codeStream)
    • genericTypeArguments

      public TypeBinding[] genericTypeArguments()
      Angegeben von:
      genericTypeArguments in Schnittstelle InvocationSite
      Siehe auch:
      • Ungültige Referenz
        org.eclipse.jdt.internal.compiler.lookup.InvocationSite#genericTypeArguments()
    • 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
    • localVariableBinding

      public LocalVariableBinding localVariableBinding()
      Returns the local variable referenced by this node. Can be a direct reference (SingleNameReference) or thru a cast expression etc...
      Setzt außer Kraft:
      localVariableBinding in Klasse Expression
    • 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)
    • nullStatus

      public int nullStatus(FlowInfo flowInfo, FlowContext flowContext)
      Setzt außer Kraft:
      nullStatus in Klasse Reference
    • manageEnclosingInstanceAccessIfNecessary

      public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo)
    • manageSyntheticAccessIfNecessary

      public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo flowInfo, boolean isReadAccess)
    • 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
    • reportError

      public TypeBinding reportError(BlockScope scope)
    • 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
    • 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 -
    • traverse

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

      public String unboundReferenceErrorName()
      Angegeben von:
      unboundReferenceErrorName in Klasse NameReference
    • getName

      public char[][] getName()
      Angegeben von:
      getName in Klasse NameReference