net.ontopia.utils
Class StringTemplateUtils

java.lang.Object
  extended by net.ontopia.utils.StringTemplateUtils

public class StringTemplateUtils
extends java.lang.Object

INTERNAL: Utilities for processing string templates containing %param% references.

Since:
1.3

Constructor Summary
StringTemplateUtils()
           
 
Method Summary
static java.lang.String replace(java.lang.String template, java.util.Map paramvalues)
          INTERNAL: Replaces all %name% references with the value of the "name" key in the paramvalues Map.
static java.lang.String replace(java.lang.String template, java.util.Map paramvalues, char sep_char)
          INTERNAL: Replaces all references surounded by a separator character with the value of the "name" key in the paramvalues Map.
static java.lang.String replace(java.lang.String template, java.lang.String param, java.lang.String value)
          INTERNAL: Replaces all %name% references with the value of the parameter param.
static java.lang.String replace(java.lang.String template, java.lang.String param, java.lang.String value, char sep_char)
          INTERNAL: Replaces all references surrounded by a separator character with the value of the parameter param.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTemplateUtils

public StringTemplateUtils()
Method Detail

replace

public static java.lang.String replace(java.lang.String template,
                                       java.util.Map 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 java.lang.String replace(java.lang.String template,
                                       java.util.Map 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 java.lang.String replace(java.lang.String template,
                                       java.lang.String param,
                                       java.lang.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 java.lang.String replace(java.lang.String template,
                                       java.lang.String param,
                                       java.lang.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


Copyright © 2000-2012 Ontopia.