Note
the class is NOT public API, so it is subject to change.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static < type of expected class T> T | Returns: the instantiated classexpected class of type T, if the classname instantiated doesn't match
the expected type of this class this method will fail expectedClass, String name of the class to instantiate classname, Properties parameter to pass as Properties info, boolean whether to look for a single String argument constructor tryString, @Nullable String parameter to pass as String stringarg)Instantiates a class using the appropriate constructor. |
| ObjectFactory | back to summary |
|---|---|
| public ObjectFactory() | |
| instantiate | back to summary |
|---|---|
| public static <T> T instantiate(Class<T> expectedClass, String classname, Properties info, boolean tryString, @Nullable String stringarg) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException Instantiates a class using the appropriate constructor. If a constructor with a single Propertiesparameter exists, it is used. Otherwise, if tryString is true a constructor with a single String argument is searched if it fails, or tryString is true a no argument constructor is tried.
| |