| java.lang.Object com.sun.tools.javac.code.Symbol
Symbol | abstract public class Symbol implements Element(Code) | | 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 API supported by Sun Microsystems. 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.
|
Inner Class :public static class DelegatedSymbol extends Symbol | |
Inner Class :public static class PackageSymbol extends TypeSymbol implements PackageElement | |
Inner Class :public static class ClassSymbol extends TypeSymbol implements TypeElement | |
Inner Class :public static class OperatorSymbol extends MethodSymbol | |
Inner Class :public static interface Completer | |
Constructor Summary | |
public | Symbol(int kind, long flags, Name name, Type type, Symbol owner) Construct a symbol with given kind, flags, name, type and owner. |
Method Summary | |
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). | public Type | asType() | public Attribute.Compound | attribute(Symbol anno) Fetch a particular annotation from a symbol. | public Symbol | clone(Symbol newOwner) Clone this symbol with new owner. | public void | complete() 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. | public long | flags() An accessor method for the flags of this symbol. | public Name | flatName() The fully qualified name of this symbol after converting to flat
representation. | public A | getAnnotation(Class<A> annoType) | public List<Attribute.Compound> | getAnnotationMirrors() An accessor method for the attributes of this symbol. | public java.util.List<Symbol> | getEnclosedElements() | public Symbol | getEnclosingElement() | public ElementKind | getKind() | public Set<Modifier> | getModifiers() | public Name | getQualifiedName() The fully qualified name of this symbol. | 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. | public boolean | isConstructor() | public boolean | isEnclosedBy(ClassSymbol clazz) | 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. | public boolean | isStatic() | public boolean | isSubClass(Symbol base, Types types) Is this symbol a subclass of `base'? Only defined for ClassSymbols. | public String | location() A Java source description of the location of this symbol; used for
error reporting. | public String | 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. | public PackageSymbol | packge() The package which indirectly owns this symbol. | public String | toString() The Java source which this symbol represents. |
completer | public Completer completer(Code) | | The completer of this symbol.
|
erasure_field | public Type erasure_field(Code) | | A cache for the type erasure of this symbol.
|
flags_field | public long flags_field(Code) | | The flags of this symbol.
|
kind | public int kind(Code) | | The kind of this symbol.
See Also: Kinds |
name | public Name name(Code) | | The name of this symbol in Utf8 representation.
|
type | public Type type(Code) | | The type of this symbol.
|
Symbol | public Symbol(int kind, long flags, Name name, Type type, Symbol owner)(Code) | | Construct a symbol with given kind, flags, name, type and owner.
|
asMemberOf | public Symbol asMemberOf(Type site, Types types)(Code) | | 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.
|
clone | public Symbol clone(Symbol newOwner)(Code) | | Clone this symbol with new owner.
Legal only for fields and methods.
|
complete | public void complete() throws CompletionFailure(Code) | | Complete the elaboration of this symbol's definition.
|
enclClass | public ClassSymbol enclClass()(Code) | | The closest enclosing class of this symbol's declaration.
|
exists | public boolean exists()(Code) | | True if the symbol represents an entity that exists.
|
externalType | public Type externalType(Types types)(Code) | | 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.
|
flags | public long flags()(Code) | | 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.
|
flatName | public Name flatName()(Code) | | 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.
|
getAnnotation | public A getAnnotation(Class<A> annoType)(Code) | | |
getAnnotationMirrors | public List<Attribute.Compound> getAnnotationMirrors()(Code) | | 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.
|
getEnclosingElement | public Symbol getEnclosingElement()(Code) | | |
getQualifiedName | public Name getQualifiedName()(Code) | | The fully qualified name of this symbol.
This is the same as the symbol's name except for class symbols,
which are handled separately.
|
getTypeParameters | public List<TypeSymbol> getTypeParameters()(Code) | | |
hasOuterInstance | public boolean hasOuterInstance()(Code) | | 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.
See Also: Symbol.isInner |
isConstructor | public boolean isConstructor()(Code) | | Is this symbol a constructor?
|
isEnclosedBy | public boolean isEnclosedBy(ClassSymbol clazz)(Code) | | Is this symbol the same as or enclosed by the given class?
|
isInheritedIn | public boolean isInheritedIn(Symbol clazz, Types types)(Code) | | 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.
Parameters: clazz - The class for which we want to establish membership.This must be a subclass of the member's owner. |
isInner | public boolean isInner()(Code) | | A class is an inner class if it it has an enclosing instance class.
|
isInterface | public boolean isInterface()(Code) | | |
isLocal | public boolean isLocal()(Code) | | 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.
|
isMemberOf | public boolean isMemberOf(TypeSymbol clazz, Types types)(Code) | | Fully check membership: hierarchy, protection, and hiding.
Does not exclude methods not inherited due to overriding.
|
isStatic | public boolean isStatic()(Code) | | |
isSubClass | public boolean isSubClass(Symbol base, Types types)(Code) | | Is this symbol a subclass of `base'? Only defined for ClassSymbols.
|
location | public String location()(Code) | | A Java source description of the location of this symbol; used for
error reporting. Use of this method may result in the loss of the
symbol's description.
|
members | public Scope members()(Code) | | If this is a class or package, its members, otherwise null.
|
outermostClass | public ClassSymbol outermostClass()(Code) | | The outermost class which indirectly owns this symbol.
|
overrides | public boolean overrides(Symbol _other, TypeSymbol origin, Types types, boolean checkResult)(Code) | | 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
|
packge | public PackageSymbol packge()(Code) | | The package which indirectly owns this symbol.
|
toString | public String toString()(Code) | | The Java source which this symbol represents.
A description of this symbol; overrides Object.
|
|
|