Commit 5315e37d authored by R.W.Majeed's avatar R.W.Majeed

Streams.transfer no longer transfers meta information

parent f775df89
......@@ -33,13 +33,16 @@ public class Streams {
}
/**
* Transfers meta information and all observations from source to target.
* Transfers all observations from source to target.
* Does not transfer any meta information.
* <p>
* For transferring meta information,
* see {@link Meta#transfer(ObservationSupplier, ObservationHandler)}
*
* @param source observation source
* @param target observation handler
*/
public static void transfer(ObservationSupplier source, ObservationHandler target){
Meta.transfer(source, target);
public static void transfer(Supplier<Observation> source, Consumer<Observation> target){
Streams.nonNullStream(source).forEach(target);
}
......
......@@ -144,6 +144,7 @@ public class TestXMLWriter {
ObservationSupplier s = t.getExampleSupplier();
Document doc = createDocument();
GroupedXMLWriter w = new GroupedXMLWriter(new DOMResult(doc));
Meta.transfer(s, w);
Streams.transfer(s, w);
w.close();
s.close();
......@@ -157,6 +158,7 @@ public class TestXMLWriter {
t.initializeObservationFactory();
ObservationSupplier s = t.getExampleSupplier();
GroupedXMLWriter w = new GroupedXMLWriter(debugLog);
Meta.transfer(s, w);
Streams.transfer(s, w);
w.close();
s.close();
......@@ -212,6 +214,7 @@ public class TestXMLWriter {
t.initializeObservationFactory();
ObservationSupplier s = t.getExampleSupplier();
GroupedXMLWriter w = new GroupedXMLWriter(out);
Meta.transfer(s, w);
Streams.transfer(s, w);
s.close();
w.close();
......
......@@ -11,6 +11,7 @@ import de.sekmi.histream.DateTimeAccuracy;
import de.sekmi.histream.Observation;
import de.sekmi.histream.ext.Patient;
import de.sekmi.histream.ext.Visit;
import de.sekmi.histream.impl.Meta;
import de.sekmi.histream.io.GroupedXMLWriter;
import de.sekmi.histream.io.Streams;
......@@ -31,6 +32,7 @@ public class TestETLSupplier {
public void testXMLConversion() throws Exception{
GroupedXMLWriter w = new GroupedXMLWriter(System.out);
// transfer meta information
Meta.transfer(os, w);
Streams.transfer(os, w);
w.close();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment