com.arsdigita.persistence.metadata
Class ObjectTypeRegistry

java.lang.Object
  extended bycom.arsdigita.persistence.metadata.ObjectTypeRegistry

public class ObjectTypeRegistry
extends Object

Provides a general purpose object type adapter registry, which is aware of the type hierarchy

Author:
Daniel Berrange
See Also:
MetadataProviderRegistry

Constructor Summary
ObjectTypeRegistry()
           
 
Method Summary
 Object findAdapter(ObjectType type)
          Retrieves the best matching adapter for a object type.
 Object findAdapter(String type)
          Retrieves the best matching adapter for a object type.
 Object getAdapter(ObjectType type)
          Retrieves the adapter registered against this type, or null if none is registered.
 Object getAdapter(String type)
          Retrieves the adapter registered against this type, or null if none is registered.
 void registerAdapter(ObjectType type, Object adapter)
          Registers an adapter for a type
 void registerAdapter(String type, Object adapter)
          Registers an adapter for a type
 void unregisterAdapter(ObjectType type)
          Unregisters an adapter for a type
 void unregisterAdapter(String type)
          Unregisters an adapter for a type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectTypeRegistry

public ObjectTypeRegistry()
Method Detail

registerAdapter

public void registerAdapter(String type,
                            Object adapter)
Registers an adapter for a type

Parameters:
type - the object type name
adapter - the object type adapter

unregisterAdapter

public void unregisterAdapter(String type)
Unregisters an adapter for a type

Parameters:
type - the object type name

registerAdapter

public void registerAdapter(ObjectType type,
                            Object adapter)
Registers an adapter for a type

Parameters:
type - the object type
adapter - the object type adapter

unregisterAdapter

public void unregisterAdapter(ObjectType type)
Unregisters an adapter for a type

Parameters:
type - the object type

getAdapter

public Object getAdapter(String type)
Retrieves the adapter registered against this type, or null if none is registered.

Parameters:
type - the object type name
Returns:
the adapter, or null

getAdapter

public Object getAdapter(ObjectType type)
Retrieves the adapter registered against this type, or null if none is registered.

Parameters:
type - the object type
Returns:
the adapter, or null

findAdapter

public Object findAdapter(String type)
Retrieves the best matching adapter for a object type. Returns the exact match if present, otherwise recurses up the object type hierarchy

Parameters:
type - the object type name
Returns:
the best adapter, or null

findAdapter

public Object findAdapter(ObjectType type)
Retrieves the best matching adapter for a object type. Returns the exact match if present, otherwise recurses up the object type hierarchy

Parameters:
type - the object type
Returns:
the best adapter, or null


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC