com.sun.tools.javac.code
Class Symbol.ClassSymbol

java.lang.Object
  extended by com.sun.tools.javac.code.Symbol
      extended by com.sun.tools.javac.code.Symbol.TypeSymbol
          extended by com.sun.tools.javac.code.Symbol.ClassSymbol
All Implemented Interfaces:
Element, TypeElement, TypeParameterElement
Enclosing class:
Symbol

public static class Symbol.ClassSymbol
extends Symbol.TypeSymbol
implements TypeElement

A class for class symbols


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.tools.javac.code.Symbol
Symbol.ClassSymbol, Symbol.Completer, Symbol.CompletionFailure, Symbol.DelegatedSymbol, Symbol.Level, Symbol.MethodSymbol, Symbol.OperatorSymbol, Symbol.PackageSymbol, Symbol.TypeSymbol, Symbol.VarSymbol, Symbol.Visitor<R,P>
 
Field Summary
 JavaFileObject classfile
          the classfile from where to load this class this will have extension .class or .java
 Name flatname
          the fully qualified name of the class after converting to flat representation, i.e.
 Name fullname
          the fully qualified name of the class, i.e.
 Scope members_field
          a scope for all class members; variables, methods and inner classes type parameters are not part of this scope
 Pool pool
          the constant pool of the class
 JavaFileObject sourcefile
          the sourcefile where the class came from
 
Fields inherited from class com.sun.tools.javac.code.Symbol
attributes_field, completer, erasure_field, flags_field, kind, level, name, owner, type
 
Constructor Summary
Symbol.ClassSymbol(long flags, Name name, Symbol owner)
           
Symbol.ClassSymbol(long flags, Name name, Type type, Symbol owner)
           
 
Method Summary
<R,P> R
accept(ElementVisitor<R,P> v, P p)
          Applies a visitor to this element.
<R,P> R
accept(Symbol.Visitor<R,P> v, P p)
           
 java.lang.String className()
           
 void complete()
          Complete the elaboration of this symbol's definition.
 Type erasure(Types types)
          The symbol's erased type.
 long flags()
          An accessor method for the flags of this symbol.
 Name flatName()
          The fully qualified name of this symbol after converting to flat representation.
<A extends java.lang.annotation.Annotation>
A
getAnnotation(java.lang.Class<A> annoType)
          Deprecated. this method should never be used by javac internally.
 List<Attribute.Compound> getAnnotationMirrors()
          An accessor method for the attributes of this symbol.
 List<Type> getInterfaces()
          Returns the interface types directly implemented by this class or extended by this interface.
 ElementKind getKind()
          Returns the kind of this element.
 NestingKind getNestingKind()
          Returns the nesting kind of this type element.
 Name getQualifiedName()
          The fully qualified name of this symbol.
 Type getSuperclass()
          Returns the direct superclass of this type element.
 boolean isSubClass(Symbol base, Types types)
          Is this symbol a subclass of `base'? Only defined for ClassSymbols.
 Scope members()
          If this is a class or package, its members, otherwise null.
 java.lang.String toString()
          The Java source which this symbol represents.
 
Methods inherited from class com.sun.tools.javac.code.Symbol.TypeSymbol
formFlatName, formFullName, getBounds, getEnclosedElements, getGenericElement, precedes
 
Methods inherited from class com.sun.tools.javac.code.Symbol
addParentLevel, asMemberOf, asType, attribute, clone, enclClass, exists, externalType, getEnclosingElement, getLevel, getModifiers, getSimpleName, getTypeParameters, hasOuterInstance, isConstructor, isEnclosedBy, isInheritedIn, isInner, isInterface, isLocal, isMemberOf, isStatic, location, location, outermostClass, overrides, packge, removeParentLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.lang.model.element.TypeElement
getTypeParameters
 
Methods inherited from interface javax.lang.model.element.Element
asType, equals, getEnclosedElements, getEnclosingElement, getModifiers, getSimpleName, hashCode
 

Field Detail

members_field

public Scope members_field
a scope for all class members; variables, methods and inner classes type parameters are not part of this scope


fullname

public Name fullname
the fully qualified name of the class, i.e. pck.outer.inner. null for anonymous classes


flatname

public Name flatname
the fully qualified name of the class after converting to flat representation, i.e. pck.outer$inner, set externally for local and anonymous classes


sourcefile

public JavaFileObject sourcefile
the sourcefile where the class came from


classfile

public JavaFileObject classfile
the classfile from where to load this class this will have extension .class or .java


pool

public Pool pool
the constant pool of the class

Constructor Detail

Symbol.ClassSymbol

public Symbol.ClassSymbol(long flags,
                          Name name,
                          Type type,
                          Symbol owner)

Symbol.ClassSymbol

public Symbol.ClassSymbol(long flags,
                          Name name,
                          Symbol owner)
Method Detail

toString

public java.lang.String toString()
The Java source which this symbol represents.

Overrides:
toString in class Symbol

flags

public long flags()
Description copied from class: Symbol
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.

Overrides:
flags in class Symbol

members

public Scope members()
Description copied from class: Symbol
If this is a class or package, its members, otherwise null.

Overrides:
members in class Symbol

getAnnotationMirrors

public List<Attribute.Compound> getAnnotationMirrors()
Description copied from class: Symbol
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.

Specified by:
getAnnotationMirrors in interface Element
Overrides:
getAnnotationMirrors in class Symbol
Returns:
the annotations directly present on this element; an empty list if there are none
See Also:
ElementFilter

erasure

public Type erasure(Types types)
Description copied from class: Symbol
The symbol's erased type.

Overrides:
erasure in class Symbol

className

public java.lang.String className()

getQualifiedName

public Name getQualifiedName()
Description copied from class: Symbol
The fully qualified name of this symbol. This is the same as the symbol's name except for class symbols, which are handled separately.

Specified by:
getQualifiedName in interface TypeElement
Overrides:
getQualifiedName in class Symbol
Returns:
the fully qualified name of this class or interface, or an empty name if none
See Also:
Elements.getBinaryName(javax.lang.model.element.TypeElement)

flatName

public Name flatName()
Description copied from class: Symbol
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.

Overrides:
flatName in class Symbol

isSubClass

public boolean isSubClass(Symbol base,
                          Types types)
Description copied from class: Symbol
Is this symbol a subclass of `base'? Only defined for ClassSymbols.

