Search in sources :

Example 1 with Template

use of org.whole.lang.pojo.model.Template in project whole by wholeplatform.

the class PojoNormalizerVisitor method resolveTemplateNameCollisionsInDeclarations.

public static void resolveTemplateNameCollisionsInDeclarations(Library entity, IBindingManager bindings, FreshNameGenerator entityNameGenerator) {
    Path findAllProductDeclarationsWithTemplateName = (Path) PojoTemplateManager.instance().create("findAllProductDeclarationsWithTemplateName");
    bindings.wEnterScope();
    for (ProductDeclaration declaration : BehaviorUtils.<ProductDeclaration>compileAndLazyEvaluate(findAllProductDeclarationsWithTemplateName, entity, bindings)) {
        Template template = declaration.getTemplate();
        template.wSetValue(entityNameGenerator.nextFreshName(StringUtils.toSimpleName(template.wStringValue())));
    }
    bindings.wExitScope();
}
Also used : Path(org.whole.lang.queries.model.Path) ProductDeclaration(org.whole.lang.pojo.model.ProductDeclaration) Template(org.whole.lang.pojo.model.Template)

Aggregations

ProductDeclaration (org.whole.lang.pojo.model.ProductDeclaration)1 Template (org.whole.lang.pojo.model.Template)1 Path (org.whole.lang.queries.model.Path)1