se.datadosen.util
Class Template

java.lang.Object
  extended by se.datadosen.util.Template

public class Template
extends java.lang.Object

Fast multiple string search and replace utility.


Constructor Summary
Template(java.lang.String ts)
          Parse template string into a list of String and Key objects that can quickly be converted to a String, given a Map object containing key-value pairs.
Template(java.lang.String ts, char keyPrefix)
          Parse template string into a list of String and Key objects that can quickly be converted to a String, given a Map object containing key-value pairs
 
Method Summary
 java.lang.String toString(java.util.Map mapping)
          Convert Template to a String with the given mapping Unmapped keys will be left untouched
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Template

public Template(java.lang.String ts)
Parse template string into a list of String and Key objects that can quickly be converted to a String, given a Map object containing key-value pairs. The $ sign is key prefix

Parameters:
ts - template string

Template

public Template(java.lang.String ts,
                char keyPrefix)
Parse template string into a list of String and Key objects that can quickly be converted to a String, given a Map object containing key-value pairs

Parameters:
ts - template string
keyPrefix - char, usually the $ sign
Method Detail

toString

public java.lang.String toString(java.util.Map mapping)
Convert Template to a String with the given mapping Unmapped keys will be left untouched

Parameters:
mapping -
Returns: