Search in sources :

Example 6 with MixinModel

use of org.qi4j.runtime.composite.MixinModel in project qi4j-sdk by Qi4j.

the class ValueModel method newValueInstance.

public ValueInstance newValueInstance(ModuleInstance moduleInstance, ValueStateInstance state) {
    Object[] mixins = mixinsModel.newMixinHolder();
    ValueInstance instance = new ValueInstance(this, moduleInstance, mixins, state);
    // Instantiate all mixins
    int i = 0;
    InjectionContext injectionContext = new InjectionContext(instance, UsesInstance.EMPTY_USES, state);
    for (MixinModel mixinModel : mixinsModel.mixinModels()) {
        mixins[i++] = mixinModel.newInstance(injectionContext);
    }
    // Return
    return instance;
}
Also used : MixinModel(org.qi4j.runtime.composite.MixinModel) InjectionContext(org.qi4j.runtime.injection.InjectionContext)

Aggregations

MixinModel (org.qi4j.runtime.composite.MixinModel)6 InjectionContext (org.qi4j.runtime.injection.InjectionContext)3 AccessibleObject (java.lang.reflect.AccessibleObject)1 Method (java.lang.reflect.Method)1 Proxy (java.lang.reflect.Proxy)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 InvalidCompositeException (org.qi4j.api.composite.InvalidCompositeException)1 Constraint (org.qi4j.api.constraint.Constraint)1 Property (org.qi4j.api.property.Property)1 CompositeMethodModel (org.qi4j.runtime.composite.CompositeMethodModel)1 ConcernsModel (org.qi4j.runtime.composite.ConcernsModel)1 ConstraintsModel (org.qi4j.runtime.composite.ConstraintsModel)1 SideEffectsModel (org.qi4j.runtime.composite.SideEffectsModel)1 TransientStateInstance (org.qi4j.runtime.composite.TransientStateInstance)1 UsesInstance (org.qi4j.runtime.composite.UsesInstance)1 ValueConstraintsModel (org.qi4j.runtime.composite.ValueConstraintsModel)1 DependencyModel (org.qi4j.runtime.injection.DependencyModel)1 PropertyInstance (org.qi4j.runtime.property.PropertyInstance)1 PropertyModel (org.qi4j.runtime.property.PropertyModel)1