-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
dev: code-qualityIssues related to code or architecture decisionsIssues related to code or architecture decisions
Description
The class org.jabref.logic.importer.fileformat.MedlineImporter
uses JAXB, but can be rewritten using a StAX-Parser and thus getting rid of a JAXB dependency.
Example:
Old code:
Object unmarshalledObject = unmarshallRoot(reader);
// check whether we have an article set, an article, a book article or a book article set
if (unmarshalledObject instanceof PubmedArticleSet) {
PubmedArticleSet articleSet = (PubmedArticleSet) unmarshalledObject;
for (Object article : articleSet.getPubmedArticleOrPubmedBookArticle()) {
if (article instanceof PubmedArticle) {
New code:
XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(reader);
xmlStreamReader.nextTag();
String rootElementName = xmlStreamReader.getName().getLocalPart();
switch (rootElementName) {
case "PubMedArticleSet":
...
break;
case "PubmedArticle":
parseArticle(xmlStreamReader, bibItems);
break;
case "PubmedBookArticle":
parseBookArticle(xmlStreamReader, bibItems);
break;
...
Metadata
Metadata
Assignees
Labels
dev: code-qualityIssues related to code or architecture decisionsIssues related to code or architecture decisions
Type
Projects
Status
Done