Package org.sonar.java.resolve
Class JavaSymbol.TypeJavaSymbol
- java.lang.Object
-
- org.sonar.java.resolve.JavaSymbol
-
- org.sonar.java.resolve.JavaSymbol.TypeJavaSymbol
-
- All Implemented Interfaces:
Symbol,Symbol.TypeSymbol
- Direct Known Subclasses:
JavaSymbol.TypeVariableJavaSymbol,JavaSymbol.WildcardSymbol
- Enclosing class:
- JavaSymbol
public static class JavaSymbol.TypeJavaSymbol extends JavaSymbol implements Symbol.TypeSymbol
Represents a class, interface, enum or annotation type.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.sonar.java.resolve.JavaSymbol
JavaSymbol.JavaLabelSymbol, JavaSymbol.MethodJavaSymbol, JavaSymbol.PackageJavaSymbol, JavaSymbol.TypeJavaSymbol, JavaSymbol.TypeVariableJavaSymbol, JavaSymbol.VariableJavaSymbol, JavaSymbol.WildcardSymbol
-
Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.semantic.Symbol
Symbol.LabelSymbol, Symbol.MethodSymbol, Symbol.TypeSymbol, Symbol.VariableSymbol
-
-
Constructor Summary
Constructors Constructor Description TypeJavaSymbol(int flags, String name, JavaSymbol owner)TypeJavaSymbol(int flags, String name, JavaSymbol.TypeJavaSymbol owner, String bytecodeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTypeParameter(TypeVariableJavaType typeVariableType)ClassTreedeclaration()Declaration node of this symbol.Set<ClassJavaType>directSuperTypes()StringgetFullyQualifiedName()List<JavaType>getInterfaces()JavaTypegetSuperclass()List<Type>interfaces()Interfaces implemented by this type.Collection<Symbol>lookupSymbols(String name)Lookup symbols accessible from this type with the name passed in parameter.Scopemembers()Collection<Symbol>memberSymbols()List of symbols defined by this type symbols.TypesuperClass()Returns the superclass of this type symbol.Set<ClassJavaType>superTypes()Includes superclass and super interface hierarchy.StringtoString()ScopetypeParameters()-
Methods inherited from class org.sonar.java.resolve.JavaSymbol
addUsage, callbackOnceComplete, complete, enclosingClass, flags, getName, getType, isAbstract, isAnnotation, isDefault, isDeprecated, isEnum, isFinal, isFlag, isInterface, isMethodSymbol, isPackageSymbol, isPackageVisibility, isPrivate, isProtected, isPublic, isStatic, isTypeSymbol, isUnknown, isVariableSymbol, isVolatile, metadata, name, outermostClass, owner, packge, type, usages
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.sonar.plugins.java.api.semantic.Symbol
enclosingClass, isAbstract, isDeprecated, isEnum, isFinal, isInterface, isMethodSymbol, isPackageSymbol, isPackageVisibility, isPrivate, isProtected, isPublic, isStatic, isTypeSymbol, isUnknown, isVariableSymbol, isVolatile, metadata, name, owner, type, usages
-
-
-
-
Constructor Detail
-
TypeJavaSymbol
public TypeJavaSymbol(int flags, String name, JavaSymbol owner)
-
TypeJavaSymbol
public TypeJavaSymbol(int flags, String name, JavaSymbol.TypeJavaSymbol owner, String bytecodeName)
-
-
Method Detail
-
addTypeParameter
public void addTypeParameter(TypeVariableJavaType typeVariableType)
-
members
public Scope members()
-
typeParameters
public Scope typeParameters()
-
getFullyQualifiedName
public String getFullyQualifiedName()
-
directSuperTypes
public Set<ClassJavaType> directSuperTypes()
-
superTypes
public Set<ClassJavaType> superTypes()
Includes superclass and super interface hierarchy.- Returns:
- list of classTypes.
-
superClass
public Type superClass()
Description copied from interface:Symbol.TypeSymbolReturns the superclass of this type symbol.- Specified by:
superClassin interfaceSymbol.TypeSymbol- Returns:
- null for java.lang.Object, the superclass for every other type.
-
interfaces
public List<Type> interfaces()
Description copied from interface:Symbol.TypeSymbolInterfaces implemented by this type.- Specified by:
interfacesin interfaceSymbol.TypeSymbol- Returns:
- an empty list if this type does not implement any interface.
-
memberSymbols
public Collection<Symbol> memberSymbols()
Description copied from interface:Symbol.TypeSymbolList of symbols defined by this type symbols. This will not return any inherited symbol.- Specified by:
memberSymbolsin interfaceSymbol.TypeSymbol- Returns:
- The collection of symbols defined by this type.
-
lookupSymbols
public Collection<Symbol> lookupSymbols(String name)
Description copied from interface:Symbol.TypeSymbolLookup symbols accessible from this type with the name passed in parameter.- Specified by:
lookupSymbolsin interfaceSymbol.TypeSymbol- Parameters:
name- name of searched symbol.- Returns:
- A collection of symbol matching the looked up name.
-
declaration
public ClassTree declaration()
Description copied from interface:SymbolDeclaration node of this symbol. Currently, only works for declaration within the same file.- Specified by:
declarationin interfaceSymbol- Specified by:
declarationin interfaceSymbol.TypeSymbol- Overrides:
declarationin classJavaSymbol- Returns:
- the Tree of the declaration of this symbol. Null if declaration does not occur in the currently analyzed file.
-
-