-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP10 mit interface jetzt - zudem tests anfang!
- Loading branch information
Showing
7 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoderAbstract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.metafacture.biblio.marc21; | ||
|
||
import org.metafacture.framework.ObjectReceiver; | ||
import org.metafacture.framework.helpers.DefaultStreamPipe; | ||
|
||
public abstract class MarcXmlEncoderAbstract extends DefaultStreamPipe<ObjectReceiver<String>> implements MarcXmlEncoderInterface { | ||
public void onResetStream(){ | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoderInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.metafacture.biblio.marc21; | ||
|
||
public interface MarcXmlEncoderInterface { | ||
|
||
/** | ||
* Sets the flag to decide whether to emit the {@value MarcXmlEncoder#NAMESPACE_NAME} | ||
* namespace | ||
* | ||
* @param emitNamespace true if the namespace is emitted, otherwise false | ||
*/ | ||
void setEmitNamespace(final boolean emitNamespace); | ||
|
||
/** | ||
* Sets the flag to decide whether to omit the XML declaration. | ||
* | ||
* <strong>Default value: {@value MarcXmlEncoder#OMIT_XML_DECLARATION}</strong> | ||
* | ||
* @param currentOmitXmlDeclaration true if the XML declaration is omitted, otherwise | ||
* false | ||
*/ | ||
void omitXmlDeclaration(final boolean currentOmitXmlDeclaration); | ||
|
||
/** | ||
* Sets the XML version. | ||
* | ||
* <strong>Default value: {@value MarcXmlEncoder#XML_VERSION}</strong> | ||
* | ||
* @param xmlVersion the XML version | ||
*/ | ||
void setXmlVersion(final String xmlVersion); | ||
|
||
/** | ||
* Sets the XML encoding. | ||
* | ||
* <strong>Default value: {@value MarcXmlEncoder#XML_ENCODING}</strong> | ||
* | ||
* @param xmlEncoding the XML encoding | ||
*/ | ||
void setXmlEncoding(final String xmlEncoding); | ||
|
||
/** | ||
* Formats the resulting xml by indentation. Aka "pretty printing". | ||
* | ||
* <strong>Default value: {@value MarcXmlEncoder#PRETTY_PRINTED}</strong> | ||
* | ||
* @param formatted true if formatting is activated, otherwise false | ||
*/ | ||
void setFormatted(final boolean formatted); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...facture-biblio/src/test/java/org/metafacture/biblio/marc21/MarcXmlEncoderWrapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.metafacture.biblio.marc21; | ||
|
||
import org.junit.Test; | ||
|
||
public class MarcXmlEncoderWrapperTest { | ||
@Test | ||
public void testMarcXmlEncoder() { | ||
MarcXmlEncoderTest test = new MarcXmlEncoderTest(new MarcXmlEncoder()); | ||
test.createAnRecordWithLeader(); | ||
MarcXmlEncoderTest test1 = new MarcXmlEncoderTest(new Marc21XmlEncoder()); | ||
test1.createAnRecordWithLeader(); | ||
} | ||
} |