Overrides:
isSubClass in class Symbol

complete

public void complete()
              throws Symbol.CompletionFailure
Complete the elaboration of this symbol's definition.

Overrides:
complete in class Symbol
Throws:
Symbol.CompletionFailure

getInterfaces

public List<Type> getInterfaces()
Description copied from interface: TypeElement
Returns the interface types directly implemented by this class or extended by this interface.

Specified by:
getInterfaces in interface TypeElement
Returns:
the interface types directly implemented by this class or extended by this interface, or an empty list if there are none

getSuperclass

public Type getSuperclass()
Description copied from interface: TypeElement
Returns the direct superclass of this type element. If this type element represents an interface or the class java.lang.Object, then a NoType with kind NONE is returned.

Specified by:
getSuperclass in interface TypeElement
Returns:
the direct superclass, or a NoType if there is none

getKind

public ElementKind getKind()
Description copied from interface: Element
Returns the kind of this element.

Specified by:
getKind in interface Element
Overrides:
getKind in class Symbol.TypeSymbol
Returns:
the kind of this element

getNestingKind

public NestingKind getNestingKind()
Description copied from interface: TypeElement
Returns the nesting kind of this type element.

Specified by:
getNestingKind in interface TypeElement
Returns:
the nesting kind of this type element

getAnnotation

@Deprecated
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annoType)
Deprecated. this method should never be used by javac internally.

Description copied from interface: Element
Returns this element's annotation for the specified type if such an annotation is present, else null. The annotation may be either inherited or directly present on this element.

The annotation returned by this method could contain an element whose value is of type Class. This value cannot be returned directly: information necessary to locate and load a class (such as the class loader to use) is not available, and the class might not be loadable at all. Attempting to read a Class object by invoking the relevant method on the returned annotation will result in a MirroredTypeException, from which the corresponding TypeMirror may be extracted. Similarly, attempting to read a Class[]-valued element will result in a MirroredTypesException.

Note: This method is unlike others in this and related interfaces. It operates on runtime reflective information — representations of annotation types currently loaded into the VM — rather than on the representations defined by and used throughout these interfaces. Consequently, calling methods on the returned annotation object can throw many of the exceptions that can be thrown when calling methods on an annotation object returned by core reflection. This method is intended for callers that are written to operate on a known, fixed set of annotation types.

Specified by:
getAnnotation in interface Element
Overrides:
getAnnotation in class Symbol
Type Parameters:
A - the annotation type
Parameters:
annoType - the Class object corresponding to the annotation type
Returns:
this element's annotation for the specified annotation type if present on this element, else null
See Also:
Element.getAnnotationMirrors(), AnnotatedElement.getAnnotation(java.lang.Class), EnumConstantNotPresentException, AnnotationTypeMismatchException, IncompleteAnnotationException, MirroredTypeException, MirroredTypesException

accept

public <R,P> R accept(ElementVisitor<R,P> v,
                      P p)
Description copied from interface: Element
Applies a visitor to this element.

Specified by:
accept in interface Element
Overrides:
accept in class Symbol.TypeSymbol
Type Parameters:
R - the return type of the visitor's methods
P - the type of the additional parameter to the visitor's methods
Parameters:
v - the visitor operating on this element
p - additional parameter to the visitor
Returns:
a visitor-specified result

accept

public <R,P> R accept(Symbol.Visitor<R,P> v,
                      P p)
Overrides:
accept in class Symbol.TypeSymbol