public interface IClassDefinition extends ITypeDefinition
class
declaration.
An IClassDefinition
IClassNode.
For example, the class declaration
public class B extends A { }creates a class definition whose base name is
"B"
,
whose namespace reference is to the public
namespace,
and whose type reference is null
.
It has an IReference
named "A" to the class that it extends.
A class definition is contained within a file scope or a package scope, and contains a class scope. The members of the class are represented by definitions in the class scope.
Modifier and Type | Interface and Description |
---|---|
static class |
IClassDefinition.ClassClassification
Determines the type of class
|
static interface |
IClassDefinition.IClassIterator
This interface represents what the
classIterator method
returns. |
Modifier and Type | Field and Description |
---|---|
static IClassDefinition |
ANY_TYPE
The class definition for the
* "type". |
static IClassDefinition |
NULL
The type of the
null value. |
static IClassDefinition |
UNDEFINED
The type of the
undefined value. |
static IClassDefinition |
VOID
The type definition for
void . |
Modifier and Type | Method and Description |
---|---|
IClassDefinition.IClassIterator |
classIterator(ICompilerProject project,
boolean includeThis)
Creates an iterator for enumerating the superclasses of this class.
|
IEffectDefinition[] |
findEffectDefinitions(ICompilerProject project)
Finds the effect definitions for effect declared on this class or any of
its superclasses.
|
IEventDefinition[] |
findEventDefinitions(ICompilerProject project)
Finds the event definitions for events declared on this class or any of
its superclasses.
|
IMetaTag[] |
findMetaTagsByName(String name,
ICompilerProject project)
Finds all metadata with a specified tag name.
|
IMetaTag[] |
findSkinParts(ICompilerProject project,
Collection<ICompilerProblem> problems)
Finds the skin parts declared on this class or any of its superclasses.
|
String[] |
findSkinStates(ICompilerProject project,
Collection<ICompilerProblem> problems)
Finds the skin state names declared on this class or any of its
superclasses.
|
Set<String> |
findStateNames(ICompilerProject project)
Finds the state names declared on this class or any of its superclasses.
|
IStyleDefinition[] |
findStyleDefinitions(ICompilerProject project)
Finds the style definitions for styles declared on this class or any of
its superclasses.
|
IClassDefinition[] |
getAlternativeClasses(ICompilerProject project,
Version version)
Returns the classes that are specified as replacing the given class.
|
String |
getBaseClassAsDisplayString()
Converts this class's
IReference for its base class
to a human-readable String. |
IReference |
getBaseClassReference()
Gets a reference to the base class for this class.
|
IClassDefinition.ClassClassification |
getClassClassification()
Returns the classification of this ActionScript class
|
IFunctionDefinition |
getConstructor()
Gets the constructor function for this class.
|
String |
getDefaultPropertyName(ICompilerProject project)
Gets the name of the default property for this class.
|
IEffectDefinition |
getEffectDefinition(IWorkspace w,
String name)
Gets an effect definition for an effect declared on this class with a
particular name such as
"moveEffect" . |
IEffectDefinition[] |
getEffectDefinitions(IWorkspace w)
Gets the effect definitions for effects declared on this class.
|
IEventDefinition |
getEventDefinition(IWorkspace w,
String name)
Gets an event definition for an event declared on this class with a
particular name such as
"click" . |
IEventDefinition[] |
getEventDefinitions(IWorkspace w)
Gets the event definitions for events declared on this class.
|
String |
getIconFile()
For a Flex component class, gets the path to the icon file representing
the component, as specified by
[IconFile(...)] |
IReference[] |
getImplementedInterfaceReferences()
Returns
IReference objects that will resolve to any interface this
class directly implements. |
String[] |
getImplementedInterfacesAsDisplayStrings()
Returns the names of any interfaces that this class directly references.
|
IMetaTag[] |
getSkinParts(Collection<ICompilerProblem> problems)
Gets the skin parts declared on this class.
|
String[] |
getSkinStates(Collection<ICompilerProblem> problems)
Gets the skin state names declared on this class.
|
Set<String> |
getStateNames()
Gets the state names declared on this class.
|
IStyleDefinition |
getStyleDefinition(IWorkspace workspace,
String name)
Gets a style definition for a style declared on this class with a
particular name such as
"fontSize" . |
IStyleDefinition[] |
getStyleDefinitions(IWorkspace w)
Gets the style definitions for styles declared on this class.
|
Iterator<IInterfaceDefinition> |
interfaceIterator(ICompilerProject project)
Creates an iterator for enumerating all of the interfaces that this class
implements.
|
boolean |
needsEventDispatcher(ICompilerProject project)
Determine if this class needs to add an implicit 'implements
flash.events.IEventDispatcher' due to the class, or some of its members
being marked bindable.
|
boolean |
needsStaticEventDispatcher(ICompilerProject project)
Determine if this class needs a static event dispatcher added to it.
|
IClassDefinition[] |
resolveAncestry(ICompilerProject project)
Get the ancestral stack for this class, from this class all the way to
Object.
|
IClassDefinition |
resolveBaseClass(ICompilerProject project)
Finds the definition of the base class for this class.
|
IClassDefinition |
resolveHostComponent(ICompilerProject project)
Finds the
IClassDefinition for the host component class, declared with [HostComponent(...)] |
IInterfaceDefinition[] |
resolveImplementedInterfaces(ICompilerProject project)
Get the definitions of the implemented interfaces.
|
getNode, getProtectedNamespaceReference, getStaticProtectedNamespaceReference, isInstanceOf, isInstanceOf, resolveAllInterfaces, typeIteratable
getContainedScope
getExplicitSourceComment, hasExplicitComment
getAbsoluteEnd, getAbsoluteStart, getAllMetaTags, getAncestorOfType, getBaseName, getBindableEventNames, getColumn, getContainingFilePath, getContainingScope, getContainingSourceFilePath, getDeprecationInfo, getEnd, getLine, getMetaTagByName, getMetaTagsByName, getModifiers, getNameColumn, getNameEnd, getNameLine, getNamespaceReference, getNameStart, 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
static final IClassDefinition ANY_TYPE
*
"type".static final IClassDefinition NULL
null
value.static final IClassDefinition UNDEFINED
undefined
value.static final IClassDefinition VOID
void
.IClassDefinition.ClassClassification getClassClassification()
IClassDefinition.ClassClassification
objectIReference getBaseClassReference()
IReference
referring to the base class.IClassDefinition resolveBaseClass(ICompilerProject project)
Note that Object
does not have a base class, so this method
returns null
if called on the class definition for
Object
.
It will also return null
in the following error cases:
Note: SemanticUtils.resolveBaseClass(org.apache.flex.compiler.tree.as.ICommonClassNode, org.apache.flex.compiler.internal.definitions.ClassDefinition, org.apache.flex.compiler.projects.ICompilerProject, java.util.Collection<org.apache.flex.compiler.problems.ICompilerProblem>)
is similar, but actually
reports the various error cases as problems, and returns
Object
instead of null
in the error cases so
that the code generator gives the class a valid superclass.
IClassDefinition
or null
.String getBaseClassAsDisplayString()
IReference
for its base class
to a human-readable String.
If this class does not have a base class reference, this method returns the empty string.
This method should only be used for displaying the base class, and not for making semantic decisions.
IReference.getDisplayString()
()
on the IReference
representing this class's base class.IClassDefinition[] resolveAncestry(ICompilerProject project)
IReference[] getImplementedInterfaceReferences()
IReference
objects that will resolve to any interface this
class directly implements. This does not walk of the inheritance chain.IReference
objects, or an empty array.IInterfaceDefinition[] resolveImplementedInterfaces(ICompilerProject project)
String[] getImplementedInterfacesAsDisplayStrings()
boolean needsEventDispatcher(ICompilerProject project)
project
- The project to use to resolve interfaces and base classesboolean needsStaticEventDispatcher(ICompilerProject project)
project
- Project to use to resolve things.IClassDefinition.IClassIterator classIterator(ICompilerProject project, boolean includeThis)
project
- The ICompilerProject
within which references
should be resolved.includeThis
- A flag indicating whether the enumeration should start
with this class rather than with its superclass.IClassDefinition.IClassIterator
that iterates over
IClassDefinition
objects.Iterator<IInterfaceDefinition> interfaceIterator(ICompilerProject project)
project
- The ICompilerProject
within which references
should be resolvedIInterfaceDefinition
objects.IFunctionDefinition getConstructor()
IFunctionDefinition
representing the constructor.IEventDefinition getEventDefinition(IWorkspace w, String name)
"click"
.
If there is no such event, this method returns null
.
This method does not find events defined on superclasses.
name
- The name of the event.IEventDefinition
object.IEventDefinition[] getEventDefinitions(IWorkspace w)
If there are no events declared, this method returns an empty array.
This method does not find events defined on superclasses.
IEventDefinition
objects.IEventDefinition[] findEventDefinitions(ICompilerProject project)
If there are no events declared, this method returns an empty array.
The event definitions returned are guaranteed to have unique event names. If an event is declared with the same name on a superclass and a subclass, the event on the subclass overrides the one on the superclass.
project
- An ICompilerProject
object used to determine the
superclass chain.IEventDefinition
objects.IStyleDefinition getStyleDefinition(IWorkspace workspace, String name)
"fontSize"
.
If there is no such style, this method returns null
.
This method does not find styles defined on superclasses.
name
- The name of the style.IStyleDefinition
object.IStyleDefinition[] getStyleDefinitions(IWorkspace w)
If there are no styles declared, this method returns an empty array.
This method does not find styles defined on superclasses.
IStyleDefinition
objects.IStyleDefinition[] findStyleDefinitions(ICompilerProject project)
If there are no styles declared, this method returns an empty array.
The style definitions returned are guaranteed to have unique style names. If a style is declared with the same name on a superclass and a subclass, the style on the subclass overrides the one on the superclass.
project
- An ICompilerProject
object used to determine the
superclass chain.IStyleDefinition
objects.IEffectDefinition getEffectDefinition(IWorkspace w, String name)
"moveEffect"
.
If there is no such effect, this method returns null
.
This method does not find effects defined on superclasses.
name
- The name of the effect.IEffectDefinition
object.IEffectDefinition[] getEffectDefinitions(IWorkspace w)
If there are no effects declared, this method returns an empty array.
This method does not find effects defined on superclasses.
IEffectDefinition
objects.IEffectDefinition[] findEffectDefinitions(ICompilerProject project)
If there are no effects declared, this method returns an empty array.
The effect definitions returned are guaranteed to have unique effect names. If an effect is declared with the same name on a superclass and a subclass, the effect on the subclass overrides the one on the superclass.
project
- An ICompilerProject
object used to determine the
superclass chain.IEffectDefinition
objects.String getDefaultPropertyName(ICompilerProject project)
IClassDefinition[] getAlternativeClasses(ICompilerProject project, Version version)
project
- the associated projectversion
- the Version
we are working against. If the
version is less than the "since" metaData, the replacement class will not
be returnedIMetaTag[] findMetaTagsByName(String name, ICompilerProject project)
If the tag name is in the set
IMetaAttributeConstants.NON_INHERITING_METATAGS
, then only this
class is searched; otherwise the superclass chain is searched as well.
name
- The tag name of the desired metadata, such as
"Event"
.project
- An ICompilerProject
object, for resolving the
superclass chain.IMetaTag
objects. If there is no metadata with
the specified tag name, the result is an empty array, not
null
.String[] getSkinStates(Collection<ICompilerProblem> problems)
If there are no skin states declared, this method returns an empty array.
This method does not find skin states defined on superclasses.
problems
- String
objects.String[] findSkinStates(ICompilerProject project, Collection<ICompilerProblem> problems)
If there are no skin states declared, this method returns an empty array.
The state names returned are guaranteed to have unique names with no duplicates.
project
- An ICompilerProject
object used to determine the
superclass chain.problems
- String
objects.IMetaTag[] getSkinParts(Collection<ICompilerProblem> problems)
If there are no skin parts declared, this method returns an empty array.
This method does not find skin parts defined on superclasses.
problems
- IMetaTag
objects.IMetaTag[] findSkinParts(ICompilerProject project, Collection<ICompilerProblem> problems)
If there are no skin parts declared, this method returns an empty array.
The skin parts returned are guaranteed to have unique names. If a skin part is declared with the same name on a superclass and a subclass, the skin part on the subclass overrides the one on the superclass.
project
- An ICompilerProject
object used to determine the
superclass chain.problems
- IVariableDefinition
objects.Set<String> getStateNames()
If there are no states declared, this method returns an empty set.
This method does not find states defined on superclasses.
String
objects.Set<String> findStateNames(ICompilerProject project)
If there are no states declared, this method returns an empty set.
project
- An ICompilerProject
object used to determine the
superclass chain.String
objects.String getIconFile()
[IconFile(...)] metadata.
null
if there is no such metadata.IClassDefinition resolveHostComponent(ICompilerProject project)
IClassDefinition
for the host component class, declared with [HostComponent(...)] metadata on
this class or one of its superclasses.
If there is no [HostComponent(...)] metadata on this class or any of its superclasses, this method returns null.
project
- An ICompilerProject
object used to determine the
superclass chain and to resolve the class referenced in the [HostComponent(...)] metadata.
IClassDefinition
for the host component class.Copyright © 2016 The Apache Software Foundation. All rights reserved.