org.joinedworkz.spring.boot.SpringBootDtoCartridge.xtend Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot Show documentation
Show all versions of spring-boot Show documentation
DSL based modeling framework - facilities SpringBoot
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)
}
}
}
}