org.qi4j.api.composite
Interface TransientBuilder<T>


public interface TransientBuilder<T>

TransientBuilders are used to instantiate TransientComposites. They can be acquired from TransientBuilderFactory.newTransientBuilder(Class) and allows the client to provide additional settings before instantiating the TransientComposite.


Method Summary
 T newInstance()
          Create a new Composite instance.
 T prototype()
          Get a representation of the state for the new Composite.
<K> K
prototypeFor(java.lang.Class<K> mixinType)
          Get a representation of the state of the given type for the new Composite.
 TransientBuilder<T> use(java.lang.Object... usedObjects)
          Provide objects that can be injected into mixins that has the @Uses dependency injection annotation.
 

Method Detail

use

TransientBuilder<T> use(java.lang.Object... usedObjects)
Provide objects that can be injected into mixins that has the @Uses dependency injection annotation.

Parameters:
usedObjects - The objects that can be injected into mixins.
Returns:
the transient builder instance
See Also:
Uses

prototype

T prototype()
Get a representation of the state for the new Composite. It is possible to access and update properties and associations, even immutable ones since the builder represents the initial state.

Returns:
a proxy implementing the Composite type

prototypeFor

<K> K prototypeFor(java.lang.Class<K> mixinType)
Get a representation of the state of the given type for the new Composite. This is primarily used if you want to provide state for a private mixin type.

Parameters:
mixinType - the mixin which you want to provide state for
Returns:
a proxy implementing the given mixin type

newInstance

T newInstance()
              throws ConstructionException
Create a new Composite instance.

Returns:
a new Composite instance
Throws:
ConstructionException - thrown if it was not possible to instantiate the Composite