public class ClassNode extends MemberedNode implements IClassNode
| Modifier and Type | Field and Description |
|---|---|
protected ExpressionNodeBase |
baseClassNode
The name of the base class
|
protected KeywordNode |
classKeywordNode
The class keyword
|
protected FunctionNode |
constructorNode
Generated FunctionNode to represent explicit or default constructor
|
protected FunctionNode |
defaultConstructorNode
Generated FunctionNode to represent default constructor (if there isn't
an explicit one)
|
protected KeywordNode |
extendsKeywordNode
The extends keyword (if one is present)
|
protected KeywordNode |
implementsKeywordNode
The extends keyword (if one is present)
|
protected TransparentContainerNode |
interfacesNode
Container full of interfaces implemented by this class
|
contentsNodedefinition, nameNodeemptyNodeArray, parentUNKNOWN| Constructor and Description |
|---|
ClassNode(ExpressionNodeBase name)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInterface(ExpressionNodeBase interfaceName)
Add an implemented interface to this class.
|
protected void |
analyze(EnumSet<PostProcessStep> set,
ASScope scope,
Collection<ICompilerProblem> problems) |
void |
buildExplicitMemberDefs(TypeScope classScope)
Method that will only build the explicit definitions for this AS3 class.
|
protected boolean |
buildInnerString(StringBuilder sb)
For debugging only.
|
boolean |
canCacheMetaTags()
If a classes containing file has includes, it's metadata values cannot be
cached
|
IDefinitionNode[] |
getAllMemberNodes()
Returns an array of
IDefinitionNode objects that represent all
the children of this class that are members. |
IExpressionNode |
getBaseClassExpressionNode() |
String |
getBaseClassName()
Returns the name of this class' base class, if it exists.
|
ExpressionNodeBase |
getBaseClassNode()
Get the node containing the base class, if one exists
|
IClassDefinition.ClassClassification |
getClassClassification()
Returns the classification of this ActionScript class
|
KeywordNode |
getClassKeywordNode()
Get the node containing the class keyword
|
FunctionNode |
getConstructorNode()
Get the node representing the constructor
|
FunctionNode |
getDefaultConstructorNode()
Get the node representing the default constructor (if there's no explicit
constructor)
|
ClassDefinition |
getDefinition()
Returns the class definition corresponding to this class node.
|
KeywordNode |
getExtendsKeywordNode()
Get the node containing the extends keyword, if one exists
|
IExpressionNode[] |
getImplementedInterfaceNodes() |
String[] |
getImplementedInterfaces()
Returns the names of any interfaces that this class declares it
implements.
|
KeywordNode |
getImplementsKeywordNode()
Get the node containing the implements keyword, if one exists
|
protected int |
getInitialChildCount()
Take a guess as to an efficient initial child count.
|
String[] |
getInterfaceNames()
Get the implemented interface names (as they appear in the class
definition)
|
ContainerNode |
getInterfacesNode()
Get the container of interfaces for this class
|
IMetaTagNode[] |
getMetaTagNodesByName(String name)
Retrieve all of the meta attributes (e.g.
|
IMetaTag[] |
getMetaTagsByName(String name)
Retrieve all of the meta attributes (e.g.
|
protected void |
getMetaTagsByName(String name,
RecursionGuard recursionGuard,
ArrayList<IMetaTagNode> allMatchingAttributes)
Retrieves all of the matching meta attributes associated with this class
or any of its base classes
|
ASTNodeID |
getNodeID()
Get the opcode of this node
|
String |
getQualifiedName()
Get the qualified name of this type
|
String |
getShortName()
Get the short name of this type (without any package information)
|
int |
getSpanningStart()
Gets the local offset where the node starts, including any extra items that may
change the appearance of the node's start.
|
protected void |
init(ExpressionNodeBase nameNode) |
boolean |
isImplicit()
Is this definition an implicit definition that doesn't actually appear in
the source file?
|
void |
setBaseClass(ExpressionNodeBase baseClassNode)
Set the base class of this class.
|
protected void |
setChildren(boolean fillInOffsets)
If this node has custom children (names, arguments, etc), shove them into
the list of children.
|
void |
setClassKeyword(IASToken classKeyword)
Sets the class keyword if one is present.
|
void |
setDefinition(IDefinition def) |
void |
setExtendsKeyword(IASToken extendsKeyword)
Sets the extends keyword if one is present.
|
void |
setImplementsKeyword(IASToken implementsKeyword)
Sets the implements keyword if one is present.
|
getAllMemberDefinitionNodes, getScopedNodeaddDecorationChildren, addModifier, createDecorationPart, fillInMetadata, fillInModifiers, fillInNamespaceAndModifiers, getASDocComment, getDecorationPart, getMetaInfos, getMetaTags, getMetaTagsNode, getModifiers, getModifiersContainer, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNamespaceNode, getNameStart, getNodeStartForTooling, hasExplicitComment, hasModifier, hasNamespace, normalize, setASDocComment, setMetaTags, setModifiersContainer, setNamespaceaddChild, addChild, addChildInOrder, addChildPostNormalize, addTemporaryChild, getChild, getChildCount, optimizeChildren, removeAllChildren, removeChild, removeTemporaryChild, replaceChild, sortChildren, swapChildrenbuildStringRecursive, canContinueContainmentSearch, collectImportNodes, combineAttributes, connectedToProjectScope, contains, endAfter, endAfter, endBefore, endBefore, fillInOffsets, getAbsoluteEnd, getAbsoluteStart, getAncestorOfType, getASScope, getContainingFilePath, getContainingNode, getContainingScope, getEnd, getFileScope, getFileSpecification, getInnerString, getNodeKind, getPackageName, getParent, getScopeNode, getStart, getSucceedingNode, getWorkspace, isTerminal, isTransparent, looselyContains, runPostProcess, setParent, span, span, span, startAfter, startAfter, startBefore, startBefore, toString, tryGetOffsetLookup, verifygetColumn, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, spanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetScopedNodegetContainingFilePath, getMetaInfos, getMetaTags, getName, getNameAbsoluteEnd, getNameAbsoluteStart, getNameEnd, getNameExpressionNode, getNamespace, getNameStart, getPackageName, hasModifier, hasNamespacecontains, getAncestorOfType, getChild, getChildCount, getContainingNode, getContainingScope, getFileSpecification, getParent, getSucceedingNode, isTerminalgetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartgetASDocComment, hasExplicitCommentprotected KeywordNode classKeywordNode
protected KeywordNode extendsKeywordNode
protected ExpressionNodeBase baseClassNode
protected KeywordNode implementsKeywordNode
protected TransparentContainerNode interfacesNode
protected FunctionNode constructorNode
protected FunctionNode defaultConstructorNode
public ClassNode(ExpressionNodeBase name)
name - The node holding this class name.public ASTNodeID getNodeID()
IASNodepublic int getSpanningStart()
IASNodegetSpanningStart in interface IASNodegetSpanningStart in class BaseDefinitionNodeprotected void setChildren(boolean fillInOffsets)
NodeBasesetChildren in class NodeBaseprotected void analyze(EnumSet<PostProcessStep> set, ASScope scope, Collection<ICompilerProblem> problems)
analyze in class BaseDefinitionNodeprotected boolean buildInnerString(StringBuilder sb)
NodeBasebuildOuterString().
It is overridden by subclasses to display optional node-specific
information in the middle of the string, between the node type and the
location information.buildInnerString in class NodeBaseprotected int getInitialChildCount()
TreeNodegetInitialChildCount in class TreeNodeprotected void init(ExpressionNodeBase nameNode)
init in class BaseDefinitionNodepublic ClassDefinition getDefinition()
ICommonClassNodegetDefinition in interface ICommonClassNodegetDefinition in interface IDefinitionNodegetDefinition in class BaseDefinitionNodepublic void setDefinition(IDefinition def)
setDefinition in class BaseDefinitionNodepublic boolean isImplicit()
IDefinitionNodethis, super,
default constructors, and cast functions.isImplicit in interface IDefinitionNodepublic String getQualifiedName()
IDefinitionNodegetQualifiedName in interface IDefinitionNodepublic String getShortName()
IDefinitionNodegetShortName in interface IDefinitionNodepublic IClassDefinition.ClassClassification getClassClassification()
ICommonClassNodegetClassClassification in interface ICommonClassNodeIClassDefinition.ClassClassification objectpublic IMetaTag[] getMetaTagsByName(String name)
ICommonClassNodegetMetaTagsByName in interface ICommonClassNodename - name of meta attributes to search for (e.g. Event or
IconFile)public IMetaTagNode[] getMetaTagNodesByName(String name)
IClassNodegetMetaTagNodesByName in interface IClassNodename - name of meta attributes to search for (e.g. Event or
IconFile)public IExpressionNode getBaseClassExpressionNode()
getBaseClassExpressionNode in interface IClassNodepublic String getBaseClassName()
ICommonClassNodegetBaseClassName in interface ICommonClassNodepublic IExpressionNode[] getImplementedInterfaceNodes()
getImplementedInterfaceNodes in interface IClassNodepublic String[] getImplementedInterfaces()
ICommonClassNodegetImplementedInterfaces in interface ICommonClassNodepublic IDefinitionNode[] getAllMemberNodes()
IClassNodeIDefinitionNode objects that represent all
the children of this class that are members. These include functions,
variables and namespacesgetAllMemberNodes in interface IClassNodeIDefinitionNode children, or an empty arraypublic void setClassKeyword(IASToken classKeyword)
classKeyword - token containing the keywordpublic void setExtendsKeyword(IASToken extendsKeyword)
extendsKeyword - token containing the keywordpublic void setBaseClass(ExpressionNodeBase baseClassNode)
baseClassNode - node containing the base class namepublic void setImplementsKeyword(IASToken implementsKeyword)
implementsKeyword - token containing the keywordpublic void addInterface(ExpressionNodeBase interfaceName)
interfaceName - node containing the interface namepublic void buildExplicitMemberDefs(TypeScope classScope)
classScope - TypeScope into which this AS3 class' definition
should be added.public FunctionNode getConstructorNode()
public FunctionNode getDefaultConstructorNode()
public String[] getInterfaceNames()
public KeywordNode getClassKeywordNode()
public KeywordNode getExtendsKeywordNode()
public ExpressionNodeBase getBaseClassNode()
public KeywordNode getImplementsKeywordNode()
public ContainerNode getInterfacesNode()
protected void getMetaTagsByName(String name, RecursionGuard recursionGuard, ArrayList<IMetaTagNode> allMatchingAttributes)
name - name of meta attributes to retrieverecursionGuard - guard to help avoid infinite loops in the base
class hierarchyallMatchingAttributes - list to be filled with all matching meta
attributespublic boolean canCacheMetaTags()
Copyright © 2016 The Apache Software Foundation. All rights reserved.