All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.joinedworkz.spring.boot.SpringBootDtoCartridge.xtend Maven / Gradle / Ivy

There is a newer version: 1.3.46
Show newest version
package org.joinedworkz.spring.boot

import org.joinedworkz.common.java.DtoCartridge
import javax.inject.Singleton
import org.joinedworkz.core.model.CmnObject
import org.joinedworkz.core.facility.Outlets
import java.util.Properties
import org.joinedworkz.core.model.CmnModel
import org.slf4j.LoggerFactory
import org.slf4j.Logger
import javax.inject.Inject
import org.joinedworkz.spring.boot.helper.OutletHelper

@Singleton
class SpringBootDtoCartridge extends DtoCartridge {

    final static Logger log = LoggerFactory.getLogger(SpringBootDtoCartridge);
    
    @Inject
    extension OutletHelper;

    override void apply(CmnObject obj, Outlets outlets, Properties joinedWorkzProperties) {

        if (obj instanceof CmnModel) {
            
            val generatedDtoOutlet = getGeneratedDtoAndMapperOutlet(outlets, obj, joinedWorkzProperties)

            log.info("Invoke generator '{}' on model '{}'", dtoClassGenerator.class.canonicalName, obj.namespace)
            for (modelElement : obj.modelElements) {
                modelElement.generateModelElement(generatedDtoOutlet, joinedWorkzProperties)
            }
            
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy