org.dawb.common.util.io
Class StreamMacroSubstitutor

java.lang.Object
  extended by org.dawb.common.util.io.StreamMacroSubstitutor

public class StreamMacroSubstitutor
extends java.lang.Object

This parses an XML file (and applies string interpolation (a.k.a. variable substitution. Every XML field in the XML document is examined during processing. Fields which contain a pattern beginning with "${", followed by a property key name and terminating with a "}", will trigger string interpolation.


Constructor Summary
StreamMacroSubstitutor()
           
 
Method Summary
static void process(java.io.Reader in, java.io.Writer out, MacroSupplier macroSupplier)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamMacroSubstitutor

public StreamMacroSubstitutor()
Method Detail

process

public static void process(java.io.Reader in,
                           java.io.Writer out,
                           MacroSupplier macroSupplier)
                    throws java.io.IOException
Parameters:
in - input xml containing macros of the form ${macroname} to be substituted
out - the source with macros found in macroSupplier change to the suppled values
macroSupplier - - supplier of macros for substition
Throws:
java.io.IOException