Package net.ontopia.utils
Class StringTemplateUtils
- java.lang.Object
-
- net.ontopia.utils.StringTemplateUtils
-
public class StringTemplateUtils extends Object
INTERNAL: Utilities for processing string templates containing %param% references.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description StringTemplateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
replace(String template, String param, String value)
INTERNAL: Replaces all %name% references with the value of the parameter param.static String
replace(String template, String param, String value, char sep_char)
INTERNAL: Replaces all references surrounded by a separator character with the value of the parameter param.static String
replace(String template, Map<String,Object> paramvalues)
INTERNAL: Replaces all %name% references with the value of the "name" key in the paramvalues Map.static String
replace(String template, Map<String,Object> paramvalues, char sep_char)
INTERNAL: Replaces all references surounded by a separator character with the value of the "name" key in the paramvalues Map.
-
-
-
Method Detail
-
replace
public static String replace(String template, Map<String,Object> paramvalues)
INTERNAL: Replaces all %name% references with the value of the "name" key in the paramvalues Map. Single '%' characters in the output must be represented as "%%" in the template.
-
replace
public static String replace(String template, Map<String,Object> paramvalues, char sep_char)
INTERNAL: Replaces all references surounded by a separator character with the value of the "name" key in the paramvalues Map. Single separator characters in the output must be represented by placing the separator character two times right behind each other in the template.- Parameters:
sep_char
- the separator charactor which delimits the references- Since:
- 1.3.1
-
replace
public static String replace(String template, String param, String value)
INTERNAL: Replaces all %name% references with the value of the parameter param. Single '%' characters in the output must be represented as "%%" in the template.- Since:
- 1.3.1
-
replace
public static String replace(String template, String param, String value, char sep_char)
INTERNAL: Replaces all references surrounded by a separator character with the value of the parameter param. Single separator characters in the output must be represented by placing the separator character two times right behind each other in the template.- Since:
- 1.3.1
-
-