Class TemplateUtils
java.lang.Object
fr.opensagres.xdocreport.template.utils.TemplateUtils
Utilities for template cache, context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetCachedTemplateName(String reportId, String entryName) Returns the template cache name used to cache the given entry name (which is a template) of the given report id.static StringgetEntryName(String cachedTemplateName, int index) Returns the entry name of of the given cached template name.static intgetIndexReportEntryName(String cachedTemplateName) Returns the last index of the token '!'static StringgetReportId(String cachedTemplateName, int index) Returns the report of of the given cached template name.static fr.opensagres.xdocreport.core.io.IEntryInfogetTemplateCacheInfo(ITemplateCacheInfoProvider templateCacheInfoProvider, String templateName) static ObjectputContextForDottedKey(IContext context, String key, Object value) If key has '.' character in the key (ex : project.name), this method create aDynamicBeaninstance to emulate the bean Project#getName().
-
Constructor Details
-
TemplateUtils
public TemplateUtils()
-
-
Method Details
-
getCachedTemplateName
Returns the template cache name used to cache the given entry name (which is a template) of the given report id.- Parameters:
reportId- report id.entryName- entry name.- Returns:
-
getIndexReportEntryName
Returns the last index of the token '!' from the cachedTemplateName which delimit reportId and entryName.- Parameters:
cachedTemplateName- cached template name which follow pattern ($reportId '!' $entryName).- Returns:
-
getReportId
Returns the report of of the given cached template name.- Parameters:
cachedTemplateName- cached template name which follow pattern ($reportId '!' $entryName).index- of the '!' character.- Returns:
-
getEntryName
Returns the entry name of of the given cached template name.- Parameters:
cachedTemplateName- cached template name which follow pattern ($reportId '!' $entryName).index- of the '!' character.- Returns:
-
getTemplateCacheInfo
public static fr.opensagres.xdocreport.core.io.IEntryInfo getTemplateCacheInfo(ITemplateCacheInfoProvider templateCacheInfoProvider, String templateName) - Parameters:
templateCacheInfoProvider-templateName-- Returns:
-
putContextForDottedKey
If key has '.' character in the key (ex : project.name), this method create aDynamicBeaninstance to emulate the bean Project#getName().- Parameters:
context-key-value-- Returns:
-