|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.util.ClassFactory
This util class provides methods needed by class construction factories. FIXME bondolo@jxta.org 20010223 This implementation needs a way to return the list of key -> class associations
StructuredDocumentFactory
,
AdvertisementFactory
,
IDFactory
Constructor Summary | |
ClassFactory()
|
Method Summary | |
protected java.lang.Object |
callStaticMethod(java.lang.Object key,
java.lang.String name,
java.lang.Class[] paramSet,
java.lang.Object[] params)
Call a static method of the class associated with the provided key. |
protected abstract java.util.Hashtable |
getAssocTable()
Used by ClassFactory methods to get the mapping of keys to constructors. |
protected abstract java.lang.Class |
getBaseClassForFactory()
Used by ClassFactory methods to ensure that all of the instance classes which register with this factory have the correct base class |
protected abstract java.lang.Class |
getClassForKey()
Used by ClassFactory methods to ensure that all keys used with the mapping are of the correct type. |
protected abstract java.lang.Class[][] |
getRequiredConstructors()
Used by ClassFactory methods to determine the required set of constructors needed by the instance classes generated by this factory. |
protected abstract java.lang.Object[][] |
getRequiredStaticMethods()
Used by ClassFactory methods to determine the required set of static methods needed by classes registering with this factory. |
protected java.lang.Object |
newInstance(java.lang.Object key,
java.lang.Class[] constructorMatching,
java.lang.Object[] params)
Create a new instance of the class associated with the provided key. |
protected boolean |
registerAssoc(java.lang.Object key,
java.lang.Class instanceClass)
Register a key and instance class with the factory. |
protected boolean |
registerAssoc(java.lang.String className)
Register a class with the factory from its class name. |
protected boolean |
registerFromResources(java.lang.String resourceName,
java.lang.String propertyName)
Given a resource bundle identifier and a property name register instance classes. |
protected boolean |
registerFromString(java.lang.String classNamesString)
Register instance classes given a string containing class names which must be found on the current class path. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ClassFactory()
Method Detail |
protected abstract java.util.Hashtable getAssocTable()
protected abstract java.lang.Class getClassForKey()
protected abstract java.lang.Class getBaseClassForFactory()
protected abstract java.lang.Class[][] getRequiredConstructors()
protected abstract java.lang.Object[][] getRequiredStaticMethods()
protected boolean registerFromResources(java.lang.String resourceName, java.lang.String propertyName) throws java.util.MissingResourceException
resourceName
- name of the resource bundlepropertyName
- name of the property.protected boolean registerFromString(java.lang.String classNamesString)
classNamesString
- The class name listprotected boolean registerAssoc(java.lang.String className) throws java.lang.Exception
className
- The class name which will be regiestered.protected boolean registerAssoc(java.lang.Object key, java.lang.Class instanceClass) throws java.lang.NoSuchMethodException, java.lang.SecurityException
key
- The key to register.instanceClass
- The class which will be registered for this key.protected java.lang.Object newInstance(java.lang.Object key, java.lang.Class[] constructorMatching, java.lang.Object[] params) throws java.lang.reflect.InvocationTargetException
key
- The identifier for the instance class to be created.constructorMatching
- identifies which constructor is needed for
the parameter set provided.params
- the parameters which will be provided to the constructor.protected java.lang.Object callStaticMethod(java.lang.Object key, java.lang.String name, java.lang.Class[] paramSet, java.lang.Object[] params) throws java.lang.reflect.InvocationTargetException
key
- The identifier for the instance class to be created.name
- identifies the method nameparams
- the parameters which will be provided to the method.
|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |