Package jaxx.compiler

Interface CompiledObjectDecorator

All Known Implementing Classes:
BoxedCompiledObjectDecorator, DefaultCompiledObjectDecorator, HelpRootCompiledObjectDecorator

public interface CompiledObjectDecorator
Contract of compiled object decorator at generation time. Note : The implementation of this class must be stateless.
Since:
1.2
Author:
Tony Chemit - chemit@codelutin.com
  • Method Details

    • getName

      java.lang.String getName()
      Returns:
      the name of the decorator (match the content of a decorator attribute value in a JAXX file)
    • createCompleteSetupMethod

      java.lang.String createCompleteSetupMethod​(JAXXCompiler compiler, CompiledObject object, JavaFile javaFile)
      Obtain the setup code of the given object from the compiler to be inject in the generated method $completeSetup.
      Parameters:
      compiler - the compiler to use
      object - the compiled object to treate
      javaFile - the file to treate
      Returns:
      the code to inject in $completeSetup method in file
    • createInitializer

      boolean createInitializer​(JAXXCompiler compiler, CompiledObject root, CompiledObject object, java.lang.StringBuilder code, boolean lastWasMethodCall)
      Create the initializer code for the given compiled object and inject it in the code.
      Parameters:
      compiler - the compiler to use
      root - the root compiled object of the jaxx file
      object - the compiled object to treate
      code - where to store code to inject
      lastWasMethodCall - true if last instruction call was a method call
      Returns:
      true if the last instruction was a method call
    • finalizeCompiler

      void finalizeCompiler​(JAXXCompiler compiler, CompiledObject root, CompiledObject object, JavaFile javaFile, java.lang.String packageName, java.lang.String className, java.lang.String fullClassName) throws java.lang.ClassNotFoundException
      Finalize the given compiled object before any generation in the file.
      Parameters:
      compiler - the compiler to use
      root - the root compiled object of the jaxx file
      object - the compiled object to treate
      javaFile - the file to treate
      packageName - the package name
      className - the (simple ?) class name
      fullClassName - the fully class name
      Throws:
      java.lang.ClassNotFoundException - if a class is not found
    • getCreationCode

      java.lang.String getCreationCode​(JAXXCompiler compiler, CompiledObject object) throws CompilerException
      Obtain the creation code of the given object from the compiler to inject in generate method $initialize or createXXX in not inline.
      Parameters:
      compiler - the compiler to use
      object - the compiled object to treate
      Returns:
      the code to inject in $initialize (or in the createXXX in not inline) method to create the given object
      Throws:
      CompilerException - if any pb