Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.formatter.bibtexfields

public Class NormalizeKeywordDelimitersFormatter

extends Formatter
implements KeywordSeparatorAware
Class Inheritance
All Implemented Interfaces
org.jabref.logic.cleanup.KeywordSeparatorAware
Annotations
@NullMarked
Imports
java.util.List, .Optional, java.util.stream.Stream, org.jabref.logic.cleanup.KeywordSeparatorAware, org.jabref.logic.formatter.Formatter, org.jabref.logic.importer.KeywordImportNormalizer, org.jabref.logic.l10n.Localization, org.jabref.logic.preferences.JabRefCliPreferences, org.jabref.model.entry.BibEntryPreferences, .KeywordList, com.airhacks.afterburner.injection.Injector, org.jspecify.annotations.NonNull, .NullMarked, .Nullable

Rewrites a keyword field that uses one of the accepted import delimiters to the keyword separator of the library.

A field that already uses the separator is returned unchanged, including its spacing, so applying this formatter to a consistent library never produces a diff.

impl->req~save.keywords.normalize-delimiters~1

Field Summary

Modifier and TypeField and Description
private final @Nullable BibEntryPreferences
private final @Nullable Character

Constructor Summary

AccessConstructor and Description
public
NormalizeKeywordDelimitersFormatter()

Unbound: preferences and separator are resolved from the global preferences when formatting.

public
NormalizeKeywordDelimitersFormatter(@Nullable BibEntryPreferences bibEntryPreferences, @Nullable Character
the separator to serialize with; null uses the one from the preferences
keywordSeparator
)

Method Summary

Modifier and TypeMethod and Description
public String
private BibEntryPreferences
public String
getDescription()

Implements abstract org.jabref.logic.formatter.Formatter.getDescription.

Returns a description of the formatter.

public String
getExampleInput()

Implements abstract org.jabref.logic.formatter.Formatter.getExampleInput.

Returns an example input string of the formatter.

public String
getKey()

Implements abstract org.jabref.logic.formatter.Formatter.getKey.

Returns a unique key for the formatter that can be used for its identification

public String
getName()

Implements abstract org.jabref.logic.formatter.Formatter.getName.

Returns a human readable name of the formatter usable for e.g. in the GUI

public Formatter
Inherited from org.jabref.logic.formatter.Formatter:
equalsformathashCode

Field Detail

bibEntryPreferencesback to summary
private final @Nullable BibEntryPreferences bibEntryPreferences
keywordSeparatorback to summary
private final @Nullable Character keywordSeparator

Constructor Detail

NormalizeKeywordDelimitersFormatterback to summary
public NormalizeKeywordDelimitersFormatter()

Unbound: preferences and separator are resolved from the global preferences when formatting.

NormalizeKeywordDelimitersFormatterback to summary
public NormalizeKeywordDelimitersFormatter(@Nullable BibEntryPreferences bibEntryPreferences, @Nullable Character keywordSeparator)
Parameters
keywordSeparator:@Nullable Character

the separator to serialize with; null uses the one from the preferences

Method Detail

formatback to summary
public String format(@NonNull String value)
Annotations
@Override
getBibEntryPreferencesback to summary
private BibEntryPreferences getBibEntryPreferences()
getDescriptionback to summary
public String getDescription()

Implements abstract org.jabref.logic.formatter.Formatter.getDescription.

Doc from org.jabref.logic.formatter.Formatter.getDescription.

Returns a description of the formatter.

Annotations
@Override
getExampleInputback to summary
public String getExampleInput()

Implements abstract org.jabref.logic.formatter.Formatter.getExampleInput.

Doc from org.jabref.logic.formatter.Formatter.getExampleInput.

Returns an example input string of the formatter. This example is used as input to the formatter to demonstrate its functionality

Annotations
@Override
getKeyback to summary
public String getKey()

Implements abstract org.jabref.logic.formatter.Formatter.getKey.

Doc from org.jabref.logic.formatter.Formatter.getKey.

Returns a unique key for the formatter that can be used for its identification

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract org.jabref.logic.formatter.Formatter.getName.

Doc from org.jabref.logic.formatter.Formatter.getName.

Returns a human readable name of the formatter usable for e.g. in the GUI

Annotations
@Override
withKeywordSeparatorback to summary
public Formatter withKeywordSeparator(Character keywordSeparator)

Implements org.jabref.logic.cleanup.KeywordSeparatorAware.withKeywordSeparator.

Annotations
@Override