Top Fields Constructors Methods
org.jabref.logic.database

public Class DatabaseMerger

extends Object
Class Inheritance
Imports
java.util.List, .Objects, java.util.stream.Collectors, org.jabref.model.database.BibDatabase, .BibDatabaseContext, .BibDatabaseModeDetection, org.jabref.model.entry.BibEntry, .BibEntryTypesManager, .BibtexString, org.jabref.model.groups.AllEntriesGroup, .ExplicitGroup, .GroupHierarchyType, org.jabref.model.metadata.ContentSelector, .MetaData, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final char
private static final Logger

Constructor Summary

AccessConstructor and Description
public
DatabaseMerger(char keywordDelimiter)

Method Summary

Modifier and TypeMethod and Description
public synchronized void
merge(BibDatabase target, BibDatabase
The other databases that is merged into this database
other
)

Merges all entries and strings of the other database into the target database.

public synchronized void
merge(BibDatabaseContext target, BibDatabaseContext
The other databases that is merged into this database
other
,
String otherFileName)

Merges all entries, strings, and metaData of the other database context into the target database context.

private void
private void
private void
mergeGroups(MetaData target, MetaData other, String otherFilename, List<BibEntry> allOtherEntries)

public void
mergeMetaData(MetaData
the metaData that is the merge target
target
,
MetaData
the metaData to merge into the target
other
,
String
the filename of the other library. Pass "unknown" if not known.
otherFilename
,
List<BibEntry> allOtherEntries)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keywordDelimiterback to summary
private final char keywordDelimiter
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

DatabaseMergerback to summary
public DatabaseMerger(char keywordDelimiter)

Method Detail

mergeback to summary
public synchronized void merge(BibDatabase target, BibDatabase other)

Merges all entries and strings of the other database into the target database. Any duplicates are ignored. In case a string has a different content, it is added with a new unique name. The unique name is generated by suffix "_i", where i runs from 1 onwards.

Parameters
other:BibDatabase

The other databases that is merged into this database

mergeback to summary
public synchronized void merge(BibDatabaseContext target, BibDatabaseContext other, String otherFileName)

Merges all entries, strings, and metaData of the other database context into the target database context. Any duplicates are ignored. In case a string has a different content, it is added with a new unique name. The unique name is generated by suffix "_i", where i runs from 1 onwards.

Parameters
other:BibDatabaseContext

The other databases that is merged into this database

mergeContentSelectorsback to summary
private void mergeContentSelectors(MetaData target, MetaData other)
mergeEntriesback to summary
private void mergeEntries(BibDatabase target, BibDatabase other)
mergeGroupsback to summary
private void mergeGroups(MetaData target, MetaData other, String otherFilename, List<BibEntry> allOtherEntries)
mergeMetaDataback to summary
public void mergeMetaData(MetaData target, MetaData other, String otherFilename, List<BibEntry> allOtherEntries)
Parameters
target:MetaData

the metaData that is the merge target

other:MetaData

the metaData to merge into the target

otherFilename:String

the filename of the other library. Pass "unknown" if not known.

mergeStringsback to summary
public void mergeStrings(BibDatabase target, BibDatabase other)