-
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
72 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
48 changes: 48 additions & 0 deletions
48
src/main/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagNEG.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,48 @@ | ||
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.validator.RegexValidator; | ||
|
||
/** | ||
* LDO (Legal Deposit Office) Signoff | ||
*/ | ||
public class TagNEG extends DataFieldDefinition { | ||
|
||
private static TagNEG uniqueInstance; | ||
|
||
private TagNEG() { | ||
initialize(); | ||
postCreation(); | ||
} | ||
|
||
public static TagNEG getInstance() { | ||
if (uniqueInstance == null) | ||
uniqueInstance = new TagNEG(); | ||
return uniqueInstance; | ||
} | ||
|
||
private void initialize() { | ||
|
||
tag = "NEG"; | ||
label = "LDO (Legal Deposit Office) Signoff"; | ||
mqTag = "LegalDepositOfficeSignoff"; | ||
cardinality = Cardinality.Nonrepeatable; | ||
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html"; | ||
// setCompilanceLevels("O"); | ||
obsolete = true; | ||
|
||
ind1 = new Indicator(); | ||
|
||
ind2 = new Indicator(); | ||
|
||
setSubfieldsWithCardinality( | ||
"a", "LDO signoff", "NR" | ||
); | ||
|
||
getSubfield("a") | ||
.setValidator(new RegexValidator("^.*[^\\.]$")) | ||
.setMqTag("ldoSignoff"); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/test/java/de/gwdg/metadataqa/marc/definition/tags/bltags/TagNEGTest.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,22 @@ | ||
package de.gwdg.metadataqa.marc.definition.tags.bltags; | ||
|
||
import org.junit.Test; | ||
|
||
public class TagNEGTest extends BLTagTest { | ||
|
||
public TagNEGTest() { | ||
super(TagNEG.getInstance()); | ||
} | ||
|
||
@Test | ||
public void testValidFields() { | ||
validField("a", "Negative"); | ||
} | ||
|
||
@Test | ||
public void testInvalidFields() { | ||
invalidField("1", "a", "Negative"); | ||
invalidField("a", "Negative."); | ||
invalidField("b", "Negative"); | ||
} | ||
} |
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