es.prodevelop.pui9.model.generator.layer.ServiceLayerGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of es.prodevelop.pui9.services Show documentation
Show all versions of es.prodevelop.pui9.services Show documentation
Support for business layer (BO)
package es.prodevelop.pui9.model.generator.layer;
import java.util.ArrayList;
import java.util.List;
import javax.tools.JavaFileObject;
import org.springframework.stereotype.Component;
import es.prodevelop.pui9.classpath.PuiClassLoaderUtils;
import es.prodevelop.pui9.model.generator.TemplateFileInfo;
import es.prodevelop.pui9.model.generator.layers.AbstractServiceLayerGenerator;
import es.prodevelop.pui9.service.interfaces.IService;
/**
* This class represents the Service Layer Generator, to generate all the files
* for the PUI Server.
*
* @author Marc Gil - [email protected]
*/
@Component
public class ServiceLayerGenerator extends AbstractServiceLayerGenerator {
@Override
protected List> getClassesToRegister(List templateList) throws Exception {
List> classes = new ArrayList<>();
for (TemplateFileInfo tfi : templateList) {
String className = (tfi.getPackageName() + "." + tfi.getFileName())
.replace(JavaFileObject.Kind.SOURCE.extension, "");
Class> clazz = PuiClassLoaderUtils.getClassLoader().loadClass(className);
if (IService.class.isAssignableFrom(clazz)) {
if (!clazz.isInterface()) {
classes.add(clazz);
}
}
}
return classes;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy