Package org.nuiton.jaxx.compiler
Class JAXXFactory
- java.lang.Object
-
- org.nuiton.jaxx.compiler.JAXXFactory
-
public class JAXXFactory extends Object
Factory ofJAXXCompilerandJAXXEngine.- Since:
- 2.0.2
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidcheckConfiguration()protected static voidcheckEngine()static JAXXEnginegetEngine()static voidinitFactory()Load theInitializerservices found via theServiceLoadermecanism.static booleanisEngineRegistred()static JAXXCompilernewDummyCompiler(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(File basedir, String... relativePaths)Create a new launchor and set it as current launchor accessible via methodgetEngine().static voidsetConfiguration(CompilerConfiguration configuration)
-
-
-
Field Detail
-
engine
protected static JAXXEngine engine
shared instance of engine.
-
configuration
protected static CompilerConfiguration configuration
shared instance of configuration *
-
-
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 methodgetEngine().- 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 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
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 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 NullPointerException- Throws:
NullPointerException
-
checkEngine
protected static void checkEngine() throws NullPointerException- Throws:
NullPointerException
-
-