Search in sources :

Example 1 with ValueTypeFactory

use of org.qi4j.runtime.types.ValueTypeFactory in project qi4j-sdk by Qi4j.

the class PropertyModel method bind.

@Override
public void bind(Resolution resolution) throws BindingException {
    ValueTypeFactory factory = ValueTypeFactory.instance();
    Class<?> declaringClass = ((Member) accessor()).getDeclaringClass();
    Class<?> mainType = first(resolution.model().types());
    valueType = factory.newValueType(type(), declaringClass, mainType, resolution.layer(), resolution.module());
    builderInfo = new BuilderPropertyInfo();
    if (type instanceof TypeVariable) {
        type = Classes.resolveTypeVariable((TypeVariable) type, declaringClass, mainType);
    }
}
Also used : TypeVariable(java.lang.reflect.TypeVariable) ValueTypeFactory(org.qi4j.runtime.types.ValueTypeFactory) Member(java.lang.reflect.Member)

Aggregations

Member (java.lang.reflect.Member)1 TypeVariable (java.lang.reflect.TypeVariable)1 ValueTypeFactory (org.qi4j.runtime.types.ValueTypeFactory)1