Save This Page
Home » openjdk-7 » com.sun.tools » javac » code » [javadoc | source]
com.sun.tools.javac.code
abstract public class: Symbol [javadoc | source]
java.lang.Object
   com.sun.tools.javac.code.Symbol

All Implemented Interfaces:
    Element

Direct Known Subclasses:
    StaticError, OperatorSymbol, InvalidSymbolError, ClassSymbol, AmbiguityError, InapplicableSymbolsError, TypeSymbol, PackageSymbol, VarSymbol, ResolveError, Variable, Method, SymbolNotFoundError, MethodSymbol, DelegatedSymbol, InapplicableSymbolError, AccessError

Root class for Java symbols. It contains subclasses for specific sorts of symbols, such as variables, methods and operators, types, packages. Each subclass is represented as a static inner class inside Symbol.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Nested Class Summary:
public static class  Symbol.DelegatedSymbol   
public static class  Symbol.TypeSymbol  A class for type symbols. Type variables are represented by instances of this class, classes and packages by instances of subclasses. 
public static class  Symbol.PackageSymbol  A class for package symbols 
public static class  Symbol.ClassSymbol  A class for class symbols 
public static class  Symbol.VarSymbol  A class for variable symbols 
public static class  Symbol.MethodSymbol  A class for method symbols. 
public static class  Symbol.OperatorSymbol  A class for predefined operators. 
public static interface  Symbol.Completer  Symbol completer interface. 
public static class  Symbol.CompletionFailure   
public interface  Symbol.Visitor  A visitor for symbols. A visitor is used to implement operations (or relations) on symbols. Most common operations on types are binary relations and this interface is designed for binary relations, that is, operations on the form Symbol × P → R.  
Field Summary
public  int kind    The kind of this symbol. 
public  long flags_field    The flags of this symbol. 
public  List<Compound> attributes_field    The attributes of this symbol. 
public  Name name    The name of this symbol in Utf8 representation. 
public  Type type    The type of this symbol. 
public  Symbol owner    The owner of this symbol. 
public  Completer completer    The completer of this symbol. 
public  Type erasure_field    A cache for the type erasure of this symbol. 
Constructor:
 public Symbol(int kind,
    long flags,
    Name name,
    Type type,
    Symbol owner) 
    Construct a symbol with given kind, flags, name, type and owner.
Method from com.sun.tools.javac.code.Symbol Summary:
accept,   asMemberOf,   asType,   attribute,   clone,   complete,   enclClass,   erasure,   exists,   externalType,   flags,   flatName,   getAnnotation,   getAnnotationMirrors,   getEnclosedElements,   getEnclosingElement,   getKind,   getModifiers,   getQualifiedName,   getSimpleName,   getTypeParameters,   hasOuterInstance,   isAnonymous,   isConstructor,   isEnclosedBy,   isInheritedIn,   isInner,   isInterface,   isLocal,   isMemberOf,   isPolymorphicSignatureGeneric,   isPolymorphicSignatureInstance,   isStatic,   isSubClass,   location,   location,   members,   outermostClass,   overrides,   packge,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.code.Symbol Detail:
 public R accept(Visitor<R, P> v,
    P p) 
 public Symbol asMemberOf(Type site,
    Types types) 
    The (variable or method) symbol seen as a member of given class type`site' (this might change the symbol's type). This is used exclusively for producing diagnostics.
 public Type asType() 
 public Compound attribute(Symbol anno) 
    Fetch a particular annotation from a symbol.
 public Symbol clone(Symbol newOwner) 
    Clone this symbol with new owner. Legal only for fields and methods.
 public  void complete() throws CompletionFailure 
    Complete the elaboration of this symbol's definition.
 public ClassSymbol enclClass() 
    The closest enclosing class of this symbol's declaration.
 public Type erasure(Types types) 
    The symbol's erased type.
 public boolean exists() 
    True if the symbol represents an entity that exists.
 public Type externalType(Types types) 
    The external type of a symbol. This is the symbol's erased type except for constructors of inner classes which get the enclosing instance class added as first argument.
 public long flags() 
    An accessor method for the flags of this symbol. Flags of class symbols should be accessed through the accessor method to make sure that the class symbol is loaded.
 public Name flatName() 
    The fully qualified name of this symbol after converting to flat representation. This is the same as the symbol's name except for class symbols, which are handled separately.
 public A getAnnotation(Class<A> annoType) 
Deprecated! this - method should never be used by javac internally.

 public List<Compound> getAnnotationMirrors() 
    An accessor method for the attributes of this symbol. Attributes of class symbols should be accessed through the accessor method to make sure that the class symbol is loaded.
 public List<Symbol> getEnclosedElements() 
 public Symbol getEnclosingElement() 
 public ElementKind getKind() 
 public Set<Modifier> getModifiers() 
 public Name getQualifiedName() 
    The fully qualified name of this symbol. This is the same as the symbol's name except for class symbols, which are handled separately.
 public Name getSimpleName() 
 public List<TypeSymbol> getTypeParameters() 
 public boolean hasOuterInstance() 
    An inner class has an outer instance if it is not an interface it has an enclosing instance class which might be referenced from the class. Nested classes can see instance members of their enclosing class. Their constructors carry an additional this$n parameter, inserted implicitly by the compiler.
 public boolean isAnonymous() 
    Has this symbol an empty name? This includes anonymous inner classses.
 public boolean isConstructor() 
    Is this symbol a constructor?
 public boolean isEnclosedBy(ClassSymbol clazz) 
    Is this symbol the same as or enclosed by the given class?
 public boolean isInheritedIn(Symbol clazz,
    Types types) 
    Is this symbol inherited into a given class? PRE: If symbol's owner is a interface, it is already assumed that the interface is a superinterface of given class.
 public boolean isInner() 
    A class is an inner class if it it has an enclosing instance class.
 public boolean isInterface() 
 public boolean isLocal() 
    Is this symbol declared (directly or indirectly) local to a method or variable initializer? Also includes fields of inner classes which are in turn local to a method or variable initializer.
 public boolean isMemberOf(TypeSymbol clazz,
    Types types) 
    Fully check membership: hierarchy, protection, and hiding. Does not exclude methods not inherited due to overriding.
 public boolean isPolymorphicSignatureGeneric() 
    Recognize if this symbol was marked @PolymorphicSignature in the source.
 public boolean isPolymorphicSignatureInstance() 
    Recognize if this symbol was split from a @PolymorphicSignature symbol in the source.
 public boolean isStatic() 
 public boolean isSubClass(Symbol base,
    Types types) 
    Is this symbol a subclass of `base'? Only defined for ClassSymbols.
 public Symbol location() 
    A Java source description of the location of this symbol; used for error reporting.
 public Symbol location(Type site,
    Types types) 
 public Scope members() 
    If this is a class or package, its members, otherwise null.
 public ClassSymbol outermostClass() 
    The outermost class which indirectly owns this symbol.
 public boolean overrides(Symbol _other,
    TypeSymbol origin,
    Types types,
    boolean checkResult) 
    Does this method symbol override `other' symbol, when both are seen as members of class `origin'? It is assumed that _other is a member of origin. It is assumed that both symbols have the same name. The static modifier is ignored for this test. See JLS 8.4.6.1 (without transitivity) and 8.4.6.4
 public PackageSymbol packge() 
    The package which indirectly owns this symbol.
 public String toString() 
    The Java source which this symbol represents. A description of this symbol; overrides Object.