Search in sources :

Example 1 with ValueBuilderInstance

use of org.qi4j.runtime.value.ValueBuilderInstance in project qi4j-sdk by Qi4j.

the class ModuleInstance method newValueBuilder.

@Override
public <T> ValueBuilder<T> newValueBuilder(Class<T> mixinType) throws NoSuchValueException {
    NullArgumentException.validateNotNull("mixinType", mixinType);
    ModelModule<ValueModel> compositeModelModule = typeLookup.lookupValueModel(mixinType);
    if (compositeModelModule == null) {
        throw new NoSuchValueException(mixinType.getName(), name());
    }
    StateResolver stateResolver = new InitialStateResolver(compositeModelModule.module());
    return new ValueBuilderInstance<>(compositeModelModule, this, stateResolver);
}
Also used : ValueBuilderInstance(org.qi4j.runtime.value.ValueBuilderInstance) NoSuchValueException(org.qi4j.api.value.NoSuchValueException) ValueModel(org.qi4j.runtime.value.ValueModel) FunctionStateResolver(org.qi4j.runtime.composite.FunctionStateResolver) StateResolver(org.qi4j.runtime.composite.StateResolver)

Aggregations

NoSuchValueException (org.qi4j.api.value.NoSuchValueException)1 FunctionStateResolver (org.qi4j.runtime.composite.FunctionStateResolver)1 StateResolver (org.qi4j.runtime.composite.StateResolver)1 ValueBuilderInstance (org.qi4j.runtime.value.ValueBuilderInstance)1 ValueModel (org.qi4j.runtime.value.ValueModel)1