-
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
4 changed files
with
80 additions
and
2 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
47 changes: 47 additions & 0 deletions
47
src/main/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagLET.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,47 @@ | ||
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; | ||
|
||
/** | ||
* Serials claim letter title | ||
*/ | ||
public class TagLET extends DataFieldDefinition { | ||
|
||
private static TagLET uniqueInstance; | ||
|
||
private TagLET() { | ||
initialize(); | ||
postCreation(); | ||
} | ||
|
||
public static TagLET getInstance() { | ||
if (uniqueInstance == null) | ||
uniqueInstance = new TagLET(); | ||
return uniqueInstance; | ||
} | ||
|
||
private void initialize() { | ||
|
||
tag = "LET"; | ||
label = "Serials claim letter title"; | ||
mqTag = "SerialsClaimLetterTitle"; | ||
cardinality = Cardinality.Nonrepeatable; | ||
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html"; | ||
// setCompilanceLevels("O"); | ||
|
||
ind1 = new Indicator(); | ||
|
||
ind2 = new Indicator("Number of non-filing characters") | ||
.setCodes("0-9", "0-9") | ||
.setMqTag("nonFilingCharacters"); | ||
ind2.getCode("0-9").setRange(true); | ||
|
||
setSubfieldsWithCardinality( | ||
"a", "Serial claim letter title", "NR" | ||
); | ||
|
||
getSubfield("a").setMqTag("title"); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/test/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagLETTest.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,31 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import de.gwdg.metadataqa.marc.DataField; | ||
import org.junit.Test; | ||
|
||
public class TagLETTest extends BLTagTest { | ||
|
||
public TagLETTest() { | ||
super(TagLET.getInstance()); | ||
} | ||
|
||
@Test | ||
public void testValidFields() { | ||
validField(new DataField(tag, " ", "0", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "1", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "2", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "3", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "4", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "5", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "6", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "7", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "8", "a", "British farmer and grower. West Midlands ed.")); | ||
validField(new DataField(tag, " ", "9", "a", "British farmer and grower. West Midlands ed.")); | ||
} | ||
|
||
@Test | ||
public void testInvalidFields() { | ||
invalidField("1", "a", "Y"); | ||
invalidField("e", "20050944"); | ||
} | ||
} |
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