uk.co.badgersinfoil.metaas
Interface ActionScriptProject


public interface ActionScriptProject

A container for a set of ActionScript files.

An ActionScriptProject helps deal with groups of source files. You can use the project object to create a bunch of compilation units by calling newClass() and newInterface() from disparate points in your code, and then call writeAll() to save everything to your output location in one go when you're done.

Note

writeAll() performs postprocessing steps on the generated code. At the moment this is not configurable.


Method Summary
 void addClasspathEntry(java.lang.String classpathEntry)
           
 void addCompilationUnit(ASCompilationUnit cu)
           
 java.util.List getClasspathEntries()
           
 java.util.List getCompilationUnits()
           
 java.lang.String getOutputLocation()
           
 ASCompilationUnit newClass(java.lang.String qualifiedClassName)
          Shortcut for ActionScriptFactory.newClass(String) that also adds the resulting CompilationUnit to the list managed by this project.
 ASCompilationUnit newInterface(java.lang.String qualifiedClassName)
          Shortcut for ActionScriptFactory.newInterface(String) that also adds the resulting CompilationUnit to the list managed by this project.
 void performAutoImport()
          Process code to automatically add import statements.
 void removeClasspathEntry(java.lang.String classpathEntry)
           
 void removeCompilationUnit(ASCompilationUnit cu)
           
 void setOutputLocation(java.lang.String outputLocation)
           
 void writeAll()
          Writes all CompilationUnits that have been added to this project to the output location.
 

Method Detail

setOutputLocation

void setOutputLocation(java.lang.String outputLocation)

getOutputLocation

java.lang.String getOutputLocation()

addClasspathEntry

void addClasspathEntry(java.lang.String classpathEntry)

removeClasspathEntry

void removeClasspathEntry(java.lang.String classpathEntry)

getClasspathEntries

java.util.List getClasspathEntries()

addCompilationUnit

void addCompilationUnit(ASCompilationUnit cu)

removeCompilationUnit

void removeCompilationUnit(ASCompilationUnit cu)

getCompilationUnits

java.util.List getCompilationUnits()

newClass

ASCompilationUnit newClass(java.lang.String qualifiedClassName)
Shortcut for ActionScriptFactory.newClass(String) that also adds the resulting CompilationUnit to the list managed by this project.


newInterface

ASCompilationUnit newInterface(java.lang.String qualifiedClassName)
Shortcut for ActionScriptFactory.newInterface(String) that also adds the resulting CompilationUnit to the list managed by this project.


writeAll

void writeAll()
              throws java.io.IOException
Writes all CompilationUnits that have been added to this project to the output location.

Throws:
java.io.IOException

performAutoImport

void performAutoImport()

Process code to automatically add import statements.

The code in each compilation unit is analysed to find fully-qualified references to other types defined within this project, or the classpath. Where the unqualified names of these types are unambiguous, the code is altered to use an unqualified name; all suspected type references are also added to the list of package-level imports in the compilation unit, if not already there.

Note that in some future release, this method will be replaced with a more general way of performing post-processing on ActionScript code.



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