net.sf.seaf.factory.impl
Class DefaultInstantiatingFactory

java.lang.Object
  extended by net.sf.seaf.factory.impl.DefaultInstantiatingFactory
All Implemented Interfaces:
Factory

public class DefaultInstantiatingFactory
extends Object
implements Factory

Factory that always returns a new instance of the requested type created via Class.newInstance(). The requested type must therefore have a public default constructor.

Checked exceptions are re-thrown as SeafInstantiationException with the original exception wrapped.

See Also:
Class.newInstance()

Constructor Summary
DefaultInstantiatingFactory()
           
 
Method Summary
<Type> Type
getInstanceOf(Class<Type> type)
          Return an initialized instance of the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInstantiatingFactory

public DefaultInstantiatingFactory()
Method Detail

getInstanceOf

public final <Type> Type getInstanceOf(Class<Type> type)
                         throws SeafInstantiationException
Description copied from interface: Factory
Return an initialized instance of the specified type.

Specified by:
getInstanceOf in interface Factory
Parameters:
type - The type of the requested instance
Returns:
The instance
Throws:
SeafInstantiationException


Copyright © 2008-2011 SEAF. All Rights Reserved.