|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.netseeker.ejoe.adapter.AdapterFactory
public final class AdapterFactory
The AdapterFactory manages creation and caching of all known (already during runtime requested) SerializeAdapters. This factory is mostly used internally within EJOE with one big exception: If one is using a customized adapter, eg. a configurable adapter like the CastorAdapter, which should be initialized with a valid mapping file, then that adapter instance must get (re-)registered with this factory. To overwrite the default adapter instances use:
CastorAdapter myCastorAdapterInstance = new CastorAdapter( "PathToTheMappingFile" ); AdapterFactory.registerAdapter( myCastorAdapterInstance );AdapterFactory will then return myCastorAdapterInstance to all requests for CastorAdapter. To register multiple instances of a special adapter use:
CastorAdapter myCastorAdapterInstance1 = new CastorAdapter( "PathToTheMappingFile1" ); CastorAdapter myCastorAdapterInstance2 = new CastorAdapter( "PathToTheMappingFile2" ); AdapterFactory.registerAdapter( "CastorAdapter1", myCastorAdapterInstance1 ); AdapterFactory.registerAdapter( "CastorAdapter2", myCastorAdapterInstance2 );
Constructor Summary | |
---|---|
AdapterFactory()
|
Method Summary | |
---|---|
static void |
clear()
Removes all adapter registrations |
static SerializeAdapter |
createAdapter(java.lang.String name)
Returns either a new instance of the requested adapter or returns a already cached one. |
static java.lang.String |
getSupportedContentType(java.lang.String name)
Returns the supported content type for the given adapter synonym |
static void |
registerAdapter(SerializeAdapter adapter)
Registers a new adapter to the registry of known adapters while using the class name of the adapter as synonym within the registry |
static void |
registerAdapter(java.lang.String name,
SerializeAdapter adapter)
Registers a new adapter to the registry of known adapters while using the given name as synonym within the registry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdapterFactory()
Method Detail |
---|
public static SerializeAdapter createAdapter(java.lang.String name) throws IllegalAdapterException
name
- class name or synonym for the SerializeAdapter.
IllegalAdapterException
public static void registerAdapter(SerializeAdapter adapter)
adapter
- public static void registerAdapter(java.lang.String name, SerializeAdapter adapter)
name
- adapter
- public static void clear()
public static java.lang.String getSupportedContentType(java.lang.String name) throws IllegalAdapterException
name
- the synonym for the adapter
IllegalAdapterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |