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 addCompilationUnit(ASCompilationUnit cu)
           
 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 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()

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.

Some processing is performed on the code before it is written to make it look nicer. This is not customisable, and the behaviour is likely to become part of a seperate API in a later metaas release. The code in each compilation unit is analysed to find fully-qualified references to other types defined within this project. Where the unqualified names of these types are unambiguous, the code is altered to use an unqualified named; all suspected type references are also added to the list of package-level imports in the compilation unit, if not already there.

Throws:
java.io.IOException


Copyright © 2006 null. All Rights Reserved.