Package se.datadosen.io
Class ReplacingReader
java.lang.Object
java.io.Reader
se.datadosen.io.ReplacingReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
This class provides a utility function that transforms strings to replace embedded settings with the current values
of the setting.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionReplacingReader
(Reader input) ReplacingReader
(String search, String replace, Reader input) Convenience constructorReplacingReader
(Map<String, String> mapping, Reader input) Create an object where we'll filter an input stream replacing variables with values. -
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Constructor Details
-
ReplacingReader
Create an object where we'll filter an input stream replacing variables with values.- Parameters:
mapping
- The map from variable keys to output values.input
- The input Reader to be filtered.- Throws:
IOException
-
ReplacingReader
- Throws:
IOException
-
ReplacingReader
Convenience constructor- Throws:
IOException
-
-
Method Details
-
replace
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-