Package org.postgresql.util
Class ObjectFactory
- java.lang.Object
-
- org.postgresql.util.ObjectFactory
-
-
Constructor Summary
Constructors Constructor Description ObjectFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
instantiate(String classname, Properties info, boolean tryString, String stringarg)
Instantiates a class using the appropriate constructor.
-
-
-
Method Detail
-
instantiate
public static Object instantiate(String classname, Properties info, boolean tryString, 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.- Parameters:
classname
- name of the class to instantiateinfo
- parameter to pass as PropertiestryString
- whether to look for a single String argument constructorstringarg
- parameter to pass as String- Returns:
- the instantiated class
- Throws:
ClassNotFoundException
- if something goes wrongSecurityException
- if something goes wrongNoSuchMethodException
- if something goes wrongIllegalArgumentException
- if something goes wrongInstantiationException
- if something goes wrongIllegalAccessException
- if something goes wrongInvocationTargetException
- if something goes wrong
-
-