jaxx.compiler.tasks
Class GenerateConstructorsTask

java.lang.Object
  extended by jaxx.compiler.tasks.JAXXEngineTask
      extended by jaxx.compiler.tasks.GenerateConstructorsTask

public class GenerateConstructorsTask
extends JAXXEngineTask

Task to execute just after finalize task to create all constructors for any compiler.

In fact, we can not compute constructor in one time since some compiler may need of the constructors of previous compiler...

This task will compute all constructors to generate.

Since:
2.4
Author:
tchemit
See Also:
JavaConstructor

Field Summary
static String TASK_NAME
          Task name
 
Constructor Summary
GenerateConstructorsTask()
           
 
Method Summary
protected  void addConstructor(JAXXCompiler compiler, String className, List<String> constructorTypes)
           
protected  void addConstructorsForNoneSuperClassJaxx(JAXXEngine engine, JAXXCompiler compiler)
          To add constructor on the given compiler, knowing that the super class of it is not a jaxx class.
protected  void addConstructorsForSuperClassJaxx(JAXXEngine engine, JAXXCompiler compiler, JAXXCompiler parentCompiler)
          To add constructor on the given compiler, knowing that the super class of it is a jaxx class.
protected  void addConstructorWithInitialContext(JAXXCompiler compiler, String className, List<String> constructorTypes, boolean superclassIsJAXXObject)
           
protected  List<List<String>> getDeclaredConstructorPrototypes(JAXXCompiler compiler, JavaFile javaFile)
           
 boolean perform(JAXXEngine engine)
          Performs the task on the given engine.
 
Methods inherited from class jaxx.compiler.tasks.JAXXEngineTask
addEndProfileTime, addStartProfileTime, checkAllFilesCompiled, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TASK_NAME

public static final String TASK_NAME
Task name

See Also:
Constant Field Values
Constructor Detail

GenerateConstructorsTask

public GenerateConstructorsTask()
Method Detail

perform

public boolean perform(JAXXEngine engine)
                throws Exception
Description copied from class: JAXXEngineTask
Performs the task on the given engine.

Specified by:
perform in class JAXXEngineTask
Parameters:
engine - the engine to use
Returns:
false if task failed (with no exception), true otherwise.
Throws:
Exception - if any error

addConstructorsForNoneSuperClassJaxx

protected void addConstructorsForNoneSuperClassJaxx(JAXXEngine engine,
                                                    JAXXCompiler compiler)
                                             throws ClassNotFoundException,
                                                    IllegalStateException
To add constructor on the given compiler, knowing that the super class of it is not a jaxx class.

In this mode, we takes all the constructors of the parent (if parent has some!) and for each of them add the simple one and another one with first parameter a JAXXContext.

Parameters:
engine - the current engine which compiled compiler
compiler - the current compiler to treat
Throws:
ClassNotFoundException - if a class could not be found (when wanted to have extact type for constructor parameters)
IllegalStateException - if given compiler has a super JAXX class.

addConstructorsForSuperClassJaxx

protected void addConstructorsForSuperClassJaxx(JAXXEngine engine,
                                                JAXXCompiler compiler,
                                                JAXXCompiler parentCompiler)
                                         throws ClassNotFoundException,
                                                IllegalStateException
To add constructor on the given compiler, knowing that the super class of it is a jaxx class.

In this mode, we takes all the constructors of the parent (if parent has some!) and for each of them add the simple one and another one with first parameter a JAXXContext.

Parameters:
engine - the current engine which compiled compiler
compiler - the current compiler to treat
parentCompiler - the compiler of the super class (can be null if super class was not generated by the given engine).
Throws:
ClassNotFoundException - if a class could not be found (when wanted to have extact type for constructor parameters)
IllegalStateException - if given compiler has not a super JAXX class.

getDeclaredConstructorPrototypes

protected List<List<String>> getDeclaredConstructorPrototypes(JAXXCompiler compiler,
                                                              JavaFile javaFile)
                                                       throws ClassNotFoundException
Throws:
ClassNotFoundException

addConstructor

protected void addConstructor(JAXXCompiler compiler,
                              String className,
                              List<String> constructorTypes)
                       throws CompilerException
Throws:
CompilerException

addConstructorWithInitialContext

protected void addConstructorWithInitialContext(JAXXCompiler compiler,
                                                String className,
                                                List<String> constructorTypes,
                                                boolean superclassIsJAXXObject)
                                         throws CompilerException
Throws:
CompilerException


Copyright © 2008-2011 CodeLutin. All Rights Reserved.