Class CompilerFactoryFactory
ICompilerFactory
s.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ICompilerFactory[]
Deprecated.static ICompilerFactory[]
getAllCompilerFactories
(ClassLoader classLoader) Finds all implementation oforg.codehaus.commons.compiler
through the classLoader, then loads and instantiates the implementations'ICompilerFactory
s.static ICompilerFactory
getCompilerFactory
(String compilerFactoryClassName) Deprecated.static ICompilerFactory
getCompilerFactory
(String compilerFactoryClassName, ClassLoader classLoader) Loads anICompilerFactory
implementation by class name.static ICompilerFactory
Deprecated.UsegetDefaultCompilerFactory(ClassLoader)
insteadstatic ICompilerFactory
getDefaultCompilerFactory
(ClassLoader classLoader) Finds the first implementation oforg.codehaus.commons.compiler
through the classLoader, then loads and instantiates the implementation'sICompilerFactory
.static String
-
Field Details
-
defaultCompilerFactory
-
-
Constructor Details
-
CompilerFactoryFactory
private CompilerFactoryFactory()
-
-
Method Details
-
getDefaultCompilerFactory
Deprecated.UsegetDefaultCompilerFactory(ClassLoader)
insteadEquivalent withgetDefaultCompilerFactory(Thread.currentThread().getContextClassLoader())
. The context class loader is typically a bad choice, because frameworks use (abuse?) the context class loader for different purposes, which causes problems in individual contexts. -
getDefaultCompilerFactory
Finds the first implementation oforg.codehaus.commons.compiler
through the classLoader, then loads and instantiates the implementation'sICompilerFactory
.If the implementation is on the application class path (which is the case for probably 99% of all environments), then the correct class loader to use would be
ClassLoader.getSystemClassLoader()
.- Returns:
- The
ICompilerFactory
of the first implementation that was loaded - Throws:
Exception
- Many things can go wrong while finding and initializing the default compiler factory
-
getAllCompilerFactories
Deprecated.UsegetAllCompilerFactories(ClassLoader)
insteadEquivalent withgetAllCompilerFactories(Thread.currentThread().getContextClassLoader())
. The context class loader is typically a bad choice, because frameworks use (abuse?) the context class loader for different purposes, which causes problems in individual contexts. -
getAllCompilerFactories
Finds all implementation oforg.codehaus.commons.compiler
through the classLoader, then loads and instantiates the implementations'ICompilerFactory
s.If the implementations are on the application class path (which is the case for probably 99% of all environments), then the correct class loader to use would be
ClassLoader.getSystemClassLoader()
.- Returns:
- The
ICompilerFactory
s of all implementations that were loaded - Throws:
Exception
- Many things can go wrong while finding and initializing the default compiler factory
-
getCompilerFactory
@Deprecated public static ICompilerFactory getCompilerFactory(String compilerFactoryClassName) throws Exception Deprecated.Equivalent withgetCompilerFactory(Thread.currentThread().getContextClassLoader())
.If the implementation is on the application class path (which is the case for probably 99% of all environments), then the correct class loader to use would be
ClassLoader.getSystemClassLoader()
.- Parameters:
compilerFactoryClassName
- Name of a class that implementsICompilerFactory
- Throws:
Exception
- Many things can go wrong while finding and initializing the default compiler factory
-
getCompilerFactory
public static ICompilerFactory getCompilerFactory(String compilerFactoryClassName, ClassLoader classLoader) throws Exception Loads anICompilerFactory
implementation by class name.If the implementation is on the application class path (which is the case for probably 99% of all environments), then the correct class loader to use would be
ClassLoader.getSystemClassLoader()
.- Parameters:
compilerFactoryClassName
- Name of a class that implementsICompilerFactory
- Throws:
Exception
- Many things can go wrong while loading and initializing the default compiler factory
-
getSpecificationVersion
- Returns:
- The version of the commons-compiler specification, or
null
-
getAllCompilerFactories(ClassLoader)
instead