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 Summary
Fields Modifier and Type Field Description protected static CompilerConfigurationconfigurationshared instance of configuration *protected static JAXXEngineengineshared instance of engine. -
Constructor Summary
Constructors Modifier Constructor Description protectedJAXXFactory() -
Method Summary
Modifier and Type Method Description protected static voidcheckConfiguration()protected static voidcheckEngine()static JAXXEnginegetEngine()static voidinitFactory()Load theInitializerservices found via theServiceLoadermecanism.static booleanisEngineRegistred()static JAXXCompilernewDummyCompiler(java.lang.ClassLoader classLoader)Creates a dummy Compiler for use in unit testing or dettached use of an engine.static JAXXEnginenewDummyEngine()Create a new empty launchor and set it as current launchor accessible via methodgetEngine().static JAXXEnginenewEngine(java.io.File basedir, java.lang.String... relativePaths)Create a new launchor and set it as current launchor accessible via methodgetEngine().static voidsetConfiguration(CompilerConfiguration configuration)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
engine
shared instance of engine. -
configuration
shared instance of configuration *
-
-
Constructor Details
-
JAXXFactory
protected JAXXFactory()
-
-
Method Details
-
setConfiguration
-
newDummyEngine
Create a new empty launchor and set it as current launchor accessible via methodgetEngine().- Returns:
- the new instanciated launchor
-
newEngine
Create a new launchor and set it as current launchor accessible via methodgetEngine(). 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 pathsrelativePaths- a list of relative paths to .jaxx files being compiled- Returns:
- the new instanciated launchor
-
newDummyCompiler
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
- Returns:
- the current launchor
- Throws:
java.lang.NullPointerException- if no launchor was registred via anewEngine-likemethod.
-
isEngineRegistred
public static boolean isEngineRegistred()- Returns:
trueif there is an engine registred,falseotherwise.
-
initFactory
public static void initFactory()Load theInitializerservices found via theServiceLoadermecanism. -
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
-