Class TemplateCompilerFactory
- java.lang.Object
-
- org.rodnansol.core.generator.template.TemplateCompilerFactory
-
public class TemplateCompilerFactory extends Object
Factory class that uses theServiceLoaderclass to have dynamic implementations for theTemplateCompilerand make sure end users are able to customize it for their own taste.- Since:
- 0.1.2
- Author:
- nandorholozsnyak
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TemplateCompilergetDefaultProvidedInstance()Returns the default provided instance which is theHandlebarsTemplateCompiler.static TemplateCompilergetInstance(String templateCompilerName)Returns aTemplateCompilerinstance by its class name.static TemplateCompilergetInstanceByClassName(String className)Instantiates the incoming class by its name.
-
-
-
Method Detail
-
getInstance
public static TemplateCompiler getInstance(String templateCompilerName)
Returns aTemplateCompilerinstance by its class name.- Parameters:
templateCompilerName- template compiler's class name.- Returns:
TemplateCompilerinstance.- Throws:
IllegalStateException- if the given template compiler name is not having any implementation.
-
getInstanceByClassName
public static TemplateCompiler getInstanceByClassName(String className)
Instantiates the incoming class by its name.- Parameters:
className- class to be created.- Returns:
- created class.
- Throws:
IllegalStateException- if the class can not be created.
-
getDefaultProvidedInstance
public static TemplateCompiler getDefaultProvidedInstance()
Returns the default provided instance which is theHandlebarsTemplateCompiler.- Returns:
- returns a new
HandlebarsTemplateCompilerinstance.
-
-