Package jaxx.compiler

Class JAXXFactory

java.lang.Object
jaxx.compiler.JAXXFactory

public class JAXXFactory
extends java.lang.Object
Factory of JAXXCompiler and JAXXEngine.
Since:
2.0.2
Author:
Tony Chemit - chemit@codelutin.com
  • Field Details

    • engine

      protected static JAXXEngine engine
      shared instance of engine.
    • configuration

      protected static CompilerConfiguration configuration
      shared instance of configuration *
  • Constructor Details

    • JAXXFactory

      protected JAXXFactory()
  • Method Details

    • setConfiguration

      public static void setConfiguration​(CompilerConfiguration configuration)
    • newDummyEngine

      public static JAXXEngine newDummyEngine()
      Create a new empty launchor and set it as current launchor accessible via method getEngine().
      Returns:
      the new instanciated launchor
    • newEngine

      public static JAXXEngine newEngine​(java.io.File basedir, java.lang.String... relativePaths)
      Create a new launchor and set it as current launchor accessible via method getEngine(). The launchor will be prepared to run a set of files, expressed as paths relative to a base directory. The class names of the compiled files are derived from the relative path strings (e.g. "example/Foo.jaxx" compiles into a class named "example.Foo").
      Parameters:
      basedir - the directory against which to resolve relative paths
      relativePaths - a list of relative paths to .jaxx files being compiled
      Returns:
      the new instanciated launchor
    • newDummyCompiler

      public static JAXXCompiler newDummyCompiler​(java.lang.ClassLoader classLoader)
      Creates a dummy Compiler for use in unit testing or dettached use of an engine.
      Parameters:
      classLoader - class loader to use
      Returns:
      the compiler
    • getEngine

      public static JAXXEngine getEngine() throws java.lang.NullPointerException
      Returns:
      the current launchor
      Throws:
      java.lang.NullPointerException - if no launchor was registred via a newEngine-like method.
    • isEngineRegistred

      public static boolean isEngineRegistred()
      Returns:
      true if there is an engine registred, false otherwise.
    • initFactory

      public static void initFactory()
      Load the Initializer services found via theServiceLoader mecanism.
    • checkConfiguration

      protected static void checkConfiguration() throws java.lang.NullPointerException
      Throws:
      java.lang.NullPointerException
    • checkEngine

      protected static void checkEngine() throws java.lang.NullPointerException
      Throws:
      java.lang.NullPointerException