Class TemplateResolver


  • public class TemplateResolver
    extends Object
    Resolves templates, meaning that it reads all dependencies of a template (and the dependencies of the dependencies etc.) and also takes care of using overriding templates. So each template is replaced by its overriding template in the result list. Templates are returned in dependency order. This means the following.

    Say there is dependency tree: A depends on B and C, B depends on D and E, C depends on F and G Then the returned result is computed depth-first: D, E, B, F, G, C, A During the resolving process the overriding takes precedence over dependency. This means that if a template is overridden then the dependencies of the overriding template are used and not the dependencies of the overridden template. Note: the resolving process accesses the database several times. It makes sense to cache the result.

    Author:
    mtaal
    See Also:
    Template.getOBCLKERTemplateDependencyList(), Template.getOverridesTemplate()
    • Constructor Detail

      • TemplateResolver

        public TemplateResolver()
    • Method Detail

      • resolve

        public List<Template> resolve​(Template template)
        See the description in the class header.
        Parameters:
        template - the template to resolve.
        Returns:
        the list of all templates: dependencies and overriding templates