-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
76 additions
and
3 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
50 changes: 50 additions & 0 deletions
50
src/main/java/de/gwdg/metadataqa/marc/definition/tags/bltags/Tag960.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,50 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import de.gwdg.metadataqa.marc.definition.Cardinality; | ||
import de.gwdg.metadataqa.marc.definition.DataFieldDefinition; | ||
import de.gwdg.metadataqa.marc.definition.Indicator; | ||
|
||
/** | ||
* Normalised Place of Publication | ||
*/ | ||
public class Tag960 extends DataFieldDefinition { | ||
|
||
private static Tag960 uniqueInstance; | ||
|
||
private Tag960() { | ||
initialize(); | ||
postCreation(); | ||
} | ||
|
||
public static Tag960 getInstance() { | ||
if (uniqueInstance == null) | ||
uniqueInstance = new Tag960(); | ||
return uniqueInstance; | ||
} | ||
|
||
private void initialize() { | ||
|
||
tag = "960"; | ||
label = "Normalised Place of Publication"; | ||
mqTag = "normalisedPlaceOfPublication"; | ||
cardinality = Cardinality.Repeatable; | ||
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html"; | ||
// setCompilanceLevels("O"); | ||
|
||
ind1 = new Indicator("Printing instruction") | ||
.setCodes( | ||
"0", "Printing data", | ||
"1", "Non-printing data" | ||
) | ||
.setMqTag("printingInstruction"); | ||
|
||
ind2 = new Indicator(); | ||
|
||
setSubfieldsWithCardinality( | ||
"a", "Normalised place of publication", "NR" | ||
); | ||
|
||
getSubfield("a") | ||
.setMqTag("place"); | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/test/java/de/gwdg/metadataqa/marc/definition/tags/bltags/Tag960Test.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,23 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import org.junit.Test; | ||
|
||
public class Tag960Test extends BLTagTest { | ||
|
||
public Tag960Test() { | ||
super(Tag960.getInstance()); | ||
} | ||
|
||
@Test | ||
public void testValidFields() { | ||
validField("0", "a", "Warsaw"); | ||
validField("1", "a", "Warsaw"); | ||
validField("0", "a", "Lund"); | ||
} | ||
|
||
@Test | ||
public void testInvalidFields() { | ||
invalidField("2", "a", "Priority processing"); | ||
invalidField("b", "Priority processing"); | ||
} | ||
} |
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