jaxx.compiler
Class JAXXFactory

java.lang.Object
  extended by jaxx.compiler.JAXXFactory

public class JAXXFactory
extends Object

Factory of JAXXCompiler and JAXXEngine.

Since:
2.0.2
Author:
tchemit

Field Summary
protected static CompilerConfiguration configuration
          shared instance of configuration *
protected static JAXXEngine engine
          shared instance of engine.
 
Constructor Summary
protected JAXXFactory()
           
 
Method Summary
protected static void checkConfiguration()
           
protected static void checkEngine()
           
static JAXXEngine getEngine()
           
static void initFactory()
          Load the Initializer services found via theServiceLoader mecanism.
static boolean isEngineRegistred()
           
static JAXXCompiler newDummyCompiler(ClassLoader classLoader)
          Creates a dummy Compiler for use in unit testing or dettached use of an engine.
static JAXXEngine newDummyEngine()
          Create a new empty launchor and set it as current launchor accessible via method getEngine().
static JAXXEngine newEngine(File basedir, String... relativePaths)
          Create a new launchor and set it as current launchor accessible via method getEngine().
static void setConfiguration(CompilerConfiguration configuration)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

protected static JAXXEngine engine
shared instance of engine.


configuration

protected static CompilerConfiguration configuration
shared instance of configuration *

Constructor Detail

JAXXFactory

protected JAXXFactory()
Method Detail

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(File basedir,
                                   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(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 NullPointerException
Returns:
the current launchor
Throws:
NullPointerException - if no launchor was registred via a newEngine-like method.

isEngineRegistred

public static boolean isEngineRegistred()
Returns:
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 NullPointerException
Throws:
NullPointerException

checkEngine

protected static void checkEngine()
                           throws NullPointerException
Throws:
NullPointerException


Copyright © 2008-2010 CodeLutin. All Rights Reserved.