//Sets the href
addHrefSet( block, targetObject );
//Sets the values
for ( FieldWithInitializationInfo fieldInfo : descriptor.getFieldInfos() ) {
JClass fieldType = getJaxbModelType( fieldInfo.getType() );
if ( fieldInfo.getSimpleName().equals( ID ) ) {
continue;
}
if ( shallSkip( fieldInfo, objectType ) ) {
continue;
}
JExpression value;
if ( isProbablyOwnType( fieldInfo.getType() ) ) {
JClass fieldStubType = getJaxbType( fieldInfo, true );
JClass fieldJaxbType = getJaxbType( fieldInfo, false );
if ( TypeUtils.isCollectionType( fieldInfo.getType() ) ) {
value = codeGenerator.getNewInstanceFactory().createCollectionInvocation( fieldStubType, fieldInfo.getSimpleName(), TypeUtils.isSetType( fieldInfo.getType() ) );
} else {
JClass fieldTypeToInstantiate = objectType == this.jaxbStub ? fieldStubType : fieldJaxbType;
value = codeGenerator.getNewInstanceFactory().create( fieldTypeToInstantiate, fieldInfo.getSimpleName() );
}
} else {
value = codeGenerator.getNewInstanceFactory().create( fieldType, fieldInfo.getSimpleName() );
}