Class StreamMacroSubstitutor

java.lang.Object
uk.ac.gda.util.io.StreamMacroSubstitutor

public class StreamMacroSubstitutor extends 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 Details

    • StreamMacroSubstitutor

      public StreamMacroSubstitutor()
  • Method Details

    • process

      public static void process(Reader in, Writer out, MacroSupplier macroSupplier) throws 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:
      IOException