net.sourceforge.domian.factory
Class StrictReturnsNullFactory<T>

java.lang.Object
  extended by net.sourceforge.domian.factory.StrictReturnsNullFactory<T>
All Implemented Interfaces:
Factory

public final class StrictReturnsNullFactory<T>
extends java.lang.Object
implements Factory

Generic factory class creating objects based on Specifications.

It is named strict because it returns null rather than a possible imperfect object. If the specification contains ambiguous data, or is somehow missing data, the factory will not construct any object.

Returns null object creation strategy means that the factory will silently return null when the first show-stopping obstacle occurs.

Since:
0.4
Author:
Eirik Torske

Constructor Summary
StrictReturnsNullFactory()
           
 
Method Summary
 T create(Specification specification)
          Alias of createObjectSpecifiedBy().
 T createObjectSpecifiedBy(Specification specification)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StrictReturnsNullFactory

public StrictReturnsNullFactory()
Method Detail

createObjectSpecifiedBy

public T createObjectSpecifiedBy(Specification specification)
Specified by:
createObjectSpecifiedBy in interface Factory
Returns:
an instance of type T, specified by given Specification; otherwise further events is based on factory implementation strategy

create

public T create(Specification specification)
Description copied from interface: Factory
Alias of createObjectSpecifiedBy().

Specified by:
create in interface Factory


Copyright © 2006-2010. All Rights Reserved.