org.omnaest.utils.structure.element.factory.concrete
Class FactoryTypeAwareReflectionBased<E>

java.lang.Object
  extended by org.omnaest.utils.structure.element.factory.concrete.FactoryTypeAwareReflectionBased<E>
Type Parameters:
E -
All Implemented Interfaces:
Factory<E>, FactoryTypeAware<E>

public class FactoryTypeAwareReflectionBased<E>
extends Object
implements FactoryTypeAware<E>

A FactoryTypeAware which uses ReflectionUtils.newInstanceOf(Class, Object...) to create new instances.

Author:
Omnaest

Constructor Summary
FactoryTypeAwareReflectionBased(Class<? extends E> type)
           
 
Method Summary
 Class<?> getInstanceType()
          Returns the Class type the Factory.newInstance() method produces
 E newInstance()
          Factory method for an element
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FactoryTypeAwareReflectionBased

public FactoryTypeAwareReflectionBased(Class<? extends E> type)
Parameters:
type -
See Also:
FactoryTypeAwareReflectionBased
Method Detail

newInstance

public E newInstance()
Description copied from interface: Factory
Factory method for an element

Specified by:
newInstance in interface Factory<E>
Returns:

getInstanceType

public Class<?> getInstanceType()
Description copied from interface: FactoryTypeAware
Returns the Class type the Factory.newInstance() method produces

Specified by:
getInstanceType in interface FactoryTypeAware<E>
Returns:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.