net.sf.logdistiller.util
Class PropertiesReplacer

java.lang.Object
  extended by net.sf.logdistiller.util.PropertiesReplacer

public class PropertiesReplacer
extends Object

A small utility to replace properties within strings (syntax: ${name}).


Constructor Summary
PropertiesReplacer(Map properties)
           
PropertiesReplacer(Map properties, String beginMark, String endMark)
           
 
Method Summary
 String replaceProperties(String source)
          Replace ${name} by the value of the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesReplacer

public PropertiesReplacer(Map properties,
                          String beginMark,
                          String endMark)

PropertiesReplacer

public PropertiesReplacer(Map properties)
Method Detail

replaceProperties

public String replaceProperties(String source)
Replace ${name} by the value of the property.

Parameters:
source - String the string to interpret (or null)
Returns:
String the transformed string
Throws:
IllegalArgumentException - if the source string references an inexistent property


Copyright © 2004-2009. All Rights Reserved.