From df1d498c3bed5edc8d7a31ad7aec288164b696b1 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 2 May 2024 17:46:08 +0200 Subject: [PATCH] WIP 7 --- .../biblio/marc21/Marc21XmlEncoder.java | 18 ++++++++++-------- .../biblio/marc21/MarcXmlEncoder.java | 5 ----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21XmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21XmlEncoder.java index 1998ca20d..c8128e9d0 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21XmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21XmlEncoder.java @@ -18,7 +18,7 @@ import org.metafacture.framework.FluxCommand; import org.metafacture.framework.ObjectReceiver; -import org.metafacture.framework.StreamPipe; +import org.metafacture.framework.Sender; import org.metafacture.framework.StreamReceiver; import org.metafacture.framework.annotations.Description; import org.metafacture.framework.annotations.In; @@ -35,23 +35,25 @@ @Out(String.class) @Description("Encodes MARC21 records as MARCXML. Similar to encode-marcxml but safer especially when the 'leader' has to be computed.") @FluxCommand("encode-marc21xml") -public class Marc21XmlEncoder extends MarcXmlEncoder implements StreamPipe> { +public class Marc21XmlEncoder extends MarcXmlEncoder implements Sender> { private final Marc21Decoder marc21Decoder = new Marc21Decoder(); - private final MarcXmlEncoder marcXmlEncoder= new MarcXmlEncoder(); + // private final MarcXmlEncoder marcXmlEncoder= new MarcXmlEncoder(); private final Marc21Encoder marc21Encoder = new Marc21Encoder(); public Marc21XmlEncoder() { marc21Decoder.setEmitLeaderAsWhole(true); marc21Encoder.setReceiver(marc21Decoder); - marc21Decoder.setReceiver(marcXmlEncoder); + marc21Decoder.setReceiver(this); + this.getSe(); + super.setReceiver(marc21Encoder); } @Override - public R setReceiver(final R receiver) { - marcXmlEncoder.setReceiver(receiver); - this.setReceiver(marc21Encoder); - return receiver; + public Sender> setReceiver(final ObjectReceiver receiver) { + // marcXmlEncoder.setReceiver(receiver); + // super.setReceiver(receiver); + return this; } } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index 3167a41ff..4f9d32b9e 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -51,11 +51,6 @@ public class MarcXmlEncoder extends DefaultStreamPipe> { private static final String ROOT_OPEN = ""; private static final String ROOT_CLOSE = ""; - public R setReceiver(final R receiver) { - this.setReceiver(receiver); - return receiver; - } - private enum Tag { collection(" xmlns%s=\"" + NAMESPACE + "\"%s"),