パッケージ org.postgresql.util
クラス ObjectFactory
java.lang.Object
org.postgresql.util.ObjectFactory
- 直系の既知のサブクラス:
MakeSSL
Helper class to instantiate objects. Note: the class is NOT public API, so it is subject
to change.
-
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明static <T> T
instantiate
(Class<T> expectedClass, String classname, Properties info, boolean tryString, @Nullable String stringarg) Instantiates a class using the appropriate constructor.
-
コンストラクタの詳細
-
ObjectFactory
public ObjectFactory()
-
-
メソッドの詳細
-
instantiate
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.- 型パラメータ:
T
- type of expected class- パラメータ:
expectedClass
- expected class of type T, if the classname instantiated doesn't match the expected type of this class this method will failclassname
- 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- 戻り値:
- the instantiated class
- 例外:
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
-