org.postgresql.util
Class ObjectFactory

java.lang.Object
  extended by org.postgresql.util.ObjectFactory
Direct Known Subclasses:
MakeSSL

public class ObjectFactory
extends Object

Helper class to instantiate objects. Note: the class is NOT public API, so it is subject to change.


Constructor Summary
ObjectFactory()
           
 
Method Summary
static Object instantiate(String classname, Properties info, boolean tryString, String stringarg)
          Instantiates a class using the appropriate constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactory

public ObjectFactory()
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 - Nam of the class to instantiate
info - parameter to pass as Properties
tryString - weather to look for a single String argument constructor
stringarg - parameter to pass as String
Returns:
the instantiated class
Throws:
ClassNotFoundException - if something goes wrong
SecurityException - if something goes wrong
NoSuchMethodException - if something goes wrong
IllegalArgumentException - if something goes wrong
InstantiationException - if something goes wrong
IllegalAccessException - if something goes wrong
InvocationTargetException - if something goes wrong


Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.