Interface Symbol.MethodSymbol
-
- All Superinterfaces:
Symbol
- All Known Implementing Classes:
JavaSymbol.MethodJavaSymbol
- Enclosing interface:
- Symbol
public static interface Symbol.MethodSymbol extends Symbol
Symbol for methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.java.api.semantic.Symbol
Symbol.LabelSymbol, Symbol.MethodSymbol, Symbol.TypeSymbol, Symbol.VariableSymbol
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MethodTree
declaration()
Declaration node of this symbol.Symbol.MethodSymbol
overriddenSymbol()
Retrieve the overridden symbol, which may may not be able to determine (returning 'unknown' symbol).List<Type>
parameterTypes()
Type of parameters declared by this method.Symbol.TypeSymbol
returnType()
String
signature()
Compute the signature as identified from bytecode point of view.List<Type>
thrownTypes()
List of the exceptions that can be thrown by the method.-
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
-
-
-
-
Method Detail
-
parameterTypes
List<Type> parameterTypes()
Type of parameters declared by this method.- Returns:
- empty list if method has a zero arity.
-
returnType
Symbol.TypeSymbol returnType()
-
thrownTypes
List<Type> thrownTypes()
List of the exceptions that can be thrown by the method.- Returns:
- empty list if no exception are declared in the throw clause of the method.
-
overriddenSymbol
@Nullable Symbol.MethodSymbol overriddenSymbol()
Retrieve the overridden symbol, which may may not be able to determine (returning 'unknown' symbol). Note that if the method returns null, the method is not overriding any method for sure.- Returns:
- the overridden symbol, unknown if overriding can not be determined (incomplete semantic), or null if the method is not overriding any method
-
declaration
@Nullable MethodTree declaration()
Description copied from interface:Symbol
Declaration node of this symbol. Currently, only works for declaration within the same file.- Specified by:
declaration
in interfaceSymbol
- Returns:
- the Tree of the declaration of this symbol. Null if declaration does not occur in the currently analyzed file.
-
signature
String signature()
Compute the signature as identified from bytecode point of view. Will be unique for each method.- Returns:
- the signature of the method, as String
-
-