org.nuiton.guix
Class GuixLauncher

java.lang.Object
  extended by org.nuiton.guix.GuixLauncher

public class GuixLauncher
extends java.lang.Object

Launch Guix files compilation

Author:
morin

Field Summary
protected  java.util.List<ClassDescriptor> classDescriptors
          CLassDescriptor met during the compilation
protected  java.util.List<java.lang.String> classNames
          original list of classes to compile
protected  java.io.File[] files
          original list of files to compile
protected  java.util.List<java.lang.String> guixFileClassNames
          Class names corresponding to the files in the guixFiles list.
protected  java.util.List<java.io.File> guixFiles
          Files to be treated while compilation.
protected static org.apache.commons.logging.Log log
          log
protected  java.util.Map<GuixModelObject,java.lang.Long> rootModelObjects
          Maps the root GuixModelObjects being compiled to the compiler instance handling the compilation.
 
Constructor Summary
GuixLauncher(java.io.File[] files, java.io.File targetDirectory, java.io.File srcDir, java.lang.String mainClass, java.lang.Class<? extends GuixGenerator> generatorClass, java.lang.String generationLanguage, java.lang.String launcherName)
          Constructor
 
Method Summary
 void addClassName(java.lang.String className)
           
 void addCompiledFile(java.io.File f)
          Ads a file to the compiled files list
 void addDependency(GuixModelObject gmo, ClassDescriptor cd)
           
 void addRootModelObject(GuixModelObject gmo, java.lang.Long l)
          Adds a root GuixModelObject with its last modification time
 boolean compile()
          Compiles a set of files.
 java.util.List<java.lang.String> getGuixFileClassNames()
           
 java.io.File getSrcDirectory()
           
 java.io.File getTargetDirectory()
           
 boolean isFileAlreadyCompiled(java.io.File f)
          Has the file f already been compiled
 ClassDescriptor registerClassDescriptor(ClassDescriptor classDescriptor)
          Registers a ClassDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
log


files

protected final java.io.File[] files
original list of files to compile


classNames

protected final java.util.List<java.lang.String> classNames
original list of classes to compile


guixFiles

protected java.util.List<java.io.File> guixFiles
Files to be treated while compilation.


guixFileClassNames

protected java.util.List<java.lang.String> guixFileClassNames
Class names corresponding to the files in the guixFiles list.


rootModelObjects

protected java.util.Map<GuixModelObject,java.lang.Long> rootModelObjects
Maps the root GuixModelObjects being compiled to the compiler instance handling the compilation.


classDescriptors

protected java.util.List<ClassDescriptor> classDescriptors
CLassDescriptor met during the compilation

Constructor Detail

GuixLauncher

public GuixLauncher(java.io.File[] files,
                    java.io.File targetDirectory,
                    java.io.File srcDir,
                    java.lang.String mainClass,
                    java.lang.Class<? extends GuixGenerator> generatorClass,
                    java.lang.String generationLanguage,
                    java.lang.String launcherName)
Constructor

Parameters:
files - the files to compile
targetDirectory - the directory where to save the generated files
srcDir - the directory of the source files
mainClass - main class of the application
generatorClass - class of the generator
generationLanguage - the output graphical library
launcherName - name of the class that will launch the application
Method Detail

getSrcDirectory

public java.io.File getSrcDirectory()

getTargetDirectory

public java.io.File getTargetDirectory()

getGuixFileClassNames

public java.util.List<java.lang.String> getGuixFileClassNames()

compile

public boolean compile()
Compiles a set of files.

Returns:
true if compilation succeeds, false otherwise

registerClassDescriptor

public ClassDescriptor registerClassDescriptor(ClassDescriptor classDescriptor)
Registers a ClassDescriptor

Parameters:
classDescriptor - the ClassDescripor to register
Returns:
false if another ClassDescriptor with the same classname and package has a different script or superclass

addRootModelObject

public void addRootModelObject(GuixModelObject gmo,
                               java.lang.Long l)
Adds a root GuixModelObject with its last modification time

Parameters:
gmo - the root GuixModelObject to add
l - its last modification time

addClassName

public void addClassName(java.lang.String className)

addCompiledFile

public void addCompiledFile(java.io.File f)
Ads a file to the compiled files list

Parameters:
f - the file to add

isFileAlreadyCompiled

public boolean isFileAlreadyCompiled(java.io.File f)
Has the file f already been compiled

Parameters:
f - the file we'd like to know if it has already been compiled
Returns:
true if f has already been compiled

addDependency

public void addDependency(GuixModelObject gmo,
                          ClassDescriptor cd)


Copyright © 2009 CodeLutin. All Rights Reserved.