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 8ec4da2f..33b82425 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 @@ -48,10 +48,6 @@ public final class MarcXmlEncoder extends DefaultStreamPipe"; - private static final String ROOT_CLOSE = ""; - private enum Tag { collection(" xmlns%s=\"" + NAMESPACE + "\"%s"), @@ -106,7 +102,6 @@ public String close(final Object[] args) { private static final int TAG_END = 3; private final Encoder encoder = new Encoder(); - private final Marc21Decoder decoder = new Marc21Decoder(); private final Marc21Encoder wrapper = new Marc21Encoder(); private DefaultStreamPipe> pipe; @@ -115,6 +110,7 @@ public String close(final Object[] args) { * Creates an instance of {@link MarcXmlEncoder}. */ public MarcXmlEncoder() { + Marc21Decoder decoder = new Marc21Decoder(); decoder.setEmitLeaderAsWhole(true); wrapper @@ -136,7 +132,6 @@ public void setEmitNamespace(final boolean emitNamespace) { /** * Sets the flag to decide whether to omit the XML declaration. - * * Default value: {@value #OMIT_XML_DECLARATION} * * @param currentOmitXmlDeclaration true if the XML declaration is omitted, otherwise @@ -148,7 +143,6 @@ public void omitXmlDeclaration(final boolean currentOmitXmlDeclaration) { /** * Sets the XML version. - * * Default value: {@value #XML_VERSION} * * @param xmlVersion the XML version @@ -159,7 +153,6 @@ public void setXmlVersion(final String xmlVersion) { /** * Sets the XML encoding. - * * Default value: {@value #XML_ENCODING} * * @param xmlEncoding the XML encoding @@ -173,7 +166,6 @@ public void setXmlEncoding(final String xmlEncoding) { * If true, the input data is validated to ensure correct MARC21. Also the leader may be generated. * It acts as a wrapper: the input is piped to {@link org.metafacture.biblio.marc21.Marc21Encoder}, whose output is piped to {@link org.metafacture.biblio.marc21.Marc21Decoder}, whose output is piped to {@link org.metafacture.biblio.marc21.MarcXmlEncoder}. * This validation and treatment of the leader is more safe but comes with a performance impact. - * * Default value: {@value #ENSURE_CORRECT_MARC21_XML} * * @param ensureCorrectMarc21Xml if true the input data is validated to ensure correct MARC21. Also the leader may be generated. @@ -184,7 +176,6 @@ public void setEnsureCorrectMarc21Xml(final boolean ensureCorrectMarc21Xml) { /** * Formats the resulting xml by indentation. Aka "pretty printing". - * * Default value: {@value #PRETTY_PRINTED} * * @param formatted true if formatting is activated, otherwise false @@ -247,7 +238,7 @@ private static class Encoder extends DefaultStreamPipe> { private String currentEntity = ""; private boolean emitNamespace = true; - private Object[] namespacePrefix = new Object[]{emitNamespace ? NAMESPACE_PREFIX : EMPTY}; + private Object[] namespacePrefix = new Object[]{NAMESPACE_PREFIX}; private int indentationLevel; private boolean formatted = PRETTY_PRINTED;