Package org.nuiton.jaxx.compiler.tasks
Class GenerateConstructorsTask
- java.lang.Object
-
- org.nuiton.jaxx.compiler.tasks.JAXXEngineTask
-
- org.nuiton.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:
- Tony Chemit - dev@tchemit.fr
- See Also:
JavaConstructor
-
-
Constructor Summary
Constructors Constructor Description GenerateConstructorsTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConstructor(JAXXCompiler compiler, String className, List<String> constructorTypes)protected voidaddConstructorsForNoneSuperClassJaxx(JAXXEngine engine, JAXXCompiler compiler)To add constructor on the givencompiler, knowing that the super class of it is not a jaxx class.protected voidaddConstructorsForSuperClassJaxx(JAXXEngine engine, JAXXCompiler compiler, JAXXCompiler parentCompiler)To add constructor on the givencompiler, knowing that the super class of it is a jaxx class.protected voidaddConstructorWithInitialContext(JAXXCompiler compiler, String className, List<String> constructorTypes, boolean superclassIsJAXXObject)protected List<List<String>>getDeclaredConstructorPrototypes(JAXXCompiler compiler, JavaFile javaFile)booleanperform(JAXXEngine engine)Performs the task on the givenengine.-
Methods inherited from class org.nuiton.jaxx.compiler.tasks.JAXXEngineTask
addEndProfileTime, addStartProfileTime, checkAllFilesCompiled, getName
-
-
-
-
Field Detail
-
TASK_NAME
public static final String TASK_NAME
Task name- See Also:
- Constant Field Values
-
-
Method Detail
-
perform
public boolean perform(JAXXEngine engine) throws Exception
Description copied from class:JAXXEngineTaskPerforms the task on the givenengine.- Specified by:
performin classJAXXEngineTask- Parameters:
engine- the engine to use- Returns:
falseif task failed (with no exception),trueotherwise.- Throws:
Exception- if any error
-
addConstructorsForNoneSuperClassJaxx
protected void addConstructorsForNoneSuperClassJaxx(JAXXEngine engine, JAXXCompiler compiler) throws ClassNotFoundException, IllegalStateException
To add constructor on the givencompiler, 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 aJAXXContext.- Parameters:
engine- the current engine which compiled compilercompiler- 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 givencompiler has a super JAXX class.
-
addConstructorsForSuperClassJaxx
protected void addConstructorsForSuperClassJaxx(JAXXEngine engine, JAXXCompiler compiler, JAXXCompiler parentCompiler) throws ClassNotFoundException, IllegalStateException
To add constructor on the givencompiler, 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 aJAXXContext.- Parameters:
engine- the current engine which compiled compilercompiler- the current compiler to treatparentCompiler- the compiler of the super class (can benullif 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 givencompiler 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
-
-