Class CompilerFactoryFactory
ICompilerFactorys.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ICompilerFactory[]Deprecated.static ICompilerFactory[]getAllCompilerFactories(ClassLoader classLoader) Finds all implementation oforg.codehaus.commons.compilerthrough the classLoader, then loads and instantiates the implementations'ICompilerFactorys.static ICompilerFactorygetCompilerFactory(String compilerFactoryClassName) Deprecated.UsegetCompilerFactory(String, ClassLoader)insteadstatic ICompilerFactorygetCompilerFactory(String compilerFactoryClassName, ClassLoader classLoader) Loads anICompilerFactoryimplementation by class name.static ICompilerFactoryDeprecated.UsegetDefaultCompilerFactory(ClassLoader)insteadstatic ICompilerFactorygetDefaultCompilerFactory(ClassLoader classLoader) Finds the first implementation oforg.codehaus.commons.compilerthrough 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.- Throws:
Exception- See Also:
-
getDefaultCompilerFactory
Finds the first implementation oforg.codehaus.commons.compilerthrough 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
ICompilerFactoryof 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.- Throws:
Exception- See Also:
-
getAllCompilerFactories
Finds all implementation oforg.codehaus.commons.compilerthrough the classLoader, then loads and instantiates the implementations'ICompilerFactorys.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
ICompilerFactorys 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.UsegetCompilerFactory(String, ClassLoader)insteadEquivalent 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 anICompilerFactoryimplementation 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