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.
-
myObject
- Object to be associated with the instance returned using reflection
-
Loader(String)
- Constructor to find the class specified by string
-
getObjectToBind()
- Method to return the object which is to be stored in the database
-
getResource(String)
-
-
getResourceAsStream(String)
-
-
invokeConstructor()
- Method to invoke the constructor on the class found, so
that an object is instantiated
-
invokeSetValues(StringTokenizer, String[], boolean)
- Method to set values of the object
-
loadClass(String)
-
-
loadClass(String, boolean)
-
myObject
public Object myObject
- Object to be associated with the instance returned using reflection
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
getResource
public URL getResource(String name)
- Overrides:
- getResource in class ClassLoader
getResourceAsStream
public InputStream getResourceAsStream(String name)
- Overrides:
- getResourceAsStream in class ClassLoader
loadClass
public Class loadClass(String name) throws ClassNotFoundException
- Overrides:
- loadClass in class ClassLoader
loadClass
protected Class loadClass(String name,
boolean resolve) throws ClassNotFoundException
- Overrides:
- loadClass in class ClassLoader
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
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
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