be.objectify.led
Class ObjectFactoryRegistry

java.lang.Object
  extended by be.objectify.led.ObjectFactoryRegistry

public class ObjectFactoryRegistry
extends Object

Registry of object factories for creating objects of the correct type based on the field.

Author:
Steve Chaloner

Constructor Summary
ObjectFactoryRegistry()
          Initialises a new instance of this class by registering the default object factories.
 
Method Summary
 ObjectFactory getFactory(Class clazz)
          Gets the object factory for the given class.
 void register(List<ObjectFactory> objectFactories)
          Registers the object factories with the registry.
 void register(ObjectFactory... objectFactories)
          Registers the object factories with the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactoryRegistry

public ObjectFactoryRegistry()
Initialises a new instance of this class by registering the default object factories.

Method Detail

register

public void register(ObjectFactory... objectFactories)
Registers the object factories with the registry.

Parameters:
objectFactories - the object factories. None of the factories can be null.

register

public void register(List<ObjectFactory> objectFactories)
Registers the object factories with the registry.

Parameters:
objectFactories - the object factories to register. Must not be null; none of contents

getFactory

public ObjectFactory getFactory(Class clazz)
Gets the object factory for the given class.

Parameters:
clazz - the class of the required object
Returns:
the object factory, or null if no factory is registered for the class


Copyright © 2010 Objectify. All Rights Reserved.