| java.lang.Object nextapp.echo2.app.util.PeerFactory
PeerFactory | public class PeerFactory (Code) | | A mechanism for retrieving instances of singleton peer objects which are
defined to each support a specific Class .
A properties file is used to associate peer classes with their supported
classes. The properties file should contain the fully qualified class
names of the supported objects as its keys. The values of the properties
file should contain the fully qualified class names of the peer objects.
A single instance of each peer class will be used to support ALL instances
of the supported class.
|
Method Summary | |
public Object | getPeerForObject(Class objectClass, boolean searchSuperClasses) Retrieves the appropriate peer instance for a given object
Class . |
PeerFactory | public PeerFactory(String resourceName, ClassLoader classLoader)(Code) | | Creates a new PeerFactory .
Parameters: resourceName - the name of the resource properties file from whichthe peer bindings may be retrieved (this file will be retrievedusing the PropertiesDiscovery system, so multipleinstances of the file within the CLASSPATH will beautomatically discovered. Parameters: classLoader - the ClassLoader to use for retrieving theresource file and for instantiating the peer singleton instances |
getPeerForObject | public Object getPeerForObject(Class objectClass, boolean searchSuperClasses)(Code) | | Retrieves the appropriate peer instance for a given object
Class . Returns null in the event that no peer is provided
to support the specified class.
Parameters: objectClass - the supported object class Parameters: searchSuperClasses - flag indicating whether superclassesof objectClass should be searched for peers ifnone can be found for objectClass itself the relevant peer, or null if none can be found |
|
|