Package org.silverpeas.core.template
Class SilverpeasStringTemplate
- java.lang.Object
-
- org.silverpeas.core.template.SilverpeasStringTemplate
-
- All Implemented Interfaces:
SilverpeasTemplate
public class SilverpeasStringTemplate extends Object implements SilverpeasTemplate
-
-
Field Summary
-
Fields inherited from interface org.silverpeas.core.template.SilverpeasTemplate
TEMPLATE_CUSTOM_DIR, TEMPLATE_ROOT_DIR
-
-
Constructor Summary
Constructors Constructor Description SilverpeasStringTemplate(Properties templateConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
applyAttributes(org.antlr.stringtemplate.StringTemplate template)
String
applyFileTemplate(String fileName)
String
applyFileTemplateOnComponent(String componentName, String fileName)
String
applyStringTemplate(String label)
Map<String,Object>
getAttributes()
boolean
isCustomTemplateExists(String componentName, String fileName)
SilverpeasTemplate
mergeRootWithCustom()
When the result of string template processing is built from a combination of several template files, this method MUST be called BEFORE callingSilverpeasTemplate.applyFileTemplate(String)
.void
setAttribute(String name, Object value)
-
-
-
Constructor Detail
-
SilverpeasStringTemplate
public SilverpeasStringTemplate(Properties templateConfig)
-
-
Method Detail
-
mergeRootWithCustom
public SilverpeasTemplate mergeRootWithCustom()
Description copied from interface:SilverpeasTemplate
When the result of string template processing is built from a combination of several template files, this method MUST be called BEFORE callingSilverpeasTemplate.applyFileTemplate(String)
.It is in charge of merging the templates given by the product and the one modified by the customer. By this way, the customer modifies only the necessary templates in case of customization.
- Specified by:
mergeRootWithCustom
in interfaceSilverpeasTemplate
- Returns:
- itself.
-
applyFileTemplate
public String applyFileTemplate(String fileName)
- Specified by:
applyFileTemplate
in interfaceSilverpeasTemplate
-
applyStringTemplate
public String applyStringTemplate(String label)
- Specified by:
applyStringTemplate
in interfaceSilverpeasTemplate
-
applyAttributes
protected String applyAttributes(org.antlr.stringtemplate.StringTemplate template)
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttribute
in interfaceSilverpeasTemplate
-
getAttributes
public Map<String,Object> getAttributes()
- Specified by:
getAttributes
in interfaceSilverpeasTemplate
-
applyFileTemplateOnComponent
public String applyFileTemplateOnComponent(String componentName, String fileName)
- Specified by:
applyFileTemplateOnComponent
in interfaceSilverpeasTemplate
-
isCustomTemplateExists
public boolean isCustomTemplateExists(String componentName, String fileName)
- Specified by:
isCustomTemplateExists
in interfaceSilverpeasTemplate
-
-