-
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
84 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
54 changes: 54 additions & 0 deletions
54
src/main/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagLDO.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,54 @@ | ||
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; | ||
import de.gwdg.metadataqa.marc.definition.general.parser.LinkageParser; | ||
import de.gwdg.metadataqa.marc.definition.general.validator.ISSNValidator; | ||
|
||
import static de.gwdg.metadataqa.marc.definition.FRBRFunction.*; | ||
|
||
/** | ||
* LDO (Legal Deposit Office) Information | ||
*/ | ||
public class TagLDO extends DataFieldDefinition { | ||
|
||
private static TagLDO uniqueInstance; | ||
|
||
private TagLDO() { | ||
initialize(); | ||
postCreation(); | ||
} | ||
|
||
public static TagLDO getInstance() { | ||
if (uniqueInstance == null) | ||
uniqueInstance = new TagLDO(); | ||
return uniqueInstance; | ||
} | ||
|
||
private void initialize() { | ||
|
||
tag = "LDO"; | ||
label = "LDO (Legal Deposit Office) Information"; | ||
mqTag = "LegalDepositOfficeInformation"; | ||
cardinality = Cardinality.Repeatable; | ||
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html"; | ||
// setCompilanceLevels("O"); | ||
|
||
ind1 = new Indicator(); | ||
|
||
ind2 = new Indicator(); | ||
|
||
setSubfieldsWithCardinality( | ||
"a", "Source of record", "NR", | ||
"b", "Format of item used for record", "NR", | ||
"c", "Date at Copyright Agent", "NR", | ||
"d", "ALDL control number", "NR" | ||
); | ||
|
||
getSubfield("a").setMqTag("source"); | ||
getSubfield("b").setMqTag("dormat"); | ||
getSubfield("c").setMqTag("date"); | ||
getSubfield("d").setMqTag("controlNumber"); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagLDOTest.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,24 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import org.junit.Test; | ||
|
||
public class TagLDOTest extends BLTagTest { | ||
|
||
public TagLDOTest() { | ||
super(TagLDO.getInstance()); | ||
} | ||
|
||
@Test | ||
public void testValidFields() { | ||
validField("a", "CIP", "b", "hbk"); | ||
validField("a", "CIP", "b", "pbk"); | ||
validField("a", "LDO", "b", "pack", "c", "12/6/02"); | ||
validField("a", "ALDL", "b", "pbk", "c", "12/10/05", "d", "3982641"); | ||
} | ||
|
||
@Test | ||
public void testInvalidFields() { | ||
invalidField("3", "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