use of cz.mzk.recordmanager.server.util.identifier.NoDataException in project RecordManager2 by moravianlibrary.
the class MetadataDublinCoreRecord method getISMNs.
@Override
public List<Ismn> getISMNs() {
List<Ismn> results = new ArrayList<>();
Long ismnCounter = 0L;
Matcher matcher;
for (String identifier : dcRecord.getIdentifiers()) {
String rawIsmnStr = "";
if ((matcher = DC_ISMN_PATTERN.matcher(identifier)).find())
rawIsmnStr = matcher.group(1);
else if (!DC_IDENTIFIER_PATTERN.matcher(identifier).matches())
rawIsmnStr = identifier;
Long validIsmnLong;
try {
validIsmnLong = ISMNUtils.toIsmn13LongThrowing(rawIsmnStr);
} catch (NoDataException nde) {
continue;
} catch (NumberFormatException nfe) {
logger.info(String.format("Invalid ISMN: %s", rawIsmnStr));
continue;
}
results.add(Ismn.create(validIsmnLong, ++ismnCounter, ""));
}
return results;
}
use of cz.mzk.recordmanager.server.util.identifier.NoDataException in project RecordManager2 by moravianlibrary.
the class MetadataMarcRecord method getISMNs.
@Override
public List<Ismn> getISMNs() {
List<Ismn> results = new ArrayList<>();
Long ismnCounter = 0L;
Ismn ismn;
for (DataField df : underlayingMarc.getDataFields("024")) {
try {
ismn = ISMNUtils.createIsmn(df);
} catch (NoDataException nde) {
continue;
} catch (NumberFormatException nfe) {
logger.info(String.format("Invalid ISMN: %s", nfe.getMessage()));
continue;
}
ismn.setOrderInRecord(++ismnCounter);
results.add(ismn);
}
return results;
}
use of cz.mzk.recordmanager.server.util.identifier.NoDataException in project RecordManager2 by moravianlibrary.
the class MetadataMarcRecord method getISSNs.
@Override
public List<Issn> getISSNs() {
List<Issn> results = new ArrayList<>();
Long issnCounter = 0L;
Issn issn;
for (DataField df : underlayingMarc.getDataFields("022")) {
try {
issn = ISSNUtils.createIssn(df);
} catch (NoDataException nde) {
continue;
} catch (NumberFormatException nfe) {
logger.info(String.format("Invalid ISSN: %s", nfe.getMessage()));
continue;
}
issn.setOrderInRecord(++issnCounter);
results.add(issn);
}
return results;
}
use of cz.mzk.recordmanager.server.util.identifier.NoDataException in project RecordManager2 by moravianlibrary.
the class MetadataMarcRecord method getISBNs.
@Override
public List<Isbn> getISBNs() {
List<Isbn> isbns = new ArrayList<>();
Long isbnCounter = 0L;
Isbn isbn;
for (DataField df : underlayingMarc.getDataFields("020")) {
try {
isbn = ISBNUtils.createIsbn(df);
} catch (NoDataException nde) {
continue;
} catch (NumberFormatException nfe) {
logger.info(String.format("Invalid ISBN: %s", nfe.getMessage()));
continue;
}
isbn.setOrderInRecord(++isbnCounter);
isbns.add(isbn);
}
return isbns;
}
use of cz.mzk.recordmanager.server.util.identifier.NoDataException in project RecordManager2 by moravianlibrary.
the class MetadataMarcRecord method getEANs.
@Override
public List<Ean> getEANs() {
List<Ean> results = new ArrayList<>();
Long eanCounter = 0L;
Ean ean;
for (DataField df : underlayingMarc.getDataFields("024")) {
try {
ean = EANUtils.createEan(df);
} catch (NoDataException nde) {
continue;
} catch (NumberFormatException nfe) {
logger.info(String.format("Invalid EAN: %s", nfe.getMessage()));
continue;
}
ean.setOrderInRecord(++eanCounter);
results.add(ean);
}
return results;
}
Aggregations