Interface ConfigurableFactory
-
public interface ConfigurableFactoryThe interface that context classes can implement to indicate they are a factory for classes.- Author:
- scf
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Tinstantiate(Class<? extends T> clazz, com.google.gson.JsonElement config, Object runtimeContext, Object editContext)Create an instance of the given class.Objectinstantiate(String className, com.google.gson.JsonElement config, Object runtimeContext, Object editContext)Create an instance of the given class.default Class<?>loadClass(String name)Loads the class with the specified binary name.
-
-
-
Method Detail
-
instantiate
Object instantiate(String className, com.google.gson.JsonElement config, Object runtimeContext, Object editContext) throws ConfigurationException
Create an instance of the given class.- Parameters:
className- The name of the class to instantiate.config- The configuration of the class.runtimeContext- The runtime context for the instance.editContext- The edit context for the instance.- Returns:
- an instance of the given class
- Throws:
ConfigurationException- if there is a problem instantiating the class.
-
instantiate
default <T> T instantiate(Class<? extends T> clazz, com.google.gson.JsonElement config, Object runtimeContext, Object editContext) throws ConfigurationException
Create an instance of the given class.- Type Parameters:
T- The class type.- Parameters:
clazz- The class to instantiate.config- The configuration of the class.runtimeContext- The runtime context for the instance.editContext- The edit context for the instance.- Returns:
- an instance of the given class
- Throws:
ConfigurationException- if there is a problem instantiating the class.
-
loadClass
default Class<?> loadClass(String name) throws ClassNotFoundException
Loads the class with the specified binary name. This method searches for classes in the same manner as theClassLoader.loadClass(String, boolean)method.- Parameters:
name- The binary name of the class- Returns:
- The resulting
Classobject - Throws:
ClassNotFoundException- If the class was not found
-
-