Skip to content

Commit

Permalink
Add camel casing of BibLaTeX entry types
Browse files Browse the repository at this point in the history
  • Loading branch information
lenhard committed Dec 11, 2015
1 parent d174e2b commit be0a1ee
Showing 1 changed file with 61 additions and 10 deletions.
71 changes: 61 additions & 10 deletions src/main/java/net/sf/jabref/bibtex/CamelCaser.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,57 @@ class CamelCaser {


static {
// The field name display map.
nameMap.put("bibtexkey", "BibTeXKey");
nameMap.put("doi", "DOI");
nameMap.put("ee", "EE");
nameMap.put("howpublished", "HowPublished");
nameMap.put("lastchecked", "LastChecked");
nameMap.put("isbn", "ISBN");
nameMap.put("issn", "ISSN");
nameMap.put("UNKNOWN", "UNKNOWN");
nameMap.put("url", "URL");
put("bibtexkey", "BibTeXKey");
put("bookauthor", "BookAuthor");
put("booksubtitle", "BookSubTitle");
put("booktitle", "BookTitle");
put("booktitleaddon", "BookTitleAddon");
put("crossref", "CrossRef");
put("ctlalt_stretch_factor", "CtlAlt_Stretch_Factor");
put("ctldash_repeated_names", "CtlDash_Repeated_Names");
put("ctlname_format_string", "CtlName_Format_String");
put("ctlname_latex_cmd", "CtlName_Latex_Cmd");
put("ctlname_url_prefix", "CtlName_Url_Prefix");
put("ctlmax_names_forced_etal", "CtlMax_Names_Forced_Etal");
put("ctlnames_show_etal", "CtlNames_Show_Etal");
put("ctluse_alt_spacing", "CtlUse_Alt_Spacing");
put("ctluse_article_number", "CtlUse_Article_Number");
put("ctluse_forced_etal", "Ctl_Forced_Etal");
put("ctluse_paper", "CtlUse_Paper");
put("ctluse_url", "CtlUse_Url");
put("doi", "DOI");
put("editora", "EditorA");
put("editorb", "EditorB");
put("editorc", "EditorC");
put("ee", "EE");
put("eid", "EID");
put("entryset", "EntrySet");
put("eprint", "Eprint");
put("eprintclass", "EprintClass");
put("eprinttype", "EprintType");
put("eventdate", "EventDate");
put("eventtitle", "EventTitle");
put("eventtitleaddon", "EventTitleAddon");
put("howpublished", "HowPublished");
put("issuesubtitle", "IssueSubTitle");
put("issuetitle", "IssueTitle");
put("journalsubtitle", "JournalSubTitle");
put("journaltitle", "JournalTitle");
put("lastchecked", "LastChecked");
put("isbn", "ISBN");
put("isrn", "ISRN");
put("issn", "ISSN");
put("mainsubtitle", "MainSubTitle");
put("maintitle", "MainTitle");
put("maintitleaddon", "MainTitleAddon");
put("origlanguage", "OrigLanguage");
put("pagetotal", "PageTotal");
put("pubstate", "PubState");
put("subtitle", "SubTitle");
put("titleaddon", "TitleAddon");
put("UNKNOWN", "UNKNOWN");
put("url", "Url");
put("urldate", "UrlDate");
}

/**
Expand All @@ -44,4 +85,14 @@ public static String toCamelCase(String fieldName) {

return camelCaseName;
}

/**
* Helper method to avoid a direct access to nameMap
*
* @param key a key to put in nameMap
* @param value the value to put in nameMap for key
*/
private static void put(String key, String value) {
nameMap.put(key, value);
}
}

0 comments on commit be0a1ee

Please sign in to comment.