public interface IVariableNode extends IDefinitionNode, IDocumentableDefinitionNode
var or const declaration.
The shape of this node is:
IVariableNode IMetaTagsNode <-- getMetaTagsNode() INamespaceDecorationNode <-- getNamespaceNode() IKeywordNode <-- getKeywordNode() IExpressionNode <-- getNameExpressionNode() IExpressionNode <-- getVariableTypeNode() IExpressionNode <-- getAssignedValueNode() IVariableNode <-- ??? IVariableNode ...For example,
[Foo] [Bar] public var i:int = 1, j:int = 2;is represented as
IVariableNode
IMetaTagsNode
IMetaTagNode "Foo"
IMetaTagNode "Bar"
INamespaceDecorationNode "public"
IKeywordNode "var"
IIdentifierNode "i"
IIdentifierNode "int"
INumericLiteralNode 1
IVariableNode
IIdentifierNode "j"
IIdentifierNode "int"
INumericLiteralNode 2
If there is no metadata, the corresponding child node is not present.
If there is no namespace, the corresponding child node is not present.
If there is no type annotation, an implicit IIdentifierNode
for "*" is produced.
If there is no initial value, the corresponding child node is not present.
If multiple variables or constants are declared, then additional children
of type IVariable are present. These will not have metadata,
or a namespace, or a keyword.
UNKNOWN| Modifier and Type | Method and Description |
|---|---|
IExpressionNode |
getAssignedValueNode() |
int |
getDeclarationEnd()
Get the local end offset of this variable declaration.
|
IVariableDefinition.VariableClassification |
getVariableClassification()
Get the classification for this variable (local, argument, class member,
etc)
|
String |
getVariableType()
Returns the type of this variable as it exist in source.
|
IExpressionNode |
getVariableTypeNode()
Returns the
IExpressionNode that corresponds to the type node of
this IVariableNode |
boolean |
isConst()
Returns if this variable is decorated with
const |
getASDocComment, hasExplicitCommentgetContainingFilePath, getDefinition, getMetaInfos, getMetaTags, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNameStart, getPackageName, getQualifiedName, getShortName, hasModifier, hasNamespace, isImplicitcontains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getParent, getSpanningStart, getSucceedingNode, isTerminalgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartString getVariableType()
* is returnedIExpressionNode getVariableTypeNode()
IExpressionNode that corresponds to the type node of
this IVariableNodeIExpressionNode or nullIExpressionNode getAssignedValueNode()
IVariableDefinition.VariableClassification getVariableClassification()
boolean isConst()
constconst existsint getDeclarationEnd()
Copyright © 2016 The Apache Software Foundation. All rights reserved.