| Modifier and Type | Field and Description |
|---|---|
| public static final String | APPENDIX_CHARACTERS
All single characters that we can use for extending a key to make it unique. |
| private final CitationKeyPatternPreferences | |
| private final AbstractCitationKeyPatterns | |
| private final BibDatabase | |
| public static final String | DEFAULT_UNWANTED_CHARACTERS
List of unwanted characters. |
| private static final List | |
| private static final Logger | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | CitationKeyGenerator(BibDatabaseContext bibDatabaseContext, CitationKeyPatternPreferences citationKeyPatternPreferences)
|
| public | CitationKeyGenerator(AbstractCitationKeyPatterns citeKeyPattern, BibDatabase database, CitationKeyPatternPreferences citationKeyPatternPreferences)
|
| Modifier and Type | Method and Description |
|---|---|
| private String | Returns: a key, if needed, with an appended letterthe new key key, String the old key oldKey)A letter will be appended to the key based on the user's preferences, either always or to prevent duplicated keys. |
| public static String | |
| private String | |
| private Function | Returns: a cleaned citation key for the givenBibEntrythe entry)BibEntry that a citation key is generated forA helper method to create a |
| public Optional | Returns: the change to the key (or an empty optional if the key was not changed)the entry to generate the key for entry)Generates a citation key for the given entry, and sets the key. |
| public String | Returns: a citation key based on the user's preferencesa entry)BibEntryGenerate a citation key for the given |
| private static String | Returns: The String to append.The appendix number. number)Computes an appendix to a citation key that could make it unique. |
| public static String | |
| public static String | |
| private String | Returns: the citation key where matches to the regex are replacedthe citation key key)Using preferences, replace matches to the provided regex with a string. |
| APPENDIX_CHARACTERS | back to summary |
|---|---|
| public static final String APPENDIX_CHARACTERS All single characters that we can use for extending a key to make it unique. | |
| citationKeyPatternPreferences | back to summary |
|---|---|
| private final CitationKeyPatternPreferences citationKeyPatternPreferences | |
| citeKeyPattern | back to summary |
|---|---|
| private final AbstractCitationKeyPatterns citeKeyPattern | |
| database | back to summary |
|---|---|
| private final BibDatabase database | |
| DEFAULT_UNWANTED_CHARACTERS | back to summary |
|---|---|
| public static final String DEFAULT_UNWANTED_CHARACTERS List of unwanted characters. These will be removed at the end.
Note that | |
| DISALLOWED_CHARACTERS | back to summary |
|---|---|
| private static final List<Character> DISALLOWED_CHARACTERS | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER Hides org. | |
| unwantedCharacters | back to summary |
|---|---|
| private final String unwantedCharacters | |
| CitationKeyGenerator | back to summary |
|---|---|
| public CitationKeyGenerator(BibDatabaseContext bibDatabaseContext, CitationKeyPatternPreferences citationKeyPatternPreferences) | |
| CitationKeyGenerator | back to summary |
|---|---|
| public CitationKeyGenerator(AbstractCitationKeyPatterns citeKeyPattern, BibDatabase database, CitationKeyPatternPreferences citationKeyPatternPreferences) | |
| appendLettersToKey | back to summary |
|---|---|
| private String appendLettersToKey(String key, String oldKey) A letter will be appended to the key based on the user's preferences, either always or to prevent duplicated keys. | |
| cleanKey | back to summary |
|---|---|
| public static String cleanKey(String key, String unwantedCharacters) | |
| createCitationKeyFromPattern | back to summary |
|---|---|
| private String createCitationKeyFromPattern(BibEntry entry) | |
| expandBracketContent | back to summary |
|---|---|
| private Function A helper method to create a | |
| generateAndSetKey | back to summary |
|---|---|
| public Optional Generates a citation key for the given entry, and sets the key.
| |
| generateKey | back to summary |
|---|---|
| public String generateKey(BibEntry entry) Generate a citation key for the given | |
| getAppendix | back to summary |
|---|---|
| private static String getAppendix(int number) Computes an appendix to a citation key that could make it unique. We use a-z for numbers 0-25, and then aa-az, ba-bz, etc.
| |
| removeDefaultUnwantedCharacters | back to summary |
|---|---|
| public static String removeDefaultUnwantedCharacters(String key) | |
| removeUnwantedCharacters | back to summary |
|---|---|
| public static String removeUnwantedCharacters(String key, String unwantedCharacters) | |
| replaceWithRegex | back to summary |
|---|---|
| private String replaceWithRegex(String key) Using preferences, replace matches to the provided regex with a string. | |