Package org.sonar.python.tree
Class FunctionDefImpl
- java.lang.Object
-
- org.sonar.python.tree.PyTree
-
- org.sonar.python.tree.FunctionDefImpl
-
- All Implemented Interfaces:
FunctionDef,FunctionLike,Statement,Tree
public class FunctionDefImpl extends PyTree implements FunctionDef
-
-
Constructor Summary
Constructors Constructor Description FunctionDefImpl(com.sonar.sslr.api.AstNode astNode, List<Decorator> decorators, Token asyncKeyword, Token defKeyword, Name name, Token leftPar, ParameterList parameters, Token rightPar, TypeAnnotation returnType, Token colon, StatementList body, boolean isMethodDefinition, Token docstring)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(TreeVisitor visitor)voidaddLocalVariableSymbol(Symbol symbol)TokenasyncKeyword()StatementListbody()List<Tree>children()Tokencolon()List<Decorator>decorators()TokendefKeyword()Tokendocstring()Tree.KindgetKind()booleanisMethodDefinition()TokenleftPar()Set<Symbol>localVariables()Namename()ParameterListparameters()TypeAnnotationreturnTypeAnnotation()-> returnTypeTokenrightPar()-
Methods inherited from class org.sonar.python.tree.PyTree
astNode, firstToken, is, lastToken, parent, setParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sonar.python.api.tree.Tree
ancestors, astNode, descendants, descendants, firstToken, is, lastToken, parent
-
-
-
-
Constructor Detail
-
FunctionDefImpl
public FunctionDefImpl(com.sonar.sslr.api.AstNode astNode, List<Decorator> decorators, @Nullable Token asyncKeyword, Token defKeyword, Name name, Token leftPar, @Nullable ParameterList parameters, Token rightPar, @Nullable TypeAnnotation returnType, Token colon, StatementList body, boolean isMethodDefinition, @Nullable Token docstring)
-
-
Method Detail
-
decorators
public List<Decorator> decorators()
- Specified by:
decoratorsin interfaceFunctionDef
-
defKeyword
public Token defKeyword()
- Specified by:
defKeywordin interfaceFunctionDef
-
asyncKeyword
@CheckForNull public Token asyncKeyword()
- Specified by:
asyncKeywordin interfaceFunctionDef
-
name
public Name name()
- Specified by:
namein interfaceFunctionDef
-
leftPar
public Token leftPar()
- Specified by:
leftParin interfaceFunctionDef
-
parameters
@CheckForNull public ParameterList parameters()
- Specified by:
parametersin interfaceFunctionLike
-
rightPar
public Token rightPar()
- Specified by:
rightParin interfaceFunctionDef
-
returnTypeAnnotation
@CheckForNull public TypeAnnotation returnTypeAnnotation()
Description copied from interface:FunctionDef-> returnType- Specified by:
returnTypeAnnotationin interfaceFunctionDef
-
colon
public Token colon()
- Specified by:
colonin interfaceFunctionDef
-
body
public StatementList body()
- Specified by:
bodyin interfaceFunctionDef
-
isMethodDefinition
public boolean isMethodDefinition()
- Specified by:
isMethodDefinitionin interfaceFunctionLike
-
docstring
@CheckForNull public Token docstring()
- Specified by:
docstringin interfaceFunctionDef
-
localVariables
public Set<Symbol> localVariables()
- Specified by:
localVariablesin interfaceFunctionLike
-
addLocalVariableSymbol
public void addLocalVariableSymbol(Symbol symbol)
-
accept
public void accept(TreeVisitor visitor)
-
-