public interface IFunctionNode extends IScopedDefinitionNode, IDocumentableDefinitionNode
function
declaration,
either for a regular function, a getter, or a setter.
The shape of this node is:
IFunctionNode IMetaTagsNode <-- getMetaTagsNode() INamespaceDecorationNode <-- getNamespaceNode() IKeywordNode <-- getKeywordNode() IKeywordNode <-- getAccessorKeywordNode() IExpressionNode <-- getNameExpressionNode() IContainerNode <-- getParametersContainerNode() IExpressionNode <-- getReturnTypeNode() IScopedNode <-- getScopedNode()For example,
[Foo] [Bar] public function f(i:int, j:int = 0):void { ... }is represented as
IVariableNode IMetaTagsNode IMetaTagNode "Foo" IMetaTagNode "Bar" INamespaceDecorationNode "public" IKeywordNode "function" IIdentifierNode "f" IContainerNode IParameterNode IIdentifierNode "a" IIdentifierNode "*" IParameterNode IIdentifierNode "b" IIdentifierNode "int" INumericLiteralNode 0 IIdentifierNode "void" IScopedNode ...If there is no metadata, the corresponding child node is not present.
If there is no namespace, the corresponding child node is not present.
For a getter or setter, there are two child nodes which are
If there are no parameters, there is an empty child
If there is no return type, the corresponding child node is not present."function"
and one for "get"
or "set"
.
For a plain function, the second keyword node is not present.
IContainerNode
.
UNKNOWN
Modifier and Type | Method and Description |
---|---|
boolean |
containsLocalFunctions()
Does this function have a local functions within
|
IFunctionDefinition |
getDefinition() |
boolean |
getEmittingLocalFunctions()
flag to determine whether to emit the local function
or a reference to it
|
IFunctionDefinition.FunctionClassification |
getFunctionClassification()
Get the classification for this function (local, argument, class member,
etc)
|
List<IFunctionNode> |
getLocalFunctions()
Get local functions within
|
IParameterNode[] |
getParameterNodes()
Get the parameters of this function as an array of
IParameterNode
elements |
IContainerNode |
getParametersContainerNode()
Returns the container for parameters of this function
|
String |
getReturnType()
Returns the type of this function as it exist in source.
|
IExpressionNode |
getReturnTypeNode()
Returns the
IExpressionNode that corresponds to the return type
node of this IFunctionNode |
boolean |
hasBody()
Does this function have a non-empty body
|
boolean |
isCastFunction()
Is this a cast function?
|
boolean |
isConstructor()
Is this a constructor?
|
boolean |
isGetter()
Is this function a getter?
|
boolean |
isSetter()
Is this function a setter?
|
void |
rememberLocalFunction(IFunctionNode localFunction)
Remember local Functions in this function node().
|
void |
setEmittingLocalFunctions(boolean emit)
flag to determine whether to emit the local function
or a reference to it
|
getScopedNode
getASDocComment, hasExplicitComment
getContainingFilePath, getMetaInfos, getMetaTags, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNameStart, getPackageName, getQualifiedName, getShortName, hasModifier, hasNamespace, isImplicit
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
IParameterNode[] getParameterNodes()
IParameterNode
elementsIContainerNode getParametersContainerNode()
String getReturnType()
void
is returnedIExpressionNode getReturnTypeNode()
IExpressionNode
that corresponds to the return type
node of this IFunctionNode
IExpressionNode
or nullboolean isConstructor()
boolean isCastFunction()
IFunctionDefinition.FunctionClassification getFunctionClassification()
boolean isGetter()
boolean isSetter()
IFunctionDefinition getDefinition()
getDefinition
in interface IDefinitionNode
boolean hasBody()
boolean containsLocalFunctions()
List<IFunctionNode> getLocalFunctions()
void rememberLocalFunction(IFunctionNode localFunction)
boolean getEmittingLocalFunctions()
void setEmittingLocalFunctions(boolean emit)
Copyright © 2016 The Apache Software Foundation. All rights reserved.