Package org.sonar.python.semantic
Class FunctionSymbolImpl
java.lang.Object
org.sonar.python.semantic.SymbolImpl
org.sonar.python.semantic.FunctionSymbolImpl
- All Implemented Interfaces:
FunctionSymbol,Symbol
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.sonar.plugins.python.api.symbols.FunctionSymbol
FunctionSymbol.ParameterNested classes/interfaces inherited from interface org.sonar.plugins.python.api.symbols.Symbol
Symbol.Kind -
Field Summary
Fields inherited from class org.sonar.python.semantic.SymbolImpl
validForPythonVersions -
Constructor Summary
ConstructorsConstructorDescriptionFunctionSymbolImpl(FunctionDescriptor functionDescriptor, String symbolName) FunctionSymbolImpl(SymbolsProtos.FunctionSymbol functionSymbolProto, String moduleName) FunctionSymbolImpl(SymbolsProtos.FunctionSymbol functionSymbolProto, String containerClassFqn, String moduleName) FunctionSymbolImpl(SymbolsProtos.FunctionSymbol functionSymbolProto, String containerClassFqn, List<String> validFor, String moduleName) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(FunctionSymbolImpl.ParameterImpl parameter) Returns fully qualified name of the return type if anyReturns the known names of the decorators.booleanbooleanbooleanbooleanbooleanbooleanisStub()When true, it denotes a function symbol for a function stub.owner()voidsetDeclaredReturnType(InferredType declaredReturnType) voidsetIsDjangoView(boolean isDjangoView) voidvoidsetParametersWithType(ParameterList parametersList) Methods inherited from class org.sonar.python.semantic.SymbolImpl
addChildSymbol, annotatedTypeName, copyWithoutUsages, fullyQualifiedName, getChildrenSymbolByName, inferredType, is, kind, name, removeUsages, setAnnotatedTypeName, setInferredType, setKind, usages, validForPythonVersionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sonar.plugins.python.api.symbols.Symbol
annotatedTypeName, fullyQualifiedName, is, kind, name, usages
-
Constructor Details
-
FunctionSymbolImpl
-
FunctionSymbolImpl
public FunctionSymbolImpl(SymbolsProtos.FunctionSymbol functionSymbolProto, @Nullable String containerClassFqn, String moduleName) -
FunctionSymbolImpl
public FunctionSymbolImpl(SymbolsProtos.FunctionSymbol functionSymbolProto, @Nullable String containerClassFqn, List<String> validFor, String moduleName) -
FunctionSymbolImpl
-
-
Method Details
-
setParametersWithType
-
addParameter
-
copyWithoutUsages
- Overrides:
copyWithoutUsagesin classSymbolImpl
-
decorators
Description copied from interface:FunctionSymbolReturns the known names of the decorators. It might not be a reliable way to infer the number of decorators as they can take more complex expressions since Python 3.9- Specified by:
decoratorsin interfaceFunctionSymbol
-
parameters
- Specified by:
parametersin interfaceFunctionSymbol
-
isStub
public boolean isStub()Description copied from interface:FunctionSymbolWhen true, it denotes a function symbol for a function stub.def fn(p1, p2): ...
- Specified by:
isStubin interfaceFunctionSymbol
-
isAsynchronous
public boolean isAsynchronous()- Specified by:
isAsynchronousin interfaceFunctionSymbol
-
hasVariadicParameter
public boolean hasVariadicParameter()- Specified by:
hasVariadicParameterin interfaceFunctionSymbol
-
isInstanceMethod
public boolean isInstanceMethod()- Specified by:
isInstanceMethodin interfaceFunctionSymbol
-
hasDecorators
public boolean hasDecorators()- Specified by:
hasDecoratorsin interfaceFunctionSymbol
-
definitionLocation
- Specified by:
definitionLocationin interfaceFunctionSymbol
-
declaredReturnType
-
annotatedReturnTypeName
Description copied from interface:FunctionSymbolReturns fully qualified name of the return type if any- Specified by:
annotatedReturnTypeNamein interfaceFunctionSymbol
-
setDeclaredReturnType
-
owner
-
setOwner
-
isDjangoView
public boolean isDjangoView() -
setIsDjangoView
public void setIsDjangoView(boolean isDjangoView)
-