Interface Symbol.MethodSymbol
- All Superinterfaces:
Symbol
- Enclosing interface:
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
Modifier and TypeMethodDescriptionDeclaration node of this symbol.Symbols of parameters declared by this method.Retrieve the overridden symbols in all the known type hierarchy.Type of parameters declared by this method.Compute the signature as identified from bytecode point of view.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 Details
-
parameterTypes
Type of parameters declared by this method. In case of generic types of method invocations, this list of types is more specialized than declarationParameters().stream().map(Symbol::type). For example it could be String instead of T.- Returns:
- empty list if method has a zero arity.
-
declarationParameters
Symbols of parameters declared by this method. Use to access parameter annotations. Note: 1) in case of generic types of method invocations, this list of types is less specialized thanparameterTypes()
. For example it could be T instead of String. 2) when the declaration comes from binaries, the name of the symbol will be generated (@see JVariableSymbol.ParameterPlaceholderSymbol).- Returns:
- empty list if methods has not parameters
-
returnType
Symbol.TypeSymbol returnType() -
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.
-
overriddenSymbols
List<Symbol.MethodSymbol> overriddenSymbols()Retrieve the overridden symbols in all the known type hierarchy. Note that it will only returns the symbols which might be determined from known types. The list might therefore not be complete in case of missing dependencies.- Returns:
- the overridden symbols, or an empty list if the method is not overriding any method or overriding can not be determined (incomplete semantics)
- Since:
- SonarJava 6.15.
-
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
-