Verified Owner
Top Fields Constructors Methods
org.jabref.toolkit.commands

pack-priv Class GenerateCitationKeys

extends Object
implements Callable<Integer>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable
Annotations
@Command
name:generate
description:Generate citation keys for entries in a .bib file.
Imports
java.nio.file.Path, java.util.Map, java.util.concurrent.Callable, javafx.beans.property.SimpleObjectProperty, org.jabref.logic.citationkeypattern.CitationKeyGenerator, .CitationKeyPatternPreferences, .GlobalCitationKeyPatterns, org.jabref.logic.importer.ParserResult, org.jabref.logic.l10n.Localization, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.model.entry.types.EntryType, .EntryTypeFactory, .UnknownEntryType, org.jabref.toolkit.converter.KeySuffixConverter, org.jabref.toolkit.exception.ExportServiceException, .ImportServiceException, org.jabref.toolkit.service.ExportService, .ImportService, org.jspecify.annotations.NonNull, .Nullable, picocli.CommandLine

Field Summary

Modifier and TypeField and Description
private Boolean
private Boolean
private InputOption
private String
private String
private Map<String, String>
private KeySuffix
private Character
private Path
private CitationKeys
private String
private JabKit.SharedOptions
private Boolean
private String
private Boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Integer
call()

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

private @NonNull CitationKeyGenerator
private GlobalCitationKeyPatterns

Returns:

keyPatterns from preferences or overridden by user-supplied patterns
getKeyPatterns
(@Nullable Map<String, String>
patterns submitted by a user via --key-patterns option
keyPatternsOption
,
GlobalCitationKeyPatterns
patterns from preferences
keyPatternsPreferences
)

Creates keyPatterns from preferences and --key-patterns option

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

avoidOverwriteback to summary
private Boolean avoidOverwrite
Annotations
@Option
names:--avoid-overwrite
description:Avoid overwriting existing citation keys
generateBeforeSavingback to summary
private Boolean generateBeforeSaving
Annotations
@Option
names:--generate-before-saving
description:Generate citation keys before saving
inputOptionback to summary
private InputOption inputOption
Annotations
@Mixin
keyPatternRegexback to summary
private String keyPatternRegex
Annotations
@Option
names:--regex
description:Regular expression for key pattern matching
keyPatternReplacementback to summary
private String keyPatternReplacement
Annotations
@Option
names:--regex-replacement
description:Replacement string for regex matches
keyPatternsback to summary
private Map<String, String> keyPatterns
Annotations
@Option
names:--key-patterns
description:Key patterns for specific entry types
keySuffixback to summary
private KeySuffix keySuffix
Annotations
@Option
names:--suffix
description:Key suffix strategy: ALWAYS, SECOND_WITH_A, SECOND_WITH_B
converter:KeySuffixConverter
keywordDelimiterback to summary
private Character keywordDelimiter
Annotations
@Option
names:--keyword-delimiter
description:Delimiter to use between keywords in citation key
outputFileback to summary
private Path outputFile
Annotations
@Option
names:--output
description:Output .bib file
parentCommandback to summary
private CitationKeys parentCommand
Annotations
@ParentCommand
patternback to summary
private String pattern
Annotations
@Option
names:--pattern
description:Override the citation key pattern from the preferences
sharedOptionsback to summary
private JabKit.SharedOptions sharedOptions
Annotations
@Mixin
transliterateback to summary
private Boolean transliterate
Annotations
@Option
names:--transliterate
description:Transliterate fields for citation key generation
unwantedCharactersback to summary
private String unwantedCharacters
Annotations
@Option
names:--unwanted
description:Unwanted characters to remove from generated keys
warnBeforeOverwriteback to summary
private Boolean warnBeforeOverwrite
Annotations
@Option
names:--warn-before-overwrite
description:Warn before overwriting existing citation keys

Constructor Detail

GenerateCitationKeysback to summary
pack-priv GenerateCitationKeys()

Method Detail

callback to summary
public Integer call() throws ImportServiceException, ExportServiceException

Implements java.util.concurrent.Callable.call.

Doc from java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

Annotations
@Override
getCitationKeyGeneratorback to summary
private @NonNull CitationKeyGenerator getCitationKeyGenerator(BibDatabaseContext databaseContext)
getKeyPatternsback to summary
private GlobalCitationKeyPatterns getKeyPatterns(@Nullable Map<String, String> keyPatternsOption, GlobalCitationKeyPatterns keyPatternsPreferences)

Creates keyPatterns from preferences and --key-patterns option

Parameters
keyPatternsOption:@Nullable Map<String, String>

patterns submitted by a user via --key-patterns option

keyPatternsPreferences:GlobalCitationKeyPatterns

patterns from preferences

Returns:GlobalCitationKeyPatterns

keyPatterns from preferences or overridden by user-supplied patterns