public interface IFunctionDefinition extends IScopedDefinition
function
declaration.
An IFunctionDefinition
IFunctionNode.
For example, the function declaration
public function f(i:int):int;creates a function definition whose base name is
"f"
,
whose namespace reference is to the public
namespace,
and whose type reference is named "Function"
.
It has an IReference
named "int"
representing its return type.
It also owns one parameter definition named "i"
.
A function definition is contained within a file scope, a package scope, a class scope, an interface scope, or a function scope; it contains a function scope.
Modifier and Type | Interface and Description |
---|---|
static class |
IFunctionDefinition.FunctionClassification
Function classifications (local, class member, interface member, and
package member)
|
Modifier and Type | Method and Description |
---|---|
IFunctionDefinition.FunctionClassification |
getFunctionClassification()
Get the classification for this function (local, argument, class member,
etc)
|
IFunctionNode |
getFunctionNode()
Returns the
IFunctionNode from which this definition was created,
if the definition came from the AST for a source file. |
IParameterDefinition[] |
getParameters()
Get the parameters of this function as an array of
IParameterDefinition elements |
String |
getReturnTypeAsDisplayString()
Converts this definition's
IReference for its return type
to a human-readable String. |
IReference |
getReturnTypeReference()
Gets a reference to the return type for this function.
|
boolean |
hasRequiredParameters()
Returns
true if the function has required parameters. |
boolean |
inlineFunction()
Can this function be inlined
|
boolean |
isCastFunction()
Is this a cast function?
|
boolean |
isConstructor()
Is this a constructor?
|
boolean |
isImplementation(ICompilerProject project)
Determines whether this function is an implementation of a function from
an implements Interface
|
boolean |
isInline()
Is this function marked as
inline ? |
boolean |
overridesAncestor(ICompilerProject project)
Is this function actually overriding a function in a base class
|
IFunctionDefinition |
resolveImplementedFunction(ICompilerProject project)
Finds the definition of the IFunctionDefinition that defines this
function
|
IFunctionDefinition |
resolveOverriddenFunction(ICompilerProject project)
Finds the definition of the IFunctionDefinition that we are overriding
|
ITypeDefinition |
resolveReturnType(ICompilerProject project)
Resolve this function's return type in the given scope and find its
definition
|
getContainedScope
getExplicitSourceComment, hasExplicitComment
getAbsoluteEnd, getAbsoluteStart, getAllMetaTags, getAncestorOfType, getBaseName, getBindableEventNames, getColumn, getContainingFilePath, getContainingScope, getContainingSourceFilePath, getDeprecationInfo, getEnd, getLine, getMetaTagByName, getMetaTagsByName, getModifiers, getNameColumn, getNameEnd, getNameLine, getNamespaceReference, getNameStart, getNode, getPackageName, getParent, getQualifiedName, getSourcePath, getStart, getTypeAsDisplayString, getTypeReference, hasMetaTagByName, hasModifier, hasNamespace, isBindable, isBindableStyle, isContingent, isContingentNeeded, isDeprecated, isDynamic, isFinal, isGeneratedEmbedClass, isImplicit, isInProject, isInternal, isNative, isOverride, isPrivate, isProtected, isPublic, isStatic, resolveNamespace, resolveType
IFunctionDefinition.FunctionClassification getFunctionClassification()
IParameterDefinition[] getParameters()
IParameterDefinition
elementsboolean hasRequiredParameters()
true
if the function has required parameters.IReference getReturnTypeReference()
For example, for the function private function f(i:int):String
,
this is a reference to the String
class.
IReference
to a class or interface.ITypeDefinition resolveReturnType(ICompilerProject project)
project
- the ICompilerProject
in which to resolve
referencesITypeDefinition
representing this function's return
type, or nullString getReturnTypeAsDisplayString()
IReference
for its return type
to a human-readable String.
If the definition does not have a return type reference, this method returns the empty string.
This method should only be used for displaying return types in problems, and not for making semantic decisions.
Note:
IReference.getDisplayString()
()
on the IReference
representing this definition's return type.boolean isConstructor()
boolean isCastFunction()
boolean isInline()
inline
?true
if the function is inline
.boolean inlineFunction()
boolean overridesAncestor(ICompilerProject project)
IFunctionDefinition resolveOverriddenFunction(ICompilerProject project)
IFunctionDefinition
or nullboolean isImplementation(ICompilerProject project)
IFunctionDefinition resolveImplementedFunction(ICompilerProject project)
IFunctionDefinition
or nullIFunctionNode getFunctionNode()
IFunctionNode
from which this definition was created,
if the definition came from the AST for a source file.
This method may require the AST to be reloaded or regenerated and therefore may be slow.
Copyright © 2016 The Apache Software Foundation. All rights reserved.