org.qi4j.api.object
Interface ObjectFactory

All Known Subinterfaces:
Module

public interface ObjectFactory

This factory creates and injects POJO's.


Method Summary
 void injectTo(java.lang.Object instance, java.lang.Object... uses)
          Inject an existing instance.
<T> T
newObject(java.lang.Class<T> type, java.lang.Object... uses)
          Create new objects of the given type.
 

Method Detail

newObject

<T> T newObject(java.lang.Class<T> type,
                java.lang.Object... uses)
            throws NoSuchObjectException,
                   ConstructionException
Create new objects of the given type.

Parameters:
type - an object class which will be instantiated.
Returns:
new objects.
Throws:
ConstructionException - Thrown if instantiation fails.
NoSuchObjectException - Thrown if type class is not an object.

injectTo

void injectTo(java.lang.Object instance,
              java.lang.Object... uses)
              throws ConstructionException
Inject an existing instance. Only fields and methods will be called.

Parameters:
instance -
Throws:
ConstructionException