public interface ILiteralNode extends IExpressionNode
An ILiteralNode
can represent null
, void
,
and literal values of the following types:
int
, uint
, and Number
types are represented more completely by the INumericLiteralNode
subinterface.
The RegExp
type is represented more completely by the
IRegExpLiteralNode
subinterrface.
The shape of an Array
literal is
ILiteralNode "Array" IExpressionNode <-- getChild(0) IExpressionNode <-- getChild(1) ...For example,
[ 1, 2, 3 ]
is represented as
ILiteralNode "Array" INumericLiteralNode 1 INumericLiteralNode 2 INumericLiteralNode 3The shape of an
Object
literal is
ILiteralNode "Object" IObjectLIteralValuePairNode <-- getChild(0) IObjectLiteralValuePairNode <-- getChild(1) ..For example,
{ a: 1, b: 2 } is represented as
ILiteralNode "Object"
IObjectLiteralValuePairNode
IIdentifierNode "a"
INumericLiteralNode 1
IObjectLiteralValuePairNode
IIdentifierNode "b"
INumericLiteralNode 2
The other types of literals nodes do not have children.
Modifier and Type | Interface and Description |
---|---|
static class |
ILiteralNode.LiteralType
Represents a kind of ActionScript literal
|
UNKNOWN
Modifier and Type | Method and Description |
---|---|
ILiteralNode.LiteralType |
getLiteralType()
Returns the
ILiteralNode.LiteralType that this node represents |
String |
getValue()
Returns the value of this literal as a String
|
String |
getValue(boolean rawValue)
Returns the value of this literal as a String
|
copyForInitializer, hasParenthesis, isDynamicExpression, resolve, resolveType
contains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getNodeID, getPackageName, getParent, getSpanningStart, getSucceedingNode, isTerminal
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStart
String getValue()
String getValue(boolean rawValue)
rawValue
- True if you want the raw value, otherwise some massaging
of the value will be done before returning the value if it's a String
(enclosing quotes will be removed).ILiteralNode.LiteralType getLiteralType()
ILiteralNode.LiteralType
that this node representsCopyright © 2016 The Apache Software Foundation. All rights reserved.