Class Loader

java.lang.Object
   |
   +----java.lang.ClassLoader
           |
           +----Loader

public class Loader
extends ClassLoader
Uses Java Reflection feature to load the class needed by Bind class and instantiates an object of that class and calls appropriate methods on it to store data.


Variable Index

 o myObject
Object to be associated with the instance returned using reflection

Constructor Index

 o Loader(String)
Constructor to find the class specified by string

Method Index

 o getObjectToBind()
Method to return the object which is to be stored in the database
 o getResource(String)
 o getResourceAsStream(String)
 o invokeConstructor()
Method to invoke the constructor on the class found, so that an object is instantiated
 o invokeSetValues(StringTokenizer, String[], boolean)
Method to set values of the object
 o loadClass(String)
 o loadClass(String, boolean)

Variables

 o myObject
 public Object myObject
Object to be associated with the instance returned using reflection

Constructors

 o Loader
 public Loader(String string) throws ClassNotFoundException
Constructor to find the class specified by string

Parameters:
string - Name of the class to be found
Throws: ClassNotFoundException
can't find class

Methods

 o getResource
 public URL getResource(String name)
Overrides:
getResource in class ClassLoader
 o getResourceAsStream
 public InputStream getResourceAsStream(String name)
Overrides:
getResourceAsStream in class ClassLoader
 o loadClass
 public Class loadClass(String name) throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
 o loadClass
 protected Class loadClass(String name,
                           boolean resolve) throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
 o invokeConstructor
 public void invokeConstructor() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
Method to invoke the constructor on the class found, so that an object is instantiated

Throws: InvocationTargetException
cant instantiate object
Throws: IllegalAccessException
cant access object
Throws: IllegalArgumentException
arguments incorrect for the method
Throws: InstantiationException
cant instantiate object
 o invokeSetValues
 public void invokeSetValues(StringTokenizer st,
                             String str[],
                             boolean consider) throws SecurityException, InvocationTargetException, IllegalAccessException
Method to set values of the object

Parameters:
st - Value to be passed on to the Object constructor
str - Value to be passed on to the Object constructor
consider - Value to indicate what type of value is being set
Throws: InvocationTargetException
cant instantiate object
Throws: IllegalAccessException
cant access object
Throws: SecurityException
cant instantiate object
 o getObjectToBind
 public Object getObjectToBind() throws InvocationTargetException, IllegalAccessException
Method to return the object which is to be stored in the database

Returns:
Object object to be stored
Throws: InvocationTargetException
cant instantiate object
Throws: IllegalAccessException
cant access object