public final class ClassTraitsDefinition extends TypeDefinitionBase
TypeDefinitionBase.StaticTypeIterator, TypeDefinitionBase.TypeIterator
FLAG_CAST_FUNCTION, FLAG_CONSTRUCTOR, FLAG_CONTINGENT, FLAG_DECLARED_IN_CONTROL_FLOW, FLAG_DEFAULT, FLAG_DEPRECATED, FLAG_DYNAMIC, FLAG_FINAL, FLAG_GENERATED_EMBED_CLASS, FLAG_HAS_INIT, FLAG_IMPLICIT, FLAG_NATIVE, FLAG_OVERRIDE, FLAG_REST, FLAG_STATIC, flags, nodeRef, singletonEmptyMetaTags
Modifier and Type | Method and Description |
---|---|
int |
getAbsoluteEnd()
Gets the absolute ending offset of the entire definition (not just the
name).
|
int |
getAbsoluteStart()
Gets the absolute starting offset of the entire definition (not just the
name).
|
IMetaTag[] |
getAllMetaTags()
Returns all the
IMetaTagNode objects as an array |
String |
getBaseName()
Gets the base (i.e., unqualified) name of this definition.
|
int |
getColumn()
Gets the local column number of the entire definition (not just the
name).
|
ASScope |
getContainedScope()
Get the scope for this traits - will return the static scope so lookups
in the returned scope will only find statics.
|
String |
getContainingFilePath()
Gets the file path in which this definition is defined.
|
IASScope |
getContainingScope()
Gets the scope in which this definition exists.
|
String |
getContainingSourceFilePath(ICompilerProject project)
Gets the source file path in which this definition is defined.
|
int |
getEnd()
Gets the local ending offset of this entire definition (not just the
name).
|
ASFileScope |
getFileScope() |
IFileSpecification |
getFileSpecification() |
int |
getLine()
Gets the local line number of this entire definition (not just the name).
|
protected String |
getLocationString() |
IMetaTag |
getMetaTagByName(String name)
Returns the first
IMetaTagNode matching the given name |
IMetaTag[] |
getMetaTagsByName(String name)
Gets all the
IMetaTagNode objects that match the given name |
Name |
getMName(ICompilerProject project)
Codegen should never ask for the AET Name of a class traits
|
ModifiersSet |
getModifiers() |
int |
getNameColumn()
Get column number for the name of this definition, if it can be
determined.
|
int |
getNameEnd()
Gets the local ending offset of the name of this definition.
|
int |
getNameLine()
Get line number for the name of this definition, if it can be determined.
|
INamespaceReference |
getNamespaceReference()
Gets the namespace that this definition belongs to.
|
protected String |
getNamespaceReferenceAsString() |
int |
getNameStart()
If the definition has metadata "__go_to_definition_help", use the
annotated location.
|
ITypeNode |
getNode()
Returns the
IDefinitionNode from which this definition was
created, if the definition came from the AST for a source file. |
String |
getPackageName()
Gets the fully-qualified package name for this definition.
|
INamespaceDefinition |
getProtectedNamespaceReference()
Gets the
INamespaceDefinition that represents the protected
namespace for this type. |
String |
getQualifiedName()
Gets the fully-qualified name of this definition.
|
String |
getSourcePath()
Gets the local source path of the entire definition (not just the name).
|
int |
getStart()
Gets the local starting offset of the entire definition (not just the
name).
|
INamespaceDefinition |
getStaticProtectedNamespaceReference()
Gets the
INamespaceDefinition that represents the static
protected namespace for this type. |
boolean |
hasExplicitComment()
Determines if this node has an explicit comment.
|
boolean |
hasMetaTagByName(String name)
Determines if a specific
IMetaTagNode exists in this collection |
boolean |
hasModifier(ASModifier modifier)
Determines whether the specified modifier is present on this definition.
|
boolean |
hasNamespace(INamespaceReference namespace,
ICompilerProject project)
Determines whether the specified namespace is present on this definition.
|
boolean |
isDynamic()
Class traits are never dynamic
|
boolean |
isFinal()
Is this definition marked as
final ? |
boolean |
isInProject(ICompilerProject project)
Debugging method that can be used to assert that a definition is a specified project.
|
boolean |
isInstanceOf(ITypeDefinition type,
ICompilerProject project)
isInstanceOf for the class traits - basically will return true if type is
Class or Object
|
boolean |
isNative()
Is this definition marked as
native ? |
boolean |
isOverride()
Is this definition marked as
override ? |
boolean |
isStatic()
Is this definition marked as
static ? |
boolean |
isTopLevelDefinition()
Is this definition a toplevel definition
|
boolean |
matches(DefinitionBase node) |
Set<IInterfaceDefinition> |
resolveAllInterfaces(ICompilerProject project) |
IInterfaceDefinition[] |
resolveInterfacesImpl(ICompilerProject project)
Resolve the interfaces that this definition extends (if an interface), or implements (if a class).
|
filterNullInterfaces, isInstanceOf, resolveType, staticTypeIterable, typeIteratable
setContainedScope, verify
addMetaTag, buildInnerString, buildString, getAncestorOfType, getArrayElementType, getBindableEventNames, getContainingASScope, getDefinition, getDeprecationInfo, getExplicitSourceComment, getInstanceType, getMaxSize, getParent, getPercentProxy, getSize, getSkinPart, getStorageName, getTypeAsDisplayString, getTypeDependencyType, getTypeReference, hasCollapseWhiteSpace, hasRichTextContent, inPackageNamespace, isBindable, isBindableStyle, isColor, isContingent, isContingentNeeded, isDeprecated, isEmpty, isGeneratedEmbedClass, isImplicit, isInternal, isPrivate, isProtected, isPublic, isRequiredSkinPart, resolveNamespace, resolveType, resolveType, resolveType, resolveType, setBindable, setContainingScope, setContingent, setDynamic, setFinal, setGeneratedEmbedClass, setImplicit, setLocation, setMetaTags, setModifier, setNameLocation, setNamespaceReference, setNative, setNode, setOverride, setPublic, setStatic, setTypeReference, toStorageName, toString, unsetOverride
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExplicitSourceComment
getAncestorOfType, getBindableEventNames, getDeprecationInfo, getParent, getTypeAsDisplayString, getTypeReference, isBindable, isBindableStyle, isContingent, isContingentNeeded, isDeprecated, isGeneratedEmbedClass, isImplicit, isInternal, isPrivate, isProtected, isPublic, resolveNamespace
public ASScope getContainedScope()
getContainedScope
in interface IScopedDefinition
getContainedScope
in class ScopedDefinitionBase
IScopedDefinition
public boolean isDynamic()
isDynamic
in interface IDefinition
isDynamic
in class DefinitionBase
true
if the definition is dynamic
.public Name getMName(ICompilerProject project)
getMName
in class DefinitionBase
project
- the Project to use when resolving the Definitions
Namespacepublic boolean isInstanceOf(ITypeDefinition type, ICompilerProject project)
type
- An ITypeDefinition
representing a class or interface.project
- The ICompilerProject
within which references should
be resolvedpublic boolean matches(DefinitionBase node)
matches
in class DefinitionBase
public ITypeNode getNode()
IDefinition
IDefinitionNode
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.
More specific definition interfaces such as IClassDefinition
redeclare this method to return a more specific node interface such as
IClassNode
.
getNode
in interface IDefinition
getNode
in interface ITypeDefinition
getNode
in class TypeDefinitionBase
public Set<IInterfaceDefinition> resolveAllInterfaces(ICompilerProject project)
public int getNameStart()
TypeDefinitionBase
Gets the local starting offset of the name of this definition. It is zero-based.
getNameStart
in interface IDefinition
getNameStart
in class TypeDefinitionBase
int
for the offset.public String getPackageName()
IDefinition
For example, the backage name of the class definition
for the class flash.display.Sprite
is "flash.display"
getPackageName
in interface IDefinition
getPackageName
in class TypeDefinitionBase
public IInterfaceDefinition[] resolveInterfacesImpl(ICompilerProject project)
TypeDefinitionBase
resolveInterfacesImpl
in class TypeDefinitionBase
project
- the active projectpublic String getQualifiedName()
IDefinition
For example, the fully-qualified name of the class definition
for the class flash.display.Sprite
is
"flash.display.Sprite"
.
getQualifiedName
in interface IDefinition
getQualifiedName
in class DefinitionBase
public IFileSpecification getFileSpecification()
getFileSpecification
in class DefinitionBase
public String getSourcePath()
IDefinition
getSourcePath
in interface IDefinition
getSourcePath
in class DefinitionBase
String for the path.
public int getStart()
IDefinition
getStart
in interface IDefinition
getStart
in class DefinitionBase
int
for the offset.public int getEnd()
IDefinition
getEnd
in interface IDefinition
getEnd
in class DefinitionBase
int
for the offset.public int getLine()
IDefinition
getLine
in interface IDefinition
getLine
in class DefinitionBase
int
for the line number.public int getColumn()
IDefinition
getColumn
in interface IDefinition
getColumn
in class DefinitionBase
int
for the column number.public int getAbsoluteStart()
IDefinition
getAbsoluteStart
in interface IDefinition
getAbsoluteStart
in class DefinitionBase
int
for the offset.public int getAbsoluteEnd()
IDefinition
getAbsoluteEnd
in interface IDefinition
getAbsoluteEnd
in class DefinitionBase
int
for the offset.public int getNameEnd()
IDefinition
getNameEnd
in interface IDefinition
getNameEnd
in class DefinitionBase
int
for the offset.public int getNameLine()
DefinitionBase
getNameLine
in interface IDefinition
getNameLine
in class DefinitionBase
public int getNameColumn()
DefinitionBase
getNameColumn
in interface IDefinition
getNameColumn
in class DefinitionBase
public String getContainingFilePath()
IDefinition
getContainingFilePath
in interface IDefinition
getContainingFilePath
in class DefinitionBase
public String getContainingSourceFilePath(ICompilerProject project)
IDefinition
For definitions from a source file (like *.as), the result is the same as
IDefinition.getContainingFilePath()
.
If the definition is from a SWC library, and the library source path was set, the result is the file path in the source directory. If the source path was not set, the result is null.
getContainingSourceFilePath
in interface IDefinition
getContainingSourceFilePath
in class DefinitionBase
project
- the containing projectpublic boolean isTopLevelDefinition()
DefinitionBase
isTopLevelDefinition
in class DefinitionBase
public boolean isFinal()
IDefinition
final
?isFinal
in interface IDefinition
isFinal
in class DefinitionBase
true
if the definition is final
.public boolean isNative()
IDefinition
native
?isNative
in interface IDefinition
isNative
in class DefinitionBase
true
if the definition is native
.public boolean isOverride()
IDefinition
override
?isOverride
in interface IDefinition
isOverride
in class DefinitionBase
true
if the definition is override
.public boolean isStatic()
IDefinition
static
?isStatic
in interface IDefinition
isStatic
in class DefinitionBase
true
if the definition is static
.public boolean hasModifier(ASModifier modifier)
IDefinition
ASModifier
for the list of modifiers.hasModifier
in interface IDefinition
hasModifier
in class DefinitionBase
true
if the modifier is present.public boolean hasNamespace(INamespaceReference namespace, ICompilerProject project)
IDefinition
Namespaces include public
, private
,
protected
, and internal
, plus any custom
namespaces available in the definition's scope.
The namespace is specified by an INamespaceReference, which can represent
not only a custom namespace like ns1
but also
ns1::ns2
, (ns1::ns2)::ns3
, etc.
hasNamespace
in interface IDefinition
hasNamespace
in class DefinitionBase
namespace
- An INamespaceReference specifying the namespace to check
for.true
if the namespace is present.public INamespaceReference getNamespaceReference()
IDefinition
getNamespaceReference
in interface IDefinition
getNamespaceReference
in class DefinitionBase
== NamespaceDefinition.getPublic()
,
instanceof IPublicNamespaceDefinition
,
instanceof IProtectedNamespaceDefinition
, or For a custom
namespace, the INamespaceReference will represent an expression of the
form ns1
, ns1::ns2
,
(ns1::ns2)::ns3
, etc.public IMetaTag[] getAllMetaTags()
IDefinition
IMetaTagNode
objects as an arraygetAllMetaTags
in interface IDefinition
getAllMetaTags
in class DefinitionBase
public IMetaTag[] getMetaTagsByName(String name)
IDefinition
IMetaTagNode
objects that match the given namegetMetaTagsByName
in interface IDefinition
getMetaTagsByName
in class DefinitionBase
name
- the name to match, such as Event, Style, IconFile, etcIMetaTagNode
objects, or empty array (never
null)public boolean hasMetaTagByName(String name)
IDefinition
IMetaTagNode
exists in this collectionhasMetaTagByName
in interface IDefinition
hasMetaTagByName
in class DefinitionBase
name
- the name of the tagpublic IMetaTag getMetaTagByName(String name)
IDefinition
IMetaTagNode
matching the given namegetMetaTagByName
in interface IDefinition
getMetaTagByName
in class DefinitionBase
name
- the name to search forIMetaTagNode
or nullpublic boolean hasExplicitComment()
IDocumentableDefinition
hasExplicitComment
in interface IDocumentableDefinition
hasExplicitComment
in class DefinitionBase
public ASFileScope getFileScope()
getFileScope
in class DefinitionBase
public ModifiersSet getModifiers()
getModifiers
in interface IDefinition
getModifiers
in class DefinitionBase
public String getBaseName()
IDefinition
For example, the base name of the class definition
for the class flash.display.Sprite
is "Sprite"
.
getBaseName
in interface IDefinition
getBaseName
in class DefinitionBase
public IASScope getContainingScope()
IDefinition
getContainingScope
in interface IDefinition
getContainingScope
in class DefinitionBase
null
if
this definition has not yet been added to a scope.public INamespaceDefinition getProtectedNamespaceReference()
ITypeDefinition
INamespaceDefinition
that represents the protected
namespace for this type.INamespaceDefinition
that represents the protected
namespace for this type.public INamespaceDefinition getStaticProtectedNamespaceReference()
ITypeDefinition
INamespaceDefinition
that represents the static
protected namespace for this type.INamespaceDefinition
that represents the static
protected namespace for this type.protected String getLocationString()
getLocationString
in class DefinitionBase
protected String getNamespaceReferenceAsString()
getNamespaceReferenceAsString
in class DefinitionBase
public boolean isInProject(ICompilerProject project)
IDefinition
isInProject
in interface IDefinition
isInProject
in class DefinitionBase
Copyright © 2016 The Apache Software Foundation. All rights reserved.