org.joinedworkz.spring.boot.SpringBootDtoCartridge 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 java.util.List;
import java.util.Properties;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.xtext.xbase.lib.Extension;
import org.joinedworkz.common.java.DtoCartridge;
import org.joinedworkz.core.facility.Outlet;
import org.joinedworkz.core.facility.Outlets;
import org.joinedworkz.core.model.CmnModel;
import org.joinedworkz.core.model.CmnObject;
import org.joinedworkz.spring.boot.helper.OutletHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Singleton
@SuppressWarnings("all")
public class SpringBootDtoCartridge extends DtoCartridge {
private static final Logger log = LoggerFactory.getLogger(SpringBootDtoCartridge.class);
@Inject
@Extension
private OutletHelper _outletHelper;
@Override
public void apply(final CmnObject obj, final Outlets outlets, final Properties joinedWorkzProperties) {
if ((obj instanceof CmnModel)) {
final Outlet generatedDtoOutlet = this._outletHelper.getGeneratedDtoAndMapperOutlet(outlets, obj, joinedWorkzProperties);
SpringBootDtoCartridge.log.info("Invoke generator \'{}\' on model \'{}\'", this.dtoClassGenerator.getClass().getCanonicalName(), ((CmnModel)obj).getNamespace());
List _modelElements = ((CmnModel)obj).getModelElements();
for (final CmnObject modelElement : _modelElements) {
this.generateModelElement(modelElement, generatedDtoOutlet, joinedWorkzProperties);
}
}
}
}