uk.org.bryanray.testtoys.util
Class TemplateUtil

java.lang.Object
  extended by uk.org.bryanray.testtoys.util.TemplateUtil

public class TemplateUtil
extends java.lang.Object

Project:
TestDataLoader
Filename:
TemplateUtil.java
Creation Date:
24 May 2008
A class that substitutes placeholders of the form ${...} in a template with values.

Author:
Bryan Ray

Constructor Summary
TemplateUtil()
           
 
Method Summary
static java.lang.String substituteTemplatePlaceholders(java.lang.String template, java.util.Map<java.lang.String,java.lang.String> placeholderValues)
           
static java.lang.String substituteTemplatePlaceholders(java.lang.String template, java.util.Properties placeholderValues)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateUtil

public TemplateUtil()
Method Detail

substituteTemplatePlaceholders

public static java.lang.String substituteTemplatePlaceholders(java.lang.String template,
                                                              java.util.Map<java.lang.String,java.lang.String> placeholderValues)
Parameters:
template - The template which the place holders have been substituted into.
placeholderValues - The values to be substituted into the place holders.
Returns:
The template with the supplied place holders substituted into it.

substituteTemplatePlaceholders

public static java.lang.String substituteTemplatePlaceholders(java.lang.String template,
                                                              java.util.Properties placeholderValues)
Parameters:
template - The template which the place holders have been substituted into.
placeholderValues - The values to be substituted into the place holders.
Returns:
The template with the supplied place holders substituted into it.


Copyright © 2008. All Rights Reserved.