|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.util.ClassFactory<K,I>
public abstract class ClassFactory<K,I>
This util class provides methods needed by class construction factories.
StructuredDocumentFactory
,
AdvertisementFactory
,
IDFactory
,
WireFormatMessageFactory
Constructor Summary | |
---|---|
protected |
ClassFactory()
Standard constructor. |
Method Summary | |
---|---|
protected abstract Map<K,I> |
getAssocTable()
Used by ClassFactory methods to get the mapping of keys to constructors. |
Iterator<K> |
getAvailableKeys()
Return all of the available keys for this factory. |
protected abstract Class<K> |
getClassForKey()
Used by ClassFactory methods to ensure that all keys used with the mapping are of the correct type. |
protected abstract Class<I> |
getClassOfInstantiators()
Used by ClassFactory methods to ensure that all of the instance classes which register with this factory have the correct base class |
Set<Map.Entry<K,I>> |
getEntrySet()
Returns an unmodifiable Set containing all of the associations stored in this ClassFactory. |
protected I |
getInstantiator(K key)
Return the instantiator associated with the provided key. |
protected boolean |
registerAssoc(K key,
I instantiator)
Register a key and instance class with the factory. |
protected boolean |
registerAssoc(String className)
Register a class with the factory from its class name. |
protected boolean |
registerFromFile(URI providerList)
Register instance classes given a URI to a file containing class names which must be found on the current class path. |
protected boolean |
registerFromResources(String resourceName,
String propertyName)
Given a resource bundle identifier and a property name register instance classes. |
protected boolean |
registerFromString(String classNamesString)
Register instance classes given a string containing class names which must be found on the current class path. |
protected boolean |
registerProviders(String interfaceName)
Given an provider interface name register instance classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ClassFactory()
Method Detail |
---|
protected abstract Map<K,I> getAssocTable()
protected abstract Class<K> getClassForKey()
public Iterator<K> getAvailableKeys()
public Set<Map.Entry<K,I>> getEntrySet()
protected abstract Class<I> getClassOfInstantiators()
protected boolean registerFromResources(String resourceName, String propertyName) throws MissingResourceException
resourceName
- name of the resource bundlepropertyName
- name of the property.
MissingResourceException
- if the resource bundle or
property cannot be located.protected boolean registerFromString(String classNamesString)
classNamesString
- The class name list
protected boolean registerProviders(String interfaceName)
interfaceName
- name of the implemented interface.
protected boolean registerFromFile(URI providerList)
providerList
- the URI to a file containing a list of providers
protected boolean registerAssoc(String className) throws Exception
className
- The class name which will be registered.
Exception
- when an error occurs.protected boolean registerAssoc(K key, I instantiator)
key
- The key to register.instantiator
- The instantiator object which will be registered for this key.
protected I getInstantiator(K key) throws NoSuchElementException
key
- The identifier for the Instantiator class to be returned.
NoSuchElementException
- if the key has not been registered.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |