Class DetachedVarSymbol

  • All Implemented Interfaces:
    javax.lang.model.AnnotatedConstruct, javax.lang.model.element.Element, javax.lang.model.element.VariableElement

    public class DetachedVarSymbol
    extends com.sun.tools.javac.code.Symbol.VarSymbol
    A DetachedVarSymbol represents a variable that is not part of any AST Tree. DetachedVarSymbols are created when desugaring source code constructs and they carry important type information, but some methods such as TreeInfo.declarationFor do not work on them.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.sun.tools.javac.code.Symbol

        com.sun.tools.javac.code.Symbol.ClassSymbol, com.sun.tools.javac.code.Symbol.Completer, com.sun.tools.javac.code.Symbol.CompletionFailure, com.sun.tools.javac.code.Symbol.DelegatedSymbol<T extends com.sun.tools.javac.code.Symbol>, com.sun.tools.javac.code.Symbol.DynamicMethodSymbol, com.sun.tools.javac.code.Symbol.MethodSymbol, com.sun.tools.javac.code.Symbol.ModuleFlags, com.sun.tools.javac.code.Symbol.ModuleResolutionFlags, com.sun.tools.javac.code.Symbol.ModuleSymbol, com.sun.tools.javac.code.Symbol.OperatorSymbol, com.sun.tools.javac.code.Symbol.PackageSymbol, com.sun.tools.javac.code.Symbol.TypeSymbol, com.sun.tools.javac.code.Symbol.TypeVariableSymbol, com.sun.tools.javac.code.Symbol.VarSymbol, com.sun.tools.javac.code.Symbol.Visitor<R extends java.lang.Object,​P extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected @Nullable com.sun.source.tree.VariableTree decl  
      • Fields inherited from class com.sun.tools.javac.code.Symbol.VarSymbol

        adr, pos
      • Fields inherited from class com.sun.tools.javac.code.Symbol

        completer, erasure_field, flags_field, kind, metadata, name, owner, type
    • Constructor Summary

      Constructors 
      Constructor Description
      DetachedVarSymbol​(long flags, com.sun.tools.javac.util.Name name, com.sun.tools.javac.code.Type type, com.sun.tools.javac.code.Symbol owner)
      Construct a detached variable symbol, given its flags, name, type and owner.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable com.sun.source.tree.VariableTree getDeclaration()
      Get the declaration tree for the variable.
      void setDeclaration​(com.sun.source.tree.VariableTree decl)
      Set the declaration tree for the variable.
      • Methods inherited from class com.sun.tools.javac.code.Symbol.VarSymbol

        accept, accept, asMemberOf, clone, getConstantValue, getConstValue, getKind, isExceptionParameter, isResourceVariable, setData, setLazyConstValue, toString
      • Methods inherited from class com.sun.tools.javac.code.Symbol

        annotationsPendingCompletion, apiComplete, appendAttributes, appendClassInitTypeAttributes, appendInitTypeAttributes, appendUniqueTypeAttributes, asType, attribute, baseSymbol, complete, enclClass, erasure, exists, externalType, flags, flatName, getAnnotationMirrors, getClassInitTypeAttributes, getDeclarationAttributes, getEnclosedElements, getEnclosingElement, getInitTypeAttributes, getMetadata, getModifiers, getQualifiedName, getRawAttributes, getRawTypeAttributes, getSimpleName, getTypeParameters, hasAnnotations, hasDeprecatedAnnotation, hasOuterInstance, hasTypeAnnotations, isAccessibleIn, isAnonymous, isCompleted, isConstructor, isDeprecatableViaAnnotation, isDeprecated, isDeprecatedForRemoval, isEnclosedBy, isEnum, isInheritedIn, isInner, isInterface, isLocal, isMemberOf, isPrivate, isStatic, isSubClass, location, location, members, outermostClass, overrides, packge, prependAttributes, resetAnnotations, setAttributes, setClassInitTypeAttributes, setDeclarationAttributes, setInitTypeAttributes, setTypeAttributes
      • Methods inherited from class com.sun.tools.javac.code.AnnoConstruct

        getAnnotation, getAnnotationsByType, getAttribute, getInheritedAnnotations
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.lang.model.AnnotatedConstruct

        getAnnotationsByType
      • Methods inherited from interface javax.lang.model.element.Element

        asType, equals, getAnnotation, getAnnotationMirrors, getEnclosedElements, getModifiers, hashCode
      • Methods inherited from interface javax.lang.model.element.VariableElement

        getEnclosingElement, getSimpleName
    • Field Detail

      • decl

        protected @Nullable com.sun.source.tree.VariableTree decl
    • Constructor Detail

      • DetachedVarSymbol

        public DetachedVarSymbol​(long flags,
                                 com.sun.tools.javac.util.Name name,
                                 com.sun.tools.javac.code.Type type,
                                 com.sun.tools.javac.code.Symbol owner)
        Construct a detached variable symbol, given its flags, name, type and owner.
    • Method Detail

      • setDeclaration

        public void setDeclaration​(com.sun.source.tree.VariableTree decl)
        Set the declaration tree for the variable.
      • getDeclaration

        public @Nullable com.sun.source.tree.VariableTree getDeclaration()
        Get the declaration tree for the variable.