Package org.openbravo.client.kernel
Class TemplateResolver
- java.lang.Object
-
- org.openbravo.client.kernel.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 Summary
Constructors Constructor Description TemplateResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TemplateResolver
getInstance()
List<Template>
resolve(Template template)
See the description in the class header.static void
setInstance(TemplateResolver instance)
-
-
-
Method Detail
-
getInstance
public static TemplateResolver getInstance()
-
setInstance
public static void setInstance(TemplateResolver instance)
-
-