boolean isCollectionType = TypeUtils.isCollectionType( fieldInfo.getType() );
//If it is a collection --> always create a stub
//And for stubs also create stubs, otherwise create a "real" object
JClass fieldType = getJaxbModelType( fieldInfo.getType(), isCollectionType || type == Scope.STUB );
JFieldVar field = addField( currentClass, fieldType, fieldInfo );
if ( isCollectionType ) {
JAnnotationUse annotation = field.annotate( XmlElement.class );
annotation.param( "name", NamingSupport.createSingular( field.name() ) );
}
addGetter( currentClass, fieldType, field, fieldInfo.getSimpleName() );
addSetter( currentClass, fieldType, field, fieldInfo.getSimpleName() );
}