Skip to content

Commit

Permalink
implement journal abbrev formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed Apr 4, 2018
1 parent ef27237 commit aff620a
Showing 1 changed file with 54 additions and 0 deletions.
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;
}

}

0 comments on commit aff620a

Please sign in to comment.