common-util

local.tomas.util.factory
Class GenericFactory<P>

java.lang.Object
  extended by local.tomas.util.factory.GenericFactory<P>
Type Parameters:
P - type of objects the factory produces

public abstract class GenericFactory<P>
extends Object

A generic factory base class.

Author:
tomas.teubner

Constructor Summary
protected GenericFactory()
          Default constructor.
 
Method Summary
abstract  P createEntity(org.apache.commons.configuration.Configuration conf)
          Create an entity.
static
<X> GenericFactory<X>
getFactory(Class<X> entityClass, String name)
          Get factory singleton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericFactory

protected GenericFactory()
Default constructor.

Method Detail

getFactory

public static <X> GenericFactory<X> getFactory(Class<X> entityClass,
                                               String name)
                                    throws FactoryException
Get factory singleton.

Type Parameters:
X - type of objects the factory produces
Parameters:
entityClass - class of objects the factory produces
name - fully qualified class name of factory
Returns:
the factory
Throws:
FactoryException

createEntity

public abstract P createEntity(org.apache.commons.configuration.Configuration conf)
                        throws FactoryException
Create an entity.

Parameters:
conf - configuration of the entity
Returns:
new entity
Throws:
FactoryException

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.