Commit ffeb81a8 authored by Vincent Horváth's avatar Vincent Horváth

added logs

parent 7a5d0113
......@@ -60,15 +60,17 @@ public class GeneratorImpl implements sk.tuke.bfi.core.generator.Generator {
@Override
public void generateBackend() {
int countEntities = 0;
for (Map.Entry<String, BaseEntity> entityEntry : backendInterpreter.getEntities().entrySet()) {
backendInterpreter.setEntity(entityEntry.getValue());
backendInterpreter.beforeGenerate();
generateBackendOneToOne(backendInterpreter);
countEntities++;
}
for (Class<TemplateGeneratorInterface> templateGeneratorInterfaceClass : templateGeneratorInterfaceClasses) {
runTemplateGenerator(templateGeneratorInterfaceClass, backendInterpreter.getEntities());
}
LOGGER.info(countEntities + " entities were generated successful.");
}
private void generateBackendOneToOne(BaseInterface interpreter) {
......@@ -155,7 +157,7 @@ public class GeneratorImpl implements sk.tuke.bfi.core.generator.Generator {
List<Node> nodes = doc.body().childNodes();
List<Class<?>> replacerClasses = getAnnotationClasses(Preprocessor.class, frontendInterpreter.getClass().getPackage());
runReplacer(nodes, replacerClasses);
runPreprocessor(nodes, replacerClasses);
fileHelper.saveFile(file.getPath().replaceAll(VIEW_EXTENSIONS, VIEW_GENERATE_EXTENSIONS), doc.body().html());
......@@ -164,14 +166,14 @@ public class GeneratorImpl implements sk.tuke.bfi.core.generator.Generator {
}
}
private void runReplacer(List<Node> nodes, List<Class<?>> replacerClasses) {
private void runPreprocessor(List<Node> nodes, List<Class<?>> replacerClasses) {
Iterator<Node> iter = nodes.iterator();
while (iter.hasNext()) {
Node node = iter.next();
Node parentNode = node.parentNode();
final String nodeName = node.nodeName();
if (!node.childNodes().isEmpty()) {
runReplacer(node.childNodes(), replacerClasses);
runPreprocessor(node.childNodes(), replacerClasses);
}
if (!nodeName.startsWith(BFI.toString())) {
......@@ -219,6 +221,7 @@ public class GeneratorImpl implements sk.tuke.bfi.core.generator.Generator {
}
}
LOGGER.info("Preprocessors for frontend templates were successful.");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment