uk.co.badgersinfoil.metaas.dom
Interface ASType

All Superinterfaces:
Documentable, MetaTagable
All Known Subinterfaces:
ASClassType, ASInterfaceType

public interface ASType
extends MetaTagable, Documentable

Superinterface for ASClassType and ASInterfaceType.


Method Summary
 ASMethod getMethod(java.lang.String name)
          Returns a reference to the ActionScript method with the given name, or null, if no such method exists.
 java.util.List getMethods()
          Returns a list of ASMethod objects.
 java.lang.String getName()
          Returns the name of this class or interface, excluding any package prefix.
 Visibility getVisibility()
          Returns an object representing the visibility of this ActionScript type definition within the enclosing ActionScript3 package.
 ASMethod newMethod(java.lang.String name, Visibility visibility, java.lang.String returnType)
          Creates a new ActionScript method definition, adds it to the list of methods supported by this tyoe, and returns a reference to the method.
 void removeMethod(java.lang.String name)
          Removes the named ActionScript method from the list of methods supported by this ActionScript class.
 void setName(java.lang.String name)
          Sets the name by which this type is identified.
 void setVisibility(Visibility visibility)
          Defines the visibility of this ActionScript type definition within the enclosing ActionScript3 package.
 
Methods inherited from interface uk.co.badgersinfoil.metaas.dom.MetaTagable
getAllMetaTags, getFirstMetatag, getMetaTagsWithName, newMetaTag
 
Methods inherited from interface uk.co.badgersinfoil.metaas.dom.Documentable
getDocComment, setDocComment
 

Method Detail

getName

java.lang.String getName()
Returns the name of this class or interface, excluding any package prefix. TODO: maybe the prefix should be included, and the getPackage() in CompilationUnit should be dropped, to mask the diff between AS2 and AS3.


setName

void setName(java.lang.String name)
Sets the name by which this type is identified.


getMethods

java.util.List getMethods()
Returns a list of ASMethod objects. Don't attempt to change the type by modifying the list.


getMethod

ASMethod getMethod(java.lang.String name)
Returns a reference to the ActionScript method with the given name, or null, if no such method exists.


newMethod

ASMethod newMethod(java.lang.String name,
                   Visibility visibility,
                   java.lang.String returnType)
Creates a new ActionScript method definition, adds it to the list of methods supported by this tyoe, and returns a reference to the method.

Note that the methods of an ASInterfaceType cannot have statements added to them, though this API doesn't make the restriction apparent.

Parameters:
name - The name of the method to be created
visibility - an object representing the alloed access to the new method by other ActionScript code
returnType - The name of this method's return type, or null, if this method's return value is untyped.

removeMethod

void removeMethod(java.lang.String name)
Removes the named ActionScript method from the list of methods supported by this ActionScript class.


getVisibility

Visibility getVisibility()
Returns an object representing the visibility of this ActionScript type definition within the enclosing ActionScript3 package.


setVisibility

void setVisibility(Visibility visibility)
Defines the visibility of this ActionScript type definition within the enclosing ActionScript3 package.



Copyright © 2006-2007 David Holroyd. All Rights Reserved.