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

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

There is a newer version: 1.3.46
Show newest version
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);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy