info.magnolia.objectfactory
Class ObjectManufacturer

java.lang.Object
  extended by info.magnolia.objectfactory.ObjectManufacturer

public class ObjectManufacturer
extends Object

Creates objects by dynamically resolving the parameters to use.

Version:
$Id$

Constructor Summary
ObjectManufacturer()
           
 
Method Summary
 Object newInstance(Class<?> clazz, ParameterResolver... parameterResolvers)
          Creates an object of the given type using parameters provided by a set of parameter resolvers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectManufacturer

public ObjectManufacturer()
Method Detail

newInstance

public Object newInstance(Class<?> clazz,
                          ParameterResolver... parameterResolvers)
Creates an object of the given type using parameters provided by a set of parameter resolvers. Will first look for a constructor annotated with @Inject, it can be public, private, protected or package private. It will then look at public constructors and use the greediest. The greediest constructor is the one that has the most number of arguments that the parameter resolvers can fulfill. If there is more than one constructor that qualifies as greediest it is unspecified which one will be used.



Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.