Package io.debezium.config
Class Instantiator
java.lang.Object
io.debezium.config.Instantiator
Instantiates given classes reflectively.
- Author:
- Jiri Pechanec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoaderstatic <T> TgetInstance(String className) Instantiates the specified class using the no-args constructor.static <T> TgetInstance(String className, Configuration configuration) Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeConfiguration, if a configuration object is passed.static <T> TgetInstance(String className, Configuration configuration, ClassLoader classLoader) Instantiates the specified class using provided class loader and either using the no-args constructor or the constructor with a single parameter of typeConfiguration, if a configuration object is passed.static <T> TgetInstance(String className, ClassLoader classLoader) Instantiates the specified class using specified class loader and the no-args constructor.static <T> TgetInstanceWithProperties(String className, Properties prop) Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeProperties, if a properties object is passed.static <T> TgetInstanceWithProperties(String className, Properties prop, ClassLoader classLoader) Instantiates the specified class using provided class loader and either using the no-args constructor or the constructor with a single parameter of typeProperties, if a properties object is passed.static <T,C> T getInstanceWithProvidedConstructorType(String className, Class<C> constructorType, C constructorValue) static <T,C> T getInstanceWithProvidedConstructorType(String className, Class<C> constructorType, C constructorValue, ClassLoader cl)
-
Constructor Details
-
Instantiator
public Instantiator()
-
-
Method Details
-
getClassLoader
-
getInstance
Instantiates the specified class using the no-args constructor.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstance
Instantiates the specified class using specified class loader and the no-args constructor.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstance
Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeConfiguration, if a configuration object is passed.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstance
public static <T> T getInstance(String className, Configuration configuration, ClassLoader classLoader) Instantiates the specified class using provided class loader and either using the no-args constructor or the constructor with a single parameter of typeConfiguration, if a configuration object is passed.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstanceWithProperties
Instantiates the specified class either using the no-args constructor or the constructor with a single parameter of typeProperties, if a properties object is passed.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstanceWithProperties
public static <T> T getInstanceWithProperties(String className, Properties prop, ClassLoader classLoader) Instantiates the specified class using provided class loader and either using the no-args constructor or the constructor with a single parameter of typeProperties, if a properties object is passed.- Returns:
- The newly created instance or
nullif no class name was given
-
getInstanceWithProvidedConstructorType
-
getInstanceWithProvidedConstructorType
public static <T,C> T getInstanceWithProvidedConstructorType(String className, Class<C> constructorType, C constructorValue, ClassLoader cl)
-