-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
1 parent
ef27237
commit aff620a
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/main/java/org/jabref/logic/formatter/bibtexfields/JournalMedlineAbbreviator.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 org.jabref.logic.formatter.bibtexfields; | ||
|
||
import java.util.Objects; | ||
|
||
import org.jabref.logic.journals.JournalAbbreviationLoader; | ||
import org.jabref.logic.journals.JournalAbbreviationPreferences; | ||
import org.jabref.model.cleanup.Formatter; | ||
|
||
public class JournalMedlineAbbreviator implements Formatter { | ||
|
||
//TODO: How do I pass the prefs at best? | ||
public JournalMedlineAbbreviator(JournalAbbreviationLoader repostioryLoader, | ||
JournalAbbreviationPreferences journalAbbreviationPreferences) { | ||
this.repostioryLoader = Objects.requireNonNull(repostioryLoader); | ||
this.journalAbbreviationPreferences = Objects.requireNonNull(journalAbbreviationPreferences); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getKey() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
private final JournalAbbreviationLoader repostioryLoader; | ||
private final JournalAbbreviationPreferences journalAbbreviationPreferences; | ||
|
||
|
||
|
||
@Override | ||
public String format(String fieldText) { | ||
return repostioryLoader.getRepository(journalAbbreviationPreferences) | ||
.getIsoAbbreviation(fieldText) | ||
.orElse(fieldText); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getExampleInput() { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
} |