Class GenerateConstructorsTask

java.lang.Object
jaxx.compiler.tasks.JAXXEngineTask
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 - chemit@codelutin.com
See Also:
JavaConstructor
  • Field Details

  • Constructor Details

    • GenerateConstructorsTask

      public GenerateConstructorsTask()
  • Method Details

    • perform

      public boolean perform​(JAXXEngine engine) throws java.lang.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:
      java.lang.Exception - if any error
    • addConstructorsForNoneSuperClassJaxx

      protected void addConstructorsForNoneSuperClassJaxx​(JAXXEngine engine, JAXXCompiler compiler) throws java.lang.ClassNotFoundException, java.lang.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:
      java.lang.ClassNotFoundException - if a class could not be found (when wanted to have extact type for constructor parameters)
      java.lang.IllegalStateException - if given compiler has a super JAXX class.
    • addConstructorsForSuperClassJaxx

      protected void addConstructorsForSuperClassJaxx​(JAXXEngine engine, JAXXCompiler compiler, JAXXCompiler parentCompiler) throws java.lang.ClassNotFoundException, java.lang.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:
      java.lang.ClassNotFoundException - if a class could not be found (when wanted to have extact type for constructor parameters)
      java.lang.IllegalStateException - if given compiler has not a super JAXX class.
    • getDeclaredConstructorPrototypes

      protected java.util.List<java.util.List<java.lang.String>> getDeclaredConstructorPrototypes​(JAXXCompiler compiler, JavaFile javaFile) throws java.lang.ClassNotFoundException
      Throws:
      java.lang.ClassNotFoundException
    • addConstructor

      protected void addConstructor​(JAXXCompiler compiler, java.lang.String className, java.util.List<java.lang.String> constructorTypes) throws CompilerException
      Throws:
      CompilerException
    • addConstructorWithInitialContext

